Skip to main content

Errors within Action Flows

Errors in an Action Flow fall into two types:

  • Input errors happen before the Action Flow starts, when the request or event that triggers it can't be processed, such as malformed JSON, a failed authentication, or otherwise invalid input. These prevent the Action Flow from starting.
  • Step errors happen once the Action Flow is running when a step fails as it's evaluated. In certain situations, steps within an Action Flow may cause an error, which stops the Action Flow and marks it as failed.

When the Action Flow is marked as a failure, analytic events are emitted which can be used as part of a webhook subscription to notify external systems of the failure.

Handling errors

Preview feature

Error handling within Action Flows is in preview and may be subject to change. Please contact us to have this feature enabled in your organization or to provide feedback.

Before the Action Flow is marked as failed, you can set up an error handler branch that is executed after a step fails. This allows you to perform actions based on the error that caused the failure, such as:

An Action Flow with a main step for sending an SMS, and an error step alerting Slack
An example error handler that sends a Slack message if a Send SMS step fails
An error handler containing multiple steps within the error handler branch
An more complex error handler that uses Branch Flow steps to perform different actions depending on the type of error

Adding an error handler

To add an error handler, open your Action Flow in the editor and:

  1. Select Add error handler next to the Action Flow starts step. An Action Flow fails branch is added alongside the main flow.
  2. Select the + on the Action Flow fails step to add a step.
  3. Add and configure as many steps as you need. Details of the error that caused the failure, and the step that failed, are available to these steps as error output variables, shown under Error outputs in the context picker.

The error handler runs as a separate branch after a step in the main flow fails, and before the Action Flow is marked as failed.

Limitations

The error handler doesn't support all step types, such as Wait steps, meaning you can't have any steps after a Send a Card step within the error handler.

If a step within the error handler also fails, the error handler is not re-run and the Action Flow is stopped and marked as a failure.

Triggering an error

Preview feature

Triggering errors using a Stop Action Flow step is in preview and may be subject to change. Please contact us to have this feature enabled in your organization or to provide feedback.

To manually trigger an error and force the Action Flow invocation into a failure state, you can use the Stop the Action Flow step by setting its Outcome to Error.

You might want to force a failure when an upstream service returns an unexpected response, a required piece of data is missing, or a validation check fails, so that the Action Flow runs its error handler and is reported as failed in analytics rather than silently completing.

When this step is executed, the step will produce a failure with a FLOW_STOPPED_WITH_ERROR error code. Within the step, you can optionally provide an error message that will appear within the error handler and the relevant analytic events.

An Action Flow using a Stop Action Flow step with a Branch Flow step
An example of using a Stop Action Flow step to force the Action Flow into a failure state based on the results of a Send Request step

Reference

Error analytic events

Event nameDescription
action-flow-step-failedEmitted when a step within the Action Flow has failed. This event contains information about the error causing the failure
action-flow-error-handler-triggeredEmitted if an error handler is set up and has been triggered by a failing step within the Action Flow
action-flow-failedEmitted once the Action Flow has stopped after any error handler steps

Error codes

Input error codes

These errors happen before the Action Flow starts running, so they can't be caught by an error handler. Instead, they're returned in the response to the request that triggered the Action Flow.

Error codeDescription
ACCESS_DENIED_TO_ENVIRONMENTThe caller is authenticated but isn't permitted to trigger Action Flows in the target environment
ACTION_FLOW_EVALUATION_FAILEDThe request could not be processed, such as a reused invocation ID
ARCHIVED_FLOWThe Action Flow being triggered has been archived and can no longer run
BAD_INPUTThe request contained invalid or missing input, such as a malformed body or reused invocation ID
CONNECTOR_NOT_FOUNDNo connector matched the request, such as an incorrect connector secret or a removed connector
CONNECTOR_NOT_FOUND_WITH_FLOW_CONFIG_IDNo connector was found for the specified Action Flow
CONNECTOR_PAUSEDThe connector is paused, so only test requests are accepted
EVENT_SOURCE_NOT_FOUNDThe event source named in the request could not be found
INTERNAL_ERRORAn unexpected error occurred while processing the request. Contact Atomic Support if this happens
INVALID_AUTH_CONFIG_FOR_CONNECTORThe request could not be authenticated against the connector's configuration
INVALID_BODYThe request body could not be read, such as an invalid JWT token or secret
INVALID_CONNECTOR_AUTHThe request's authentication was missing or invalid, such as a missing or incorrect signature
INVALID_CONNECTOR_SECRETThe connector secret in the request is missing or invalid
INVALID_INTEGRATION_AUTHThe integration's authentication configuration is missing or invalid
INVALID_LIVE_MODEThe request's mode doesn't match the Action Flow, such as a live request to a draft Action Flow
IP_ADDRESS_NOT_WHITELISTEDThe request came from an IP address that isn't on the connector's allow list
JSON_PARSE_ERRORThe request body is not valid JSON
PAYLOAD_MAPPING_FAILEDThe request payload could not be mapped to the Action Flow's expected input
VARIABLE_VALIDATION_FAILEDOne or more Action Flow variables failed validation against the request

Step error codes

These are the error codes that can be caught by an error handler. Each is produced by a step failing while the Action Flow is running.

Error codeDescription
ACTION_FLOW_EVALUATION_FAILEDAn error occurred while evaluating a User experiment step. Contact Atomic Support if this happens
BAD_CONFIGURATIONA step was misconfigured, such as an invalid variable mapping or malformed step properties
BAD_INPUTA step received invalid input, such as an out-of-range or unparseable duration or time
FLOW_STOPPED_WITH_ERRORThe Action Flow was stopped using the Stop the Action Flow step with an Outcome set to Error
HTTP_REQ_FAILEDA HTTP request failed and did not receive a response code, such as a DNS resolution or certificate issue
HTTP_REQ_FAILED_4xxA HTTP request responded with a 4XX response code
HTTP_REQ_FAILED_5xxA HTTP request responded with a 5XX response code
HTTP_REQ_FAILED_OTHERA HTTP request failed with an unknown response code, such as a timeout
INTERNAL_ERRORAn unexpected error occurred while evaluating a step, or a failing step reported no more specific code. Contact Atomic Support if this happens
SCRIPT_EVALUATION_FAILEDAn error was triggered within the script being run as part of a Run a script step