On this page
Sommatic Docs
Open portal

Cron Schedule

Initiates workflow execution on a precise schedule using CRON syntax.

View as Markdown
Open in
Triggers Partial cron.trigger Version 1.0.0 Execution: async

Entry node of scheduled workflows. When the backend scheduler starts the run, the node outputs the incoming input merged with payload_template, plus timestamp, schedule and timezone.

This trigger is the entry point for time-based automation. It supports standard CRON expressions for defining recurring intervals (e.g., "Every Friday at 5 PM").

Features:

  • Standard Cron: Full support for "* * * * *" syntax.
  • Timezones: Schedule respects localized time zones.
  • Jitter: Optional random delay to prevent "thundering herd" issues.

Use Cases:

  • Generating daily reports.
  • Running nightly cleanup jobs.
  • Polling an API every 15 minutes.

How it works

  1. What starts it: the backend scheduler checks every 10 seconds the active workflows that have a published version and contain this node, and starts the published version when the estimated interval of cron_expr has passed since its last start (when no previous start is recorded, it starts at once). The run receives { $scheduled: true } plus the stored $trigger_state.
  2. The interval is estimated from the minute and hour fields: * → every minute, */N → every N minutes, a fixed minute with * hour → every hour, anything else → every day. Exact times, day-of-week and day-of-month fields are not matched.
  3. When the node runs, it resolves its config (cron_expr default 0 0 * * *, timezone default UTC, payload_template default {}) and takes the current time in timezone.
  4. Outputs { ...input, ...payload_template, timestamp, schedule, timezone } on out, with meta: { triggered_at, jitter_applied }.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-nightly",
  "label": "Every night",
  "operator_slug": "cron.trigger",
  "operator_version": "1.0.0",
  "config": {
    "cron_expr": "0 0 * * *",
    "timezone": "America/New_York",
    "payload_template": {
      "report": "daily-sales"
    }
  }
}

Configuration

cron_expr string Required

Standard cron (min hour day month day-of-week).

Default: 0 0 * * *

timezone string Optional

Default: UTC

payload_template object Optional

Optional JSON to inject into the workflow start context.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

cron_expr
Not validated by the node. The scheduler only derives an interval from it (see operation), so 0 9 * * 1-5 runs once a day, measured from the last start, not at 09:00 on weekdays.
timezone
Only formats timestamp and meta.triggered_at; it does not affect when the scheduler starts the run. An invalid zone name produces timestamp: null.
payload_template
Its keys override keys of the incoming input with the same name; timestamp, schedule and timezone always override the template.
jitter_ms Read by the code, not declared
Read but not declared, and not applied: no delay is added. Its value is only echoed in meta.jitter_applied.

Output ports

out default

Always. $scheduled and $trigger_state come from the scheduler's input; a manual run has only the input you provide.

Data
{
  "$scheduled": true,
  "$trigger_state": {
    "lastExecutedAt": "2026-11-25T05:00:02.311Z"
  },
  "report": "daily-sales",
  "timestamp": "2026-11-26T00:00:03.120-05:00",
  "schedule": "0 0 * * *",
  "timezone": "America/New_York"
}
error

Declared but never emitted by the code.

In expressions

What a later node can read from this node's output with $("Cron Schedule").item.json.<path> (write your node's label instead of Cron Schedule). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.

ExpressionEditorWorker
$("Cron Schedule").item.json.timestampstring= "2026-11-26T00:00:03.120-05:00"
$("Cron Schedule").item.json.schedule_timestringThe worker does not return it: reads as undefined —
$("Cron Schedule").item.json.$scheduledbooleanNot suggested by the editor= true—
$("Cron Schedule").item.json.$trigger_stateobjectNot suggested by the editor= {…}—
$("Cron Schedule").item.json.$trigger_state.lastExecutedAtstringNot suggested by the editor= "2026-11-25T05:00:02.311Z"—
$("Cron Schedule").item.json.reportstringNot suggested by the editor= "daily-sales"—
$("Cron Schedule").item.json.schedulestringNot suggested by the editor= "0 0 * * *"—
$("Cron Schedule").item.json.timezonestringNot suggested by the editor= "America/New_York"—

— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Output contract

timestamp string Optional
schedule_time string Optional

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "cron.trigger",
  "name": "Cron Schedule",
  "category": "triggers",
  "version": "1.0.0",
  "description": "Initiates workflow execution on a precise schedule using CRON syntax.\n\n  This trigger is the entry point for time-based automation. It supports standard CRON expressions for defining recurring intervals (e.g., \"Every Friday at 5 PM\").\n\n  **Features:**\n  - **Standard Cron:** Full support for \"* * * * *\" syntax.\n  - **Timezones:** Schedule respects localized time zones.\n  - **Jitter:** Optional random delay to prevent \"thundering herd\" issues.\n\n  **Use Cases:**\n  - Generating daily reports.\n  - Running nightly cleanup jobs.\n  - Polling an API every 15 minutes.",
  "capabilities": [
    "scheduling",
    "time-based",
    "cron"
  ],
  "config_schema": {
    "type": "object",
    "required": [
      "cron_expr"
    ],
    "properties": {
      "cron_expr": {
        "type": "string",
        "title": "CRON Expression",
        "default": "0 0 * * *",
        "description": "Standard cron (min hour day month day-of-week)."
      },
      "timezone": {
        "type": "string",
        "default": "UTC",
        "title": "Timezone",
        "ui_widget": "timezone_picker"
      },
      "payload_template": {
        "type": "object",
        "title": "Static Payload",
        "description": "Optional JSON to inject into the workflow start context."
      }
    }
  },
  "input_contract_schema": null,
  "output_contract_schema": {
    "type": "object",
    "description": "Schedule metadata.",
    "properties": {
      "timestamp": {
        "type": "string",
        "format": "date-time"
      },
      "schedule_time": {
        "type": "string",
        "format": "date-time"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Start",
      "is_default": true,
      "description": "Workflow Started."
    },
    {
      "port_id": "error",
      "label": "Error"
    }
  ],
  "execution_mode": "async",
  "tags": [
    "schedule",
    "time",
    "start",
    "trigger"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Capabilities
schedulingtime-basedcron
Tags
scheduletimestarttrigger

Notes and limits

  • Test vs production: only the published version is started by the scheduler; a draft never runs on its own. A manual run executes the node immediately, without $scheduled. With sample data the engine skips the node and passes the sample input on out.
  • The scheduler reads the trigger config from the workflow draft but runs the published version.
  • schedule_time, listed in the output contract, is never produced.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs