Appearance
Throw error
The Throw error action allows you to manually trigger an error in your API workflow. This is useful for handling logical errors (like invalid user input or failed validation) or for stopping a workflow when something goes wrong.
How it works
When this action is executed:
- The current workflow branch stops immediately.
- If the action is inside a
Try/Catchblock, theCatchbranch is triggered. - If not, the error bubbles up to the nearest parent
Try/Catch. If there is no parentTry/Catch, the workflow stops and the error appears in the logs and debugger.
Configuration
You can customize the error details in the side panel:
| Option | Description |
|---|---|
| Message | A readable description of the error (e.g. "Invalid email format"). This becomes the message property on the caughtError object (available as caughtError.message). |
| Cause | Optional additional details (e.g. "validation_failed"). This becomes the cause property on the caughtError object (available as caughtError.cause). |
Example use case with Try/Catch
Commonly used for validating data before proceeding with an action.
CONTINUE LEARNING
Now that you know how to raise custom errors, learn how to catch and handle them with Try/Catch:

