> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Schedule

Create a new schedule in the scheduler blob revision. The schedule is registered with the underlying scheduling service immediately and begins firing according to its configuration once it becomes active.

## **POST** `/revisions/:id/data/command` (Command: `create_schedule`)

### Request Body

| Parameter                | Type    | Required    | Description                                                                                                                                             |
| :----------------------- | :------ | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `engine`                 | string  | Yes         | Must be `scheduler_blobhub`.                                                                                                                            |
| `command`                | string  | Yes         | Must be `create_schedule`.                                                                                                                              |
| `repeat`                 | string  | Yes         | Either `one_time` or `recurring_cron`.                                                                                                                  |
| `timezone`               | string  | Yes         | IANA timezone name (e.g. `America/New_York`, `UTC`).                                                                                                    |
| `invocation_target_type` | string  | Yes         | Must be `workflow`.                                                                                                                                     |
| `invocation_target`      | object  | Yes         | Target to invoke when the schedule fires. See Overview for field details.                                                                               |
| `cron_expression`        | string  | Conditional | Required when `repeat` is `recurring_cron`. Six-field AWS cron expression.                                                                              |
| `invocation_time`        | string  | Conditional | Required when `repeat` is `one_time`. ISO 8601 datetime without timezone suffix (e.g. `2026-05-01T14:30:00`), interpreted in the schedule's `timezone`. |
| `enabled`                | boolean | No          | Whether the schedule is initially enabled. Defaults to `true`.                                                                                          |
| `start_date`             | string  | No          | ISO 8601 UTC datetime before which the schedule does not fire.                                                                                          |
| `end_date`               | string  | No          | ISO 8601 UTC datetime after which the schedule does not fire.                                                                                           |

### Response

| Parameter  | Type   | Description                  |
| :--------- | :----- | :--------------------------- |
| `schedule` | object | The created schedule object. |

### Example (Recurring Cron)

<CodeGroup>
  ```json Request theme={null}
  {
    "engine": "scheduler_blobhub",
    "command": "create_schedule",
    "repeat": "recurring_cron",
    "cron_expression": "0 9 * * ? *",
    "timezone": "America/New_York",
    "enabled": true,
    "invocation_target_type": "workflow",
    "invocation_target": {
      "revision_id": "rev-789",
      "session_id": "sess-abc",
      "workflow_alias": "daily-report",
      "input_data": []
    }
  }
  ```

  ```json Response theme={null}
  {
    "schedule": {
      "id": "sched-001",
      "revision_id": "rev-scheduler-001",
      "created_at": "2026-04-07T12:00:00Z",
      "modified_at": "2026-04-07T12:00:00Z",
      "auth_target": "user",
      "auth_target_id": "user-001",
      "enabled": true,
      "repeat": "recurring_cron",
      "cron_expression": "0 9 * * ? *",
      "invocation_time": null,
      "timezone": "America/New_York",
      "start_date": null,
      "end_date": null,
      "state": "active",
      "invocation_target_type": "workflow",
      "invocation_target": {
        "org_id": "org-123",
        "blob_id": "blob-456",
        "revision_id": "rev-789",
        "session_id": "sess-abc",
        "workflow_alias": "daily-report",
        "input_data": []
      }
    }
  }
  ```
</CodeGroup>

### Example (One-Time)

<CodeGroup>
  ```json Request theme={null}
  {
    "engine": "scheduler_blobhub",
    "command": "create_schedule",
    "repeat": "one_time",
    "invocation_time": "2026-05-01T14:30:00",
    "timezone": "UTC",
    "invocation_target_type": "workflow",
    "invocation_target": {
      "revision_id": "rev-789",
      "session_id": "sess-abc",
      "workflow_alias": "one-shot-job",
      "input_data": ["payload"]
    }
  }
  ```

  ```json Response theme={null}
  {
    "schedule": {
      "id": "sched-002",
      "revision_id": "rev-scheduler-001",
      "created_at": "2026-04-07T12:05:00Z",
      "modified_at": "2026-04-07T12:05:00Z",
      "auth_target": "user",
      "auth_target_id": "user-001",
      "enabled": true,
      "repeat": "one_time",
      "cron_expression": null,
      "invocation_time": "2026-05-01T14:30:00",
      "timezone": "UTC",
      "start_date": null,
      "end_date": null,
      "state": "active",
      "invocation_target_type": "workflow",
      "invocation_target": {
        "org_id": "org-123",
        "blob_id": "blob-456",
        "revision_id": "rev-789",
        "session_id": "sess-abc",
        "workflow_alias": "one-shot-job",
        "input_data": ["payload"]
      }
    }
  }
  ```
</CodeGroup>
