English
Workflow failure
Starts when an execution of a workflow that names this one as its error workflow fails. The report lands in data.failure.
The Workflow failure trigger starts the error workflow: the workflow that reacts when another workflow fails. A workflow is designated as the error workflow of one or more other workflows in their settings. When a live run of one of them ends in a final failure, a run of the workflow that holds this trigger starts, with a report of the failure under data.failure.
If the failed run had a triggering email, the error workflow inherits it: {{ email.… }} works, and nodes that act on the triggering email (reply in the thread, Move, Flag) can be used. Use it to alert someone, to open an incident in a table or to answer the sender who got no result. For the failures themselves and how to replay them, see Errors and replay.
At a glance
- Type:
trigger.error· 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 of the error workflow that is started because another workflow's run failed.
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.failure }}—object. The report of the failed run: which workflow, which run, which step, which error and when.{{ data.failure.workflowName }}—string. The name of the workflow whose run failed. Its identifier is{{ data.failure.workflowId }}.{{ data.failure.executionId }}—string. The identifier of the failed run.{{ data.failure.workflowVersionId }}is the version of the workflow that was running.{{ data.failure.failedAt }}—string. When the run failed, as an ISO 8601 date and time.{{ data.failure.error.code }}—string. The error code of the failure (see the error codes reference).step_failedwhen the failed run carried no code.{{ data.failure.error.message }}—string. The error message. Empty when the failed run carried none.{{ data.failure.nodeName }}—string. The name of the node that failed. Absent when the failure is not attached to a node.{{ data.failure.nodeId }}and{{ data.failure.nodeType }}give its identifier and type, when known.{{ data.failure.mailboxId }}—string. The mailbox of the triggering email of the failed run, when it had one ({{ data.failure.messageId }}is the message). Absent otherwise.{{ email.subject }}—string. The triggering email of the failed run, inherited as is (allemail.…fields). Empty when the failed run had none.
Example
A workflow "Alert on failure" starts with Workflow failure, followed by a Send node that writes to your own address:
Subject: {{ data.failure.workflowName }} failed
Body: Step "{{ data.failure.nodeName }}" failed with {{ data.failure.error.code }}:
{{ data.failure.error.message }}Publish it, then select it as the error workflow in the settings of the workflows you want to monitor. Each time a live run of one of them fails for good, one run of "Alert on failure" starts on its main port.
Tips
- Published workflow required. The error workflow must be published, belong to the same member as the failed workflow, and contain a Workflow failure trigger. Otherwise nothing starts.
- Live runs only. A failed test run never starts the error workflow: it shows on the canvas (see Test runs).
- One alert per failure. A failure starts the error workflow once, even if the conclusion of the run is processed again.
- No chain. A run of an error workflow that fails does not start another error workflow, and a workflow cannot be its own error workflow.
- Loops. A failure inside one iteration of a loop is reported by the loop itself, not by each iteration.
- Nothing to listen to. This trigger arms nothing: the workflow runs only when a failure is reported to it.
- A report holds identifiers, codes and messages, never the content of the email: read that with
{{ email.… }}.