Skip to main content

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, default UTC): IANA timezone.
    • enabled (optional, default true): enable/disable schedule without deleting node.

Outputs

FieldTypeDescription
triggered_atstring (RFC3339)UTC time when the scheduled run started
triggerstringAlways cron
schedulestringCron expression used for the run
timezonestringTimezone used to evaluate the cron expression
run_idstringDeterministic 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
}
}
}