Integrations and API calls
API call steps: retries, call log and failure branches
How an API call step behaves: what counts as success, which failures are retried, how to keep response values and how to route failures.
Last updated
An API call step sends one request to a system your administrator has connected, waits for the answer and moves the workflow on. This article covers settings, retries and what to do when a call fails. First, an administrator must add the system. See connect an external system.
Settings on the step
| Setting | What it does |
|---|---|
| Integration | The name of the connection. It must be active. |
| Method and Path | The request line. The path starts with / and is joined to the integration's base address. |
| Body (JSON) | Sent for POST, PUT and PATCH. May include {{form.field}} placeholders. |
| Extra headers | Optional. Credentials come from the integration, so you cannot set authorisation headers here. |
| Keep from the answer | Saves parts of the response as vars.<name>, using a path such as data.id or items.0.name. |
| Timeout (s) | How long to wait for one attempt, from 1 to 30 seconds. The default is 15. |
| Attempts | How many tries in total, from 1 to 5. The default is 3. |
What counts as success
A call succeeds when the other system answers with a 2xx status. A redirect (3xx) counts as a failure, because redirects are not followed. If you listed values under Keep from the answer, each one must be found in the response. A missing field counts as a failure and is not retried. Saved values can then be used in later conditions as vars.<name>. See the expressions reference.
Retries
- A call is tried again when there is no answer, the attempt times out, or the system answers 429 or a 5xx error.
- The wait between attempts grows each time, up to a few minutes.
- Other answers, such as 400, 401, 404 or a redirect, fail straight away. Retrying would not help.
- Every call carries an
Idempotency-Keyheader, which stays the same across retries, so the receiving system can recognise and ignore a repeat.
Add a failure branch
- Draw the connection for the normal route and select it. Set Taken when the call to Succeeds.
- Draw a second connection, select it and set Taken when the call to Fails (after all attempts).
- Send the failure route to something useful, such as a Task for someone to enter the data by hand, or a Notification.
An API call step needs exactly one success connection and can have at most one failure connection.
See what happened
- The request timeline shows when the call was queued and whether it succeeded or failed.
- An administrator opens Integrations and chooses Calls to see each attempt: time, method and path, status code, duration and attempt number. Failed attempts include the error.
Simulation assumes API calls succeed, so test the failure route by making a real call fail in a test setting. Learn more in validate and simulate. The API calls and integrations module page gives an overview, and conditions and branching shows how to act on saved values.