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 |
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:{proxyId}:{nodeId}:{slot} - Only the pod that acquires the lock runs the workflow
- Contending pods skip the slot silently
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
}
}
}