Cron Trigger
What it does
Starts a workflow automatically on a cron schedule. This trigger is scheduler-driven (no incoming HTTP request required).
Inputs / config
- No runtime inputs.
- Config fields:
cron_expression(required): 5-field cron (minute hour day month weekday).timezone(optional, defaultUTC): IANA timezone.enabled(optional, defaulttrue): enable/disable schedule without deleting node.
Outputs
| Field | Type | Description |
|---|---|---|
triggered_at | string (RFC3339) | UTC time when the scheduled run started |
trigger | string | Always cron |
schedule | string | Cron expression used for the run |
timezone | string | Timezone used to evaluate the cron expression |
run_id | string | Deterministic run identifier for the schedule slot |
slot | string (RFC3339) | The scheduled time this run is for (UTC). For Run now, the current time |
Multi-pod behavior
In multi-pod deployments, Zerq uses Redis distributed locks to guarantee at-most-once execution per schedule slot:
- Lock key format:
workflow_cron_lock:{ownerId}:{nodeId}:{slot}, where the owner id is the proxy id for a proxy's workflow and the workflow id for a standalone workflow - Only the pod that acquires the lock runs the workflow
- Contending pods skip the slot silently
- The lock is kept for 5 minutes after the run ends, so a pod that reaches the slot later does not run it again
- A slot reached more than 5 minutes after its scheduled time (for example by a stalled pod) is skipped, not run late
If Redis coordination is unavailable, scheduler startup fails closed to avoid duplicate execution risk.
Registration lifecycle
Cron trigger registrations are maintained in-memory with an event-driven model:
- On service startup, Zerq performs a one-time bootstrap load of all published, workflow-enabled proxies.
- After startup, registrations are updated immediately when proxies/workflows are created, updated, enabled/disabled, or deleted.
- There is no recurring 60-second full-database reconciliation loop.
Example
{
"id": "cron_1",
"type": "cron_trigger",
"data": {
"config": {
"cron_expression": "*/5 * * * *",
"timezone": "UTC",
"enabled": true
}
}
}