Skip to main content

Overview

Returns a paginated list of all schedules — both DECLARATIVE schedules (defined in code with the cron option on schedules.task) and IMPERATIVE schedules (created via the dashboard or schedules.create()).
Authentication with a secret key is required.

Endpoint

GET https://api.trigger.dev/api/v1/schedules

Query parameters

page
integer
Page number (1-based). Defaults to 1.
perPage
integer
Number of schedules per page. Defaults to 20.

Response

data
object[]
Array of schedule objects.
pagination
object

Examples

import { schedules } from "@trigger.dev/sdk";

const result = await schedules.list();

for (const schedule of result.data) {
  console.log(
    schedule.id,
    schedule.task,
    schedule.generator.expression,
    schedule.active
  );
}

Response example

{
  "data": [
    {
      "id": "sched_1234",
      "task": "my-scheduled-task",
      "type": "IMPERATIVE",
      "active": true,
      "deduplicationKey": "daily-report",
      "externalId": "user_5678",
      "generator": {
        "type": "CRON",
        "expression": "0 9 * * 1-5",
        "description": "Every weekday at 9am"
      },
      "timezone": "America/New_York",
      "nextRun": "2024-04-02T13:00:00Z",
      "environments": [
        { "id": "cl1234", "type": "PRODUCTION" }
      ]
    }
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 3,
    "count": 57
  }
}

Build docs developers (and LLMs) love