On this page
Sommatic Docs
Open portal

Workflow Chain Receiver

Receives execution requests from another workflow's Chain node.

View as Markdown
Open in
Triggers Available workflow.trigger Version 1.0.0 Execution: sync

Entry node for sub-workflows called by workflow.chain. It optionally restricts which workflows may call it, then outputs the data sent by the caller together with chain_context.

This trigger acts as the entry point for a workflow that is invoked by another workflow via the workflow.chain node. It enables peer-to-peer workflow chaining without creating a parent-child hierarchy.

Features:

  • Caller Filtering: Optionally restrict which workflows can chain into this one.
  • Payload Passthrough: The calling workflow's payload is available as $json in downstream nodes.
  • Traceability: Chain context (caller instance, node, correlation ID) is preserved for audit.

Use Cases:

  • Modular workflow composition (e.g., shared validation workflow invoked by multiple callers).
  • Event-driven chaining where Workflow A completes a phase and delegates to Workflow B.
  • Reusable sub-processes that remain independently testable and deployable.

How it works

  1. What starts it: a workflow.chain node in another workflow. The backend runs the draft when the caller is itself a draft run (test) and the default published version when the caller runs a published version (prod); prod fails when this workflow has no published version. The run's input is { data, chain_context }.
  2. Resolves the node config. When accepted_caller_ids is not empty and chain_context.caller_flow_definition_id is not in it, returns error.
  3. Otherwise spreads data at the root, adds chain_context and returns meta with the caller's definition id, slug, instance id and the chain's correlation id.

In a workflow

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

{
  "node_id": "node-from-parent",
  "label": "Called by order intake",
  "operator_slug": "workflow.trigger",
  "operator_version": "1.0.0",
  "config": {
    "accepted_caller_ids": [
      "<flow_definition_id>"
    ]
  }
}

Configuration

accepted_caller_ids array<string> Optional

Select which workflows are allowed to invoke this one. Leave empty to accept calls from any workflow.

Default: []

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.

accepted_caller_ids
Matched against chain_context.caller_flow_definition_id (workflow definition ids, not slugs). Empty accepts every caller.

Output ports

out default

The caller is accepted.

Data
{
  "order_id": "ord_123",
  "customer_email": "[email protected]",
  "chain_context": {
    "caller_flow_definition_id": "<flow_definition_id>",
    "caller_flow_instance_id": "<flow_instance_id>",
    "caller_flow_slug": "order-intake",
    "caller_node_id": "node-call-billing",
    "correlation_id": "chain-8f2k1m9x0q4w7e3r5t6y",
    "root_flow_instance_result_id": "<flow_instance_result_id>"
  }
}
error

The caller is not in accepted_caller_ids. The output is the envelope { ok, errors, port, meta: { rejected_caller_id, rejected_caller_slug } }.

Data
{
  "ok": false,
  "errors": [
    "Caller workflow 'order-intake' is not in the accepted callers list"
  ],
  "port": "error",
  "meta": {
    "rejected_caller_id": "<flow_definition_id>",
    "rejected_caller_slug": "order-intake"
  }
}

In expressions

What a later node can read from this node's output with $("Workflow Chain Receiver").item.json.<path> (write your node's label instead of Workflow Chain Receiver). 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
$("Workflow Chain Receiver").item.json.dataobjectThe worker does not return it: reads as undefinedThe chain input data. —
$("Workflow Chain Receiver").item.json.chain_contextobject= {…}Traceability metadata from the caller.
$("Workflow Chain Receiver").item.json.chain_context.caller_flow_definition_idstring= "<flow_definition_id>"
$("Workflow Chain Receiver").item.json.chain_context.caller_flow_instance_idstring= "<flow_instance_id>"
$("Workflow Chain Receiver").item.json.chain_context.caller_flow_slugstring= "order-intake"
$("Workflow Chain Receiver").item.json.chain_context.caller_node_idstring= "node-call-billing"
$("Workflow Chain Receiver").item.json.chain_context.correlation_idstring= "chain-8f2k1m9x0q4w7e3r5t6y"
$("Workflow Chain Receiver").item.json.order_idstringNot suggested by the editor= "ord_123"—
$("Workflow Chain Receiver").item.json.customer_emailstringNot suggested by the editor= "[email protected]"—
$("Workflow Chain Receiver").item.json.chain_context.root_flow_instance_result_idstringNot suggested by the editor= "<flow_instance_result_id>"—

— 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
Caller workflow '<caller_flow_slug or caller_flow_definition_id>' is not in the accepted callers list error Add the caller's workflow definition id to accepted_caller_ids, or leave the list empty to accept any caller. A run started without chain_context (for example by hand) is also rejected when the list is not empty.

Output contract

data object Optional

The chain input data.

chain_context object Optional

Traceability metadata from the caller.

caller_flow_definition_id string Optional
caller_flow_instance_id string Optional
caller_flow_slug string Optional
caller_node_id string Optional
correlation_id 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": "workflow.trigger",
  "name": "Workflow Chain Receiver",
  "category": "triggers",
  "version": "1.0.0",
  "description": "Receives execution requests from another workflow's Chain node.\n\n  This trigger acts as the entry point for a workflow that is invoked by another workflow via the `workflow.chain` node. It enables peer-to-peer workflow chaining without creating a parent-child hierarchy.\n\n  **Features:**\n  - **Caller Filtering:** Optionally restrict which workflows can chain into this one.\n  - **Payload Passthrough:** The calling workflow's payload is available as `$json` in downstream nodes.\n  - **Traceability:** Chain context (caller instance, node, correlation ID) is preserved for audit.\n\n  **Use Cases:**\n  - Modular workflow composition (e.g., shared validation workflow invoked by multiple callers).\n  - Event-driven chaining where Workflow A completes a phase and delegates to Workflow B.\n  - Reusable sub-processes that remain independently testable and deployable.",
  "capabilities": [
    "workflow",
    "chain",
    "composition",
    "trigger"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "accepted_caller_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "title": "Accepted Callers",
        "description": "Select which workflows are allowed to invoke this one. Leave empty to accept calls from any workflow.",
        "default": [],
        "x-ui-widget": "flow-definition-multi-picker"
      },
      "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": null,
  "output_contract_schema": {
    "type": "object",
    "description": "The payload sent by the calling workflow.",
    "properties": {
      "data": {
        "type": "object",
        "description": "The chain input data."
      },
      "chain_context": {
        "type": "object",
        "description": "Traceability metadata from the caller.",
        "properties": {
          "caller_flow_definition_id": {
            "type": "string"
          },
          "caller_flow_instance_id": {
            "type": "string"
          },
          "caller_flow_slug": {
            "type": "string"
          },
          "caller_node_id": {
            "type": "string"
          },
          "correlation_id": {
            "type": "string"
          }
        }
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Received",
      "is_default": true,
      "description": "Chain payload received and validated."
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Caller not authorized or validation failed."
    }
  ],
  "execution_mode": "sync",
  "tags": [
    "workflow",
    "chain",
    "trigger",
    "composition"
  ],
  "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
sync
Stateful
No
Retries (retryOnFail)
No
Capabilities
workflowchaincompositiontrigger
Tags
workflowchaintriggercomposition

Notes and limits

  • The caller's data keys are spread at the root, so read them downstream as $json.<field>; a data.chain_context key would be replaced by the real chain_context.
  • chain_context.root_flow_instance_result_id stays the same through every hop of a chain, so any sub-workflow can report the id of the top-level run.
  • With sample data the engine skips the node and passes the sample input on out unchanged (without spreading data).

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