Skip to content

Call a workflow ​

Runs another published workflow with this execution’s data. In "wait" mode, its output becomes this node’s output.

The Call a workflow node runs another published workflow. It lets you write a routine once, for instance an acknowledgement or a contact lookup, and reuse it from several workflows instead of duplicating it. The called workflow is referenced by its identifier: renaming it or its nodes breaks nothing on the calling side.

The called workflow must be published and start with the trigger Called by a workflow. It receives the whole working data of the caller under {{ data.input }}, for instance {{ data.input.<caller step>.amount }}, and it keeps the caller's triggering email, so {{ email.subject }} works there too. It runs for the same member and in the same mode: a test calls a test.

Two modes are available:

  • Wait for completion (wait): the calling run suspends until the called one finishes, then continues on main. What the called workflow produced becomes {{ data.<step>.output }}.
  • Fire and forget (fireAndForget): the called workflow starts on its own and the caller continues immediately. Its outcome is visible only in its own runs.

At a glance ​

  • Type: workflow.call · version 1
  • Category: Logic
  • Kind: Step — one stage of a run
  • Effect: No external effect (none) — nothing is written outside Mankomail; safe to replay
  • Needs a carrier email: No
  • Connection: None
  • Inputs: main
  • Outputs: main

Parameters ​

workflowId ​

Workflow to call — The target workflow, picked from the list. It must be published and its trigger must be "Called by another workflow".

  • Type: Text (string)
  • Required: Yes
  • Default: "" (empty)
  • 128 characters at most
  • Expressions: {{ }} not accepted

mode ​

Mode

  • Type: One choice (options)
  • Required: Yes
  • Default: wait
  • Options:
    • wait — Wait for completion: The execution suspends, and the sub-workflow output becomes this node’s output.
    • fireAndForget — Fire and forget: The sub-workflow runs on its own; the rest continues immediately.

waitMinutes ​

Maximum wait (minutes) — After this delay the branch resumes with status: "timeout". A run never waits forever.

  • Type: Number (number)
  • Required: No
  • Default: 60
  • Whole number, from 1 to 4320
  • Shown when: mode is wait

Outputs ​

  • main — "Wait for completion": taken when the called workflow has finished successfully, or when the maximum wait has elapsed (status timeout). "Fire and forget": taken immediately after the call.

Data produced ​

What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).

  • {{ data.<step>.executionId }} — string. The identifier of the run started for the called workflow.
  • {{ data.<step>.workflowId }} — string. The identifier of the called workflow.
  • {{ data.<step>.mode }} — string. wait or fireAndForget. Absent after a wait that ended.
  • {{ data.<step>.status }} — string. "Wait for completion": succeeded once the called workflow has finished, timeout when the maximum wait elapsed first, settled (without output) in the rare case it had already finished when the call returned. "Fire and forget": started.
  • {{ data.<step>.output }} — object. "Wait for completion" only: everything the called workflow produced, under the names of its own nodes — e.g. {{ data.<step>.output.<called step>.message }}.
  • {{ data.<step>.simulated }} — boolean. true when the call ran as a test run (the called workflow then runs as a test run too).

Example ​

A "Look up the client" workflow, started by Called by a workflow, searches a table for {{ data.input.extract.email }} and composes a summary in a node named Summary. In each workflow that needs it, add:

workflowId:  <Look up the client>
mode:        wait
waitMinutes: 10

After the call, {{ data.<step>.output.summary.message }} holds the summary, and {{ data.<step>.status }} is succeeded.

Tips ​

  • Failures propagate. When the called workflow fails or is cancelled, the calling step fails with subworkflow_failed, and the calling node's error policy applies.
  • Maximum wait. In wait mode, after "Maximum wait (minutes)" (60 by default, between 1 and 4,320, that is 3 days) the caller stops waiting and continues on main with status timeout. The called workflow is not interrupted. Test status with a Condition when a late answer matters.
  • Limits. A chain of calls is limited to three levels below the first run, and a workflow cannot call itself directly or indirectly: a cycle visible in the graphs is refused at publication, and one that appears later (after a republication) fails at run time.
  • Refusals at run time. The step fails when the target is unknown or belongs to another member, archived, unpublished, or has no active Called by a workflow trigger.
  • A retried step never starts the called workflow twice.
  • If the called workflow also has other triggers, a call runs only the part of its graph connected to Called by a workflow.