Error Handling

When creating flow logic, it's important to anticipate errors and plan how to address them. By utilizing an error workflow, you can manage how Appizap Workflow handles failures in workflow execution.

Investigating errors

Examine your executions, whether for a specific workflow or all workflows within your purview. It is possible to import data from a previous execution into your current workflow. Then, enable Log streaming.

Create and set an error workflow

In Workflow Settings, there is an option to designate an error workflow for each specific workflow. This error workflow will be triggered in the event of a failed execution, allowing for actions such as sending email or Slack notifications to be taken. It is important to note that the error workflow must always commence with the Error Trigger.

You can use the same error workflow for multiple workflows.

  1. Create a new workflow, with the Error Trigger as the first node.

  2. Give the workflow a name, for example Error Handler.

  3. Select Save.

  4. In the workflow where you want to use this error workflow:

    1. Select Options > Settings.

    2. In Error workflow, select the workflow you just created. For example, if you used the name Error Handler, select Error handler.

    3. Select Save. Now, when this workflow errors, the related error workflow runs.

Error data

The default error data received by the Error Trigger is:

[
	{
		"execution": {
			"id": "231",
			"url": "https://test.example.com/execution/231",
			"retryOf": "34",
			"error": {
				"message": "Example Error Message",
				"stack": "Stacktrace"
			},
			"lastNodeExecuted": "Node With Error",
			"mode": "manual"
		},
		"workflow": {
			"id": "1",
			"name": "Example Workflow"
		}
	}
]

All information is always present, except:

  • execution.id: The execution needs to be saved in the database. If there is an error in the trigger node of the main workflow, it will not be executed..

  • execution.url: The execution must be saved in the database. This does not happen if the error is in the trigger node of the main workflow, as the workflow does not run.

  • execution.retryOf: Only present when the execution is a retry of a failed execution.

If the trigger node of the primary workflow is the source of the error rather than a subsequent stage, then the information forwarded to the error workflow will vary. There is less information in execution{} and more in trigger{}

{
  "trigger": {
    "error": {
      "context": {},
      "name": "WorkflowActivationError",
      "cause": {
        "message": "",
        "stack": ""
      },
      "timestamp": 1654609328787,
      "message": "",
      "node": {
        . . . 
      }
    },
    "mode": "trigger"
  },
  "workflow": {
    "id": "",
    "name": ""
  }
}

Cause a workflow execution failure using Stop And Error

When an execution fails, Appizap Workflow Builder runs the error workflow you create and set. Failures are typically caused by node setting errors or running out of memory during the workflow. The Stop And Error node can be added to make executions fail and trigger the error workflow.

Last updated