English
Called by a workflow
This workflow subscribes to no email: it runs when another one calls it. The input lands in data.input.
The Called by a workflow trigger turns a workflow into a reusable building block. It subscribes to nothing on its own: the workflow runs only when another workflow reaches a Call a workflow node that targets it. Write a routine once (an acknowledgement, a filing procedure), publish it, and call it from every workflow that needs it.
The called run receives two things:
data.input: everything the caller had in its working data when it made the call;- the caller's triggering email, when there is one. Nodes that act on the triggering email can therefore be used in a called workflow, as long as every caller has an email; if the caller started from a schedule or a webhook, the called run has no email either, and those nodes fail.
What the called workflow produces goes back to the caller when the call waits for completion: see Call a workflow.
At a glance
- Type:
trigger.called· version 1 - Category: Triggers
- Kind: Trigger — starts a run
- Effect: No external effect (
none) — nothing is written outside Mankomail; safe to replay - Needs a carrier email: No
- Connection: None
- Outputs:
main
Parameters
This node has no parameter.
Outputs
main— Taken by every run started by a Call a workflow node.
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.input }}—object. The working data of the calling run at the time of the call: its trigger data and the outputs of the steps already completed, under their own keys.{{ data.input.<step>.<field> }}—string. The output of a step of the caller, e.g.{{ data.input.extract.fields.amount }}. The caller's trigger data is there too:{{ data.input.webhook.… }},{{ data.input.schedule.plannedFor }}.{{ email.subject }}—string. The caller's triggering email, inherited as is (allemail.…fields). Empty when the caller has none.
Example
A workflow "Acknowledge receipt" starts with Called by a workflow, followed by a Send node that replies to {{ email.from.email }} with the reference extracted by the caller: Your request {{ data.input.extract.fields.reference }} has been received.
Three workflows (invoices, complaints, quotes) each end with a Call a workflow node whose workflowId points at "Acknowledge receipt". Each call creates one run of "Acknowledge receipt" on its main port, with the caller's data under data.input and the caller's email under email.
Tips
- The called workflow must be published and must contain an active Called by a workflow trigger; otherwise the call fails with a permanent error. Only the published version is ever called.
- Only the branches that start from this trigger run on a call. A workflow that also has an Email received trigger stays callable: on a call, its email branches do not run.
- A workflow has at most one Called by a workflow trigger.
- Only your own workflows can be called. Chains are limited to three levels below the first run (A calls B, which calls C, which calls D), and a cycle (A calls B, which calls A) is refused.
data.inputis a snapshot taken at the time of the call: later steps of the caller do not appear in it.- A called run inherits the mode of its caller: a test calls in a test run, so nothing is sent by the called workflow during a test.
- To test the called workflow on its own in the editor, type a JSON object: it lands under
data.input, as a real call would (see Test runs).