Skip to main content
Participating Frequently
September 2, 2026
Solved

Issues with Try/Catch in compound action

  • September 2, 2026
  • 3 replies
  • 26 views

I have a compound action with multiple try/catch statements that is live and currently working. I am trying to add specific status codes to one of the catch statements and it won’t validate but doesnt say why specifically. One thing I noticed is that inputting the status code in the visual editor comes out differently than the documentation shows it should be entered but even when I match the documentation it still doesn’t validate. What could I be missing?

 

This is how it comes out from the Visual Editor

 

Best answer by Kevin Mok

Got it, try-catch catches the responses’ status code, so it wouldn’t work for your use case here where the status is inside the payload.

Instead you will want to use a switch expression and you can do something such as:
 

switch:
cases:
- condition: data.<output_key>.status == "1006"
steps: [...]
default:
steps:
... # do work here

 

3 replies

Kevin Mok
Community Manager
September 2, 2026

Hey ​@Joel.Matias thanks for flagging this. I checked our internals and the supported error status codes are:

400, 401, 403, 404, 405, 408, 409, 410, 422, 429, 500, 501, 502, 503, and 504.

I am going to add this list to the docs. The current page explains the filter, but it does not tell you what expression accepts and we aren’t providing a great user facing error on the failed validation.

 

Quick question:

How are you receiving 1006 in this flow? 1006 is a WebSocket abnormal-closure code, not an HTTP response status. Does it come from a WebSocket close event or a field inside the API response body?

If it comes from the response body, on_status_code cannot match it. If you can share that part of the action log with sensitive values removed, I can help map it to the correct handling.

Participating Frequently
September 2, 2026

I may have misunderstood the status code catch. I have an error on my RSA API that provides status 1006 but the response_code is 200. I was trying to catch the status being 1006 as the error

 

 

Kevin Mok
Kevin MokAnswer
Community Manager
September 2, 2026

Got it, try-catch catches the responses’ status code, so it wouldn’t work for your use case here where the status is inside the payload.

Instead you will want to use a switch expression and you can do something such as:
 

switch:
cases:
- condition: data.<output_key>.status == "1006"
steps: [...]
default:
steps:
... # do work here