Docs / Language & functions
a9script authoring pack — run control functions
The run control functions, with their arguments and a line of real script each. Called by bare name; nothing is imported. A call marked pauses does real work outside the script: the run is saved, and continues on the next line with the result.
checkpoint(waitMs?) — pauses
Cuts the run into segments: the platform saves the run, frees the worker, and continues where it left off. Parked time costs no execution budget and each segment starts with a fresh one, so a long job survives limits that would otherwise end it. Everything the script has in scope is preserved across the cut.
waitMs(number, optional) — How long to stay parked before continuing. Omitted or0means as soon as the platform can pick the run up again, which is not instant: every checkpoint leaves the worker and comes back through the same machinery a long wait does. At most 24 hours — a longer wait is refused, because a run that wants to wake up next week is a schedule, not a pause.
Answers: Nothing.
for (let page = 1; page <= 50; page++) {
const response = fetch({ connection: "crm", method: "GET", path: "/contacts", query: { page: page } });
log("page " + page + ": " + response.body.items.length);
checkpoint(); // hand the worker back between pages
}