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

# Scheduling

> Cron-based recurring workflow execution

Workflows can run on a schedule using cron expressions defined in `schedules.json`. The platform registers schedules during deployment and triggers workflow submissions automatically.

## Configuration

Define schedules in `schedules.json` at the root of your app:

```json theme={null}
{
  "schedules": [
    {
      "name": "daily-order-sync",
      "cron": "0 3 * * *",
      "timezone": "UTC",
      "skipIfRunning": true,
      "workflow": "./src/server/workflows/syncOrders.ts",
      "params": {
        "orgId": "org_abc123",
        "appId": "my-app"
      }
    }
  ]
}
```

| Field           | Description                                                           |
| --------------- | --------------------------------------------------------------------- |
| `name`          | Unique schedule identifier                                            |
| `cron`          | Cron expression for the schedule                                      |
| `timezone`      | Timezone for the cron expression (default: `"UTC"`)                   |
| `skipIfRunning` | If `true`, skip the scheduled run when a previous run is still active |
| `workflow`      | Path to the workflow file                                             |
| `params`        | Variable values passed to the workflow                                |

## Common cron expressions

| Expression     | Schedule                       |
| -------------- | ------------------------------ |
| `0 * * * *`    | Every hour                     |
| `0 */6 * * *`  | Every 6 hours                  |
| `0 3 * * *`    | Daily at 3:00 AM               |
| `0 0 * * 1`    | Weekly on Monday at midnight   |
| `0 0 1 * *`    | Monthly on the 1st at midnight |
| `*/15 * * * *` | Every 15 minutes               |

## Preventing overlapping runs

Set `skipIfRunning: true` to avoid starting a new run when the previous one hasn't finished. This is recommended for long-running workflows where concurrent execution could cause data conflicts or duplicate processing.

## Build-time validation

The app framework's build pipeline validates `schedules.json` during the build phase:

* Cron expressions are syntactically valid
* Workflow file paths resolve to exported workflow definitions
* Parameter values match the workflow's variable definitions
* Schedule names are unique

## Manual triggers

Scheduled workflows can also be triggered manually through the app's API or UI. The same workflow definition is used — only the submission source differs (scheduled vs. manual).
