How do I branch on the HTTP request result?
Add the HTTP request result condition inside a Router (or Conditional) right after the HTTP Request step. It splits contacts by what the other system answered — it worked, it rejected the request, it is down, or it never answered — so the automation can notify someone, try another path, or simply carry on.
It is the alternative to stopping the run on error: instead of ending, the contact follows a path you designed. See What happens when the automation HTTP request fails? to choose between the two.
Role: any member with edit access to the workspace.
Before you start
- An automation with an HTTP Request step before the point where the split goes. The condition reads the most recent request result on that path.
Steps
-
On the canvas, click the + after the HTTP Request step and pick Router.
-
On path 1, give it a name (for example,
Integration down) and click Add condition. -
In the left column, open the HTTP request tab and click HTTP request result.
-
Pick the operator:
-
With is equal to, enter the code in the field next to it (
100to599) — for example409for "that record already exists here". -
Under Request, pick which HTTP step the result comes from. The default, Last request on the path, covers the common case of a single HTTP step.
-
Repeat on the other paths and connect each output to the step that should happen. The Otherwise output takes whoever matched no path.
With more than one request in the automation
Last request on the path always answers about the most recent HTTP step that ran. In an automation with two requests, that means the second one — even when you meant to ask about the first.
To ask about a specific request, pick it under Request. The list shows the automation's HTTP steps identified by method and URL (for example, POST https://api.example.com/orders).
Two details that avoid surprises:
- The list shows every HTTP step, not only the ones before it. Which step actually runs depends on the path the contact takes, and that is only known at run time. If you pick a step that did not run for that contact, the condition matches nothing and they leave through Otherwise.
- Duplicating the automation keeps the choice. The condition then points at the matching step in the copy, not at the one in the original automation.
When no path matches
If no HTTP request ran before on that path, the condition matches nothing — not even No response — and the contact leaves through Otherwise. A path that never called the other system did not "fail", so it is not sent down the error branch.
That is why the condition belongs after the HTTP Request step, never before it.
The code is also a variable
The result is available as {{httpStatus}} in the following steps — you can use it in a message body or in another request body. When there was no answer at all, the value is 0.
If it did not work
- Every contact lands on Otherwise: check that the HTTP Request step really is before the split, on the same path.
- The automation will not publish: with the is equal to operator the code is required. The builder warns when it is blank.
- The error path never gets anyone: check that the HTTP step is not set to Stop and record the failure — that ends the run at the step itself, so it never reaches the split.