Skip to content

Throw Error Activity

The Throw Error activity enables users to intentionally raise an exception within an automation workflow. This activity is crucial for managing unexpected conditions or enforcing specific business rules by halting execution and signaling an error state. It allows for custom error messages to provide clear context for debugging and error handling.

Field Description Requirement
Asynchronous Indicates whether the activity operates synchronously or asynchronously. Optional
Error message The custom error message to be displayed when the error is thrown. Required

Action Types & Examples

Error Message Output

  • Format: string
  • Example Result: "Validation Error: Input data is missing required fields."

Implementation Examples

Field Setup - Error message: "Failed to process transaction: Insufficient funds." - Asynchronous: true

Execution Parameters - activity.throwError("Invalid user credentials provided.") - activity.throwError("File not found.", { asynchronous: false })

Technical Notes

When the Throw Error activity executes, it immediately halts the current execution path and propagates the specified error message. This behavior can be caught by error handling mechanisms (e.g., Try-Catch blocks) within the workflow, allowing for graceful recovery or logging. If no error handler is present, the workflow will terminate with the thrown error. The Asynchronous parameter determines if the error propagation occurs immediately or is queued, though for critical error throwing, synchronous behavior is often preferred to ensure immediate interruption.