The Raise expression gives you a sharp tool to flag errors explicitly and stop execution of compound actions. The Try Catch expression complements it by attempting risky code and rerouting on failure.
This expression triggers an immediate exit, much like throwing an exception in code, but with a stored output for traceability. Always set an output_key to capture the error object (status, details), and add a message for clarity in logs or chats.
The try_catch expression allows for the execution of a compound action expression with an error handling mechanism. If the try block encounters an error, the catch block is executed, allowing for graceful error handling and recovery. This is particularly useful for managing errors in compound actions where certain actions might fail under known or unknown conditions.
Important: The try_catch expression does not expose the actual API error details (like error messages or response bodies) to the catch block. However, you can filter catch blocks by HTTP status codes using on_status_code, which allows you to use status codes as identifiers for different error scenarios.
For example:
404 errors for “not found” scenarios500 errors for server issues403 errors for permission problemsThis approach lets you create targeted recovery logic based on the type of failure, even without access to the detailed error information.
Combine the Try Catch and Raise steps for graceful error handling



Halt non-admins
Catch a 404, notify the admin and raise the error
Log any error and exit
Handle different error types using status codes as identifiers