API reference
The Trigger.dev API
Create a new IMPERATIVE schedule based on the specified options.
IMPERATIVE
Typescript
import { schedules } from "@trigger.dev/sdk"; const schedule = await schedules.create({ task: 'my-task', cron: '0 0 * * *' deduplicationKey: 'my-schedule', timezone: 'America/New_York' });
{ "id": "sched_1234", "task": "my-scheduled-task", "type": "IMPERATIVE", "active": true, "deduplicationKey": "dedup_key_1234", "externalId": "user_1234", "generator": { "type": "CRON", "expression": "0 0 * * *", "description": "Every day at midnight" }, "timezone": "America/New_York", "nextRun": "2024-04-01T00:00:00Z", "environments": [ { "id": "<string>", "type": "<string>", "userName": "<string>" } ] }
Show child attributes
Was this page helpful?