client.defineJob({ id: "my-job", name: "My job", version: "0.1.1", trigger: eventTrigger({ name: "dynamic.cron", schema: z.object({ id: z.string(), cron: z.string(), }), }), run: async (payload, io, ctx) => { //registers a DynamicSchedule with a CRON expression await io.registerCron("register-cron", dynamicSchedule, payload.id, { cron: payload.cron, }); }, });
io.registerCron() allows you to register a DynamicSchedule that will trigger any jobs it’s attached to on a regular CRON schedule.
io.registerCron()
run()
Hide options
Hide properties
Was this page helpful?