Skip to content

Scheduled workflow recipes

These recipes reuse the checked-in fixtures under scheduler/examples/. Start with the scheduling guide for semantics and the Scheduler API for the exact REST contract.

Every minute

{
  "name": "every-minute-demo-schedule",
  "cronExpression": "0 * * * * *",
  "zoneId": "UTC",
  "startWorkflowRequest": {
    "name": "daily_report_workflow",
    "version": 1,
    "input": {}
  },
  "runCatchupScheduleInstances": false,
  "paused": false
}
conductor schedule create scheduler/examples/every-minute-schedule.json

Weekdays in a named timezone

{
  "name": "daily-report-schedule",
  "cronExpression": "0 0 9 * * MON-FRI",
  "zoneId": "America/New_York",
  "startWorkflowRequest": {
    "name": "daily_report_workflow",
    "version": 1,
    "input": {}
  },
  "scheduleStartTime": 0,
  "scheduleEndTime": 0,
  "runCatchupScheduleInstances": false,
  "paused": false
}

The IANA zone follows local daylight-saving transitions. The correlation ID, if supplied, is literal; use the injected _executionId inside the workflow for per-run identity.

Catch up missed cron slots

{
  "name": "catchup-demo-schedule",
  "cronExpression": "0 * * * * *",
  "zoneId": "UTC",
  "runCatchupScheduleInstances": true,
  "paused": false,
  "startWorkflowRequest": {
    "name": "catchup_demo_workflow",
    "version": 1,
    "input": {}
  }
}

Catchup can create a burst after downtime. Make the target workflow idempotent and capacity-aware.

Bound a schedule to a window

scheduler/examples/bounded-schedule-template.json contains __START_MS__ and __END_MS__ placeholders. Replace them with epoch-millisecond numbers before posting the file; the template itself is intentionally not valid as a final schedule payload.

curl -sS -X POST '<YOUR-CLUSTER-URL>/api/scheduler/schedules' \
  -H 'Content-Type: application/json' \
  --data-binary @bounded-schedule.json

Read scheduler metadata in a workflow

The canonical workflow uses _scheduledTime and _executedTime to compute a reporting window:

{
  "name": "input_param_demo_workflow",
  "description": "Demonstrates scheduler-injected workflow input. Uses _scheduledTime and _executedTime to compute a 24-hour reporting window ending at the scheduled time.",
  "version": 1,
  "tasks": [
    {
      "name": "compute_report_window",
      "taskReferenceName": "compute_report_window",
      "type": "INLINE",
      "inputParameters": {
        "scheduledTime": "${workflow.input._scheduledTime}",
        "executionTime": "${workflow.input._executedTime}",
        "evaluatorType": "javascript",
        "expression": "function toISO(ms) { return new Date(ms).toISOString(); } ({ reportWindowStart: toISO($.scheduledTime - 86400000), reportWindowEnd: toISO($.scheduledTime), scheduledAt: toISO($.scheduledTime), triggeredAt: toISO($.executionTime) })"
      }
    }
  ],
  "outputParameters": {
    "reportWindowStart": "${compute_report_window.output.result.reportWindowStart}",
    "reportWindowEnd": "${compute_report_window.output.result.reportWindowEnd}",
    "scheduledAt": "${compute_report_window.output.result.scheduledAt}",
    "triggeredAt": "${compute_report_window.output.result.triggeredAt}"
  },
  "schemaVersion": 2,
  "restartable": true,
  "ownerEmail": "demo@example.com",
  "timeoutPolicy": "ALERT_ONLY",
  "timeoutSeconds": 30
}

Its paired schedule is:

{
  "name": "input-param-demo-schedule",
  "cronExpression": "0 * * * * *",
  "zoneId": "UTC",
  "runCatchupScheduleInstances": false,
  "startWorkflowRequest": {
    "name": "input_param_demo_workflow",
    "version": 1,
    "input": {
      "reportOwner": "platform-team",
      "alertThreshold": 100
    }
  }
}

The other injected values are _startedByScheduler, _executionId, and _schedulerCron.

Demonstrate overlapping runs

{
  "name": "concurrent-demo-schedule",
  "cronExpression": "0 * * * * *",
  "zoneId": "UTC",
  "runCatchupScheduleInstances": false,
  "startWorkflowRequest": {
    "name": "concurrent_demo_workflow",
    "version": 1,
    "input": {}
  }
}

Conductor has no native overlap policy. The paired concurrent-workflow.json demonstrates that the next slot can start while the prior execution remains active.

More canonical fixtures

The fixture family also includes retry, DO_WHILE, and parallel multi-step workflows. Register workflow files with the metadata API or CLI before creating their paired schedule. See scheduler/examples/README.md for the complete local walkthrough.