A task that is triggered on a recurring schedule using CRON syntax.
schedules.task()
.timestamp
- the time the task was scheduled to runlastTimestamp
- the time the task was last runscheduleId
- the id of the schedule that triggered the taskexternalId
- the external id you (optionally) provided when creating the scheduleupcoming
- the next 5 times the task is scheduled to runGo to the Schedules page
Create your schedule
Name | Description |
---|---|
Task | The id of the task you want to attach to. |
CRON pattern | The schedule in CRON format. |
External id | An optional external id, usually you’d use a userId. |
Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. |
Environments | The environments this schedule will run in. |
schedules.create()
to create a schedule from your code. Here’s the simplest possible example:
task
id must be a task that you defined using schedules.task()
.task
, cron
, and externalId
but only one with the same deduplicationKey
.
This means you can have thousands of schedules attached to a single task, but only one schedule per deduplicationKey
. Here’s an example with all the options:
externalId
you can have schedules for your users. This is useful for things like reminders, where you want to have a schedule for each user.
A reminder task:
scheduleId
will always come through as sched_1234
to the run.
Go to the Test page
Create your schedule