On this page
Sommatic Docs
Open portal

Wait / Delay

Pauses the execution flow for a specified duration or until a specific timestamp.

View as Markdown
Open in
Flow control Partial flow.wait Version 1.0.0 Execution: async

Experimental. In duration mode it really sleeps, capped at 10 seconds, then continues; in timestamp mode it only computes the resume time and continues at once. The workflow is never suspended.

This operator is used to introduce delays or schedule execution for a future time. It relies on the orchestration engine to suspend the workflow and resume it at the calculated wake-up time.

Modes:

  • Duration: Waits for a relative amount of time (e.g., "5 minutes").
  • Timestamp: Waits until a specific absolute date/time (e.g., "2025-12-31T23:59:59Z").

Use Cases:

  • Sending a follow-up email 24 hours after sign-up.
  • Waiting for a connection retry backoff.
  • Pausing a workflow until a specific business date.

How it works

  1. Resolves the config; type defaults to duration. When duration_seconds is absent the code uses 0, not the schema default 60.
  2. duration: sets resume_at to now plus duration_seconds and sleeps min(duration, 10 s) inside the worker.
  3. timestamp: if the original timestamp_expr contains {{, uses the resolved value; otherwise evaluates it as JSONata against the payload (due_at). Parses it with new Date() and computes delay_ms. It does not sleep.
  4. Returns the payload unchanged through out with meta { action: "suspend", resume_at, delay_ms }. The engine ignores meta.action and runs the next node right away.

In a workflow

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

{
  "node_id": "node-wait-due",
  "label": "Wait until due",
  "operator_slug": "flow.wait",
  "operator_version": "1.0.0",
  "config": {
    "type": "timestamp",
    "timestamp_expr": "{{ $json.due_at }}"
  }
}

Configuration

type string Optional

Default: duration

Allowed values: durationtimestamp

duration_seconds integer Optional

Number of seconds to wait (used when Type is "duration").

Default: 60

timestamp_expr string Optional Accepts expressions

ISO-8601 Timestamp or expression evaluating to one (used when Type is "timestamp").

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

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

timestamp_expr
Use {{ $json.due_at }}, a JSONata path such as due_at, or a quoted literal "2026-12-01T09:00:00Z". Without timestamp_expr, timestamp mode returns resume_at: null and delay_ms: 0.

Output ports

out default

After the capped sleep (duration) or at once (timestamp).

Data
{
  "ticket_id": "tk_9",
  "due_at": "2026-12-01T09:00:00Z"
}
error

Only when the worker throws unexpectedly; an invalid timestamp leaves through out (see errors).

Data
{
  "error": "<message>"
}

In expressions

What a later node can read from this node's output with $("Wait / Delay").item.json.<path> (write your node's label instead of Wait / Delay). 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
$("Wait / Delay").item.json.payloadobjectThe worker does not return it: reads as undefined —
$("Wait / Delay").item.json.ticket_idstringNot suggested by the editor= "tk_9"—
$("Wait / Delay").item.json.due_atstringNot suggested by the editor= "2026-12-01T09:00:00Z"—

— 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).

Errors

Message Port Cause and fix
Wait timestamp error: <message> out timestamp_expr is not a valid date, or is a raw ISO string without {{ }} or quotes (JSONata cannot parse 2026-12-01T09:00:00Z). The envelope has no port, so the engine routes it to out and the next node receives { ok: false, errors: [...] } as its payload.

Input contract

payload object Optional

Output contract

payload object 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": "flow.wait",
  "name": "Wait / Delay",
  "category": "flow",
  "version": "1.0.0",
  "description": "Pauses the execution flow for a specified duration or until a specific timestamp.\n\n  This operator is used to introduce delays or schedule execution for a future time. It relies on the orchestration engine to suspend the workflow and resume it at the calculated wake-up time.\n\n  **Modes:**\n  - **Duration:** Waits for a relative amount of time (e.g., \"5 minutes\").\n  - **Timestamp:** Waits until a specific absolute date/time (e.g., \"2025-12-31T23:59:59Z\").\n\n  **Use Cases:**\n  - Sending a follow-up email 24 hours after sign-up.\n  - Waiting for a connection retry backoff.\n  - Pausing a workflow until a specific business date.",
  "capabilities": [
    "delay",
    "schedule",
    "time",
    "suspend"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "enum": [
          "duration",
          "timestamp"
        ],
        "default": "duration",
        "title": "Wait Type"
      },
      "duration_seconds": {
        "type": "integer",
        "title": "Duration (Seconds)",
        "default": 60,
        "description": "Number of seconds to wait (used when Type is \"duration\")."
      },
      "timestamp_expr": {
        "type": "string",
        "title": "Until (Timestamp)",
        "format": "expression",
        "description": "ISO-8601 Timestamp or expression evaluating to one (used when Type is \"timestamp\")."
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    }
  },
  "input_contract_schema": {
    "type": "object",
    "description": "Payload passed into the wait state.",
    "properties": {
      "payload": {
        "type": "object"
      }
    }
  },
  "output_contract_schema": {
    "type": "object",
    "description": "Payload passed out after resumption (usually unchanged).",
    "properties": {
      "payload": {
        "type": "object"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Resume",
      "is_default": true,
      "description": "Execution resumes here after the delay."
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Activated if the timestamp is invalid."
    }
  ],
  "execution_mode": "async",
  "tags": [
    "time",
    "sleep",
    "control-flow",
    "schedule"
  ],
  "is_stateful": true,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
Yes
Retries (retryOnFail)
No
Capabilities
delayscheduletimesuspend
Tags
timesleepcontrol-flowschedule

Notes and limits

  • There is no durable timer: a wait longer than 10 seconds is cut to 10 seconds, and the node holds the run while it sleeps.
  • meta is recorded in the run steps only: downstream nodes receive data as their payload and cannot read meta through $json or $("Node").

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