client.defineJob({
id: "unregister-job",
name: "Unregister dynamic schedule",
version: "0.1.1",
trigger: eventTrigger({
  name: "schedule.unregister",
  schema: z.object({
    id: z.string(),
  }),
}),
run: async (payload, io, ctx) => {
  //unregisters a DynamicSchedule with a CRON 
  await io.unregisterCron("βŒπŸ“†", dynamicSchedule, payload.id);
},
});

This has been deprecated in favor of DynamicSchedule.unregister

Parameters

cacheKey
string
required

Should be a stable and unique cache key inside the run(). See resumability for more information.

dynamicSchedule
DynamicSchedule
required

A DynamicSchedule that will trigger any Jobs it’s attached to on a regular interval.

id
string
required

A unique id for the schedule. This is used to identify and unregister the schedule later.

Returns

A Promise with the following shape:

ok
boolean
required

Whether the schedule was successfully unregistered.