a9script

Docs / Connections & functions

How a call behaves

An http config function is one configured call. What happens when the API does not simply answer is configuration too: the script calls the function by name and gets the answer, or a fault that says what went wrong. This page shows each setting as a short sequence of pictures. The settings themselves are listed in Connections and functions and in the config function reference.

SettingWhat it decidesWithout it
retry.timesHow often a repeatable answer is asked again3 repeats, at most 10
retry.status / retry.neverStatuses added to, or removed from, the repeatable setthe platform’s table below
idempotentA server error is repeated for any method, and a call cut by a crash is asked againonly safe methods repeat a server error
pauseOnStatuses that park the run for the time the API asksa 429 is repeated in place
timeoutMsHow long the API may stay silent5 minutes, at most 10
expectWhich statuses count as an answer; any other is a faultevery status is an answer
paginateWhere the items and the next page areone page

Asked again where that is safe

A call is asked again where that is safe
  1. timeask503

    1The first ask is answered with a status worth asking again: 408, 425, 429, or a 5xx when the method is safe to repeat.

  2. timeask503ask503askwait×2

    2Each wait doubles from 250 ms, with jitter, and never exceeds 30 s. A Retry-After from the API is honoured within that ceiling.

  3. timeaskaskaskask200up to 3 repeatsdeadline

    3At most 3 repeats by default, up to 10 when configured. All asks share one deadline of 60 minutes; no repeat starts past it.

AnswerAsked again?
408, 425, 429yes, for every method
a 5xx server error, except 501 and 505yes for GET, HEAD, OPTIONS, PUT, DELETE, or with idempotent
400, 401, 404, 422never
anything elseno — it is the call’s answer

A long wait parks the run

pauseOn: a long wait parks the run, not the slot
  1. queueslotsAPIAPIrun Arun Brun C429Retry-Afterparked

    1Run A's call is answered with a status listed in pauseOn — 429 is the usual one — and a Retry-After.

  2. queueslotsAPIAPIrun Drun Brun Crun A, parked

    2The run is saved and parked for the time the API asked. Its slot is free at once, and the next run in the queue takes it.

  3. queueslotsAPIAPIrun Drun Arun C200parked

    3When the wait is over the run takes the next free slot, the call is asked again and the script goes on. One wait is at most 24 hours.

Repeating in place holds a slot while it waits. pauseOn gives the slot back: the run is saved, and it continues when the wait is over. A run that answers a caller directly cannot be parked; for it a long wait is a fault.

Silence, not total time

timeoutMs measures silence, not the whole call
  1. timetimeoutMsdata keeps arriving

    1A long download is fine as long as data keeps arriving: every byte restarts the clock.

  2. timetimeoutMscut

    2No data for longer than timeoutMs ends the call. The default is 5 minutes, the most a function may set is 10.

The circuit protects the API and your queue

A failing API is not hammered
  1. your runsAPIcircuitfailures in a row

    15 failures in a row — no connection, or a server error — trip the connection's circuit.

  2. your runsAPIcircuitrefusing for 30 s

    2For 30 seconds every call over that connection is refused at once, without being sent. The error names the connection and when the next try is due.

  3. your runsAPIcircuitone trial call

    3Then one call is let through. If it is answered, calls flow again; if not, the circuit stays shut for another round.

The environment’s outbound window

The environment's outbound window
  1. time60 s window60 s window60 s windowup to 3000 calls per window

    1All calls of one environment share a window of 60 seconds. Up to 3000 calls per window go out as asked.

  2. time60 s window60 s window60 s window…

    2The window is full and one more call arrives.

  3. time60 s window60 s window60 s window…refused, nothing sent

    3It is refused at once, with the time the window opens again; nothing reaches the API. The limit is a safety net against a runaway script, not a rate plan: pace a known API limit with pauseOn.

Paging

Paging is configuration, and a walk survives a wait
  1. runAPIdatasetpage 1rows

    1The function's paging settings say where the items and the next cursor are. One page is fetched and its rows are stored in a dataset.

  2. run savednext: page 2APIdatasetslot free for other work

    2Between pages the run is saved with its cursor and gives its slot back, so a long walk does not hold capacity others are waiting for.

  3. runpage 7APIdataset429parked; continues at page 7

    3With pauseOn set, a 429 in the middle of the walk parks the run; it continues at the page it stopped at, never from the start.

Written for this site. What it says is held true by apps/runtime/test/broker-retry.test.ts, apps/runtime/test/acceptance-suspend-resume.test.ts, apps/runtime/test/broker-breaker.test.ts, apps/runtime/test/egress-rate.test.ts, apps/runtime/test/acceptance-pagination.test.ts in the product's own repository. Found a problem on this page? Write to the address in the footer.