- Getting started
- For administrators
- RPA workflow projects
- Creating an RPA workflow from an idea
- Creating a project
- How to start an RPA workflow
- Managing project files and folders
- Connecting RPA workflows to your accounts
- Configuring activities
- Managing the activities in a project
- Passing values between activities
- Iterating through items
- Managing the data in a project
- Configuring a project to use your data
- Using file and folder resources
- Local setup for RPA workflow and app projects
- App projects
- Agentic processes
- Maestro Case
- Flow canvas in Maestro Orchestrate
- Agents
- Solutions
- API workflows
- Tests
Try Catch
Add a Try Catch activity to an API workflow in Studio Web to handle exceptions from API failures, invalid data, or unexpected errors with fallback actions.
The Try Catch activity provides structured exception handling within workflows. Use it to define fallback actions for API failures, invalid data, or unexpected errors.
Using Try Catch activity
To add a Try Catch activity to your workflow:
-
On your API workflow designer canvas, select the plus (+) icon. The Add activity menu appears.
-
Select More ... , then Try Catch.
-
In the Properties panel, provide a name for your error.
-
Optionally, configure retries for the Try block:
- Retry—Turn on to automatically retry the Try block when it fails. Off by default.
- Max retries—The maximum number of retry attempts.
- Initial delay—The delay before the first retry attempt.
- Backoff—The strategy used to increase the delay between subsequent retry attempts.
The Preview of retry schedule panel shows the computed delay for each retry attempt based on these settings.
-
Add activities to the Try block. These are the activities monitored for errors.
-
Define the error-handling logic in the Catch block. If any step in the Try block fails, execution transitions to the Catch flow.
-
Debug the workflow to execute the activity and generate output fields for later use.
When retries are enabled, each retry attempt appears as a separate entry in the run output, so you can review the result of every attempt.
Accessing error details
When an error occurs in the Try block, the Try-Catch activity exposes structured error details. To access the error details, use $context.outputs.Try_Catch_X.error, or $error.
The error object maintains a consistent structure, as follows:
"Try_Catch_1": {
"error": {
"type": "<runtime error source>",
"title": "<summary error message>",
"status": <response status code>,
"detail": "<detailed error message",
"data": {},
}
}
"Try_Catch_1": {
"error": {
"type": "<runtime error source>",
"title": "<summary error message>",
"status": <response status code>,
"detail": "<detailed error message",
"data": {},
}
}
The error details are:
- type—Indicates the runtime source of the error.
- title—Provides a concise error summary.
- status—The HTTP status code (if applicable).
- detail—Offers a detailed explanation of the error.
- data— Includes additional metadata about the failed task. This field may not always be populated.
You can reference these properties to build structured error responses or trigger alerts.