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