Skip to content

Script API

Inside a script there are no modules and no direct network: everything goes through global variables that the server checks on every call. The main ones:

VariablePurpose
eventWhat fired the script: event.recordId, event.record, event.previousRecord, event.text…
collectionsRead and write records of the collections in scope.
httpHTTPS requests to allowed domains.
services / integrationsInvoke integration actions and check their status.
dashboardPublish values for widgets and sound alerts.
chatPost to a channel or comment on a record.
notify, reports, properties, globals, dates, utilities, consoleNotifications, reports, script properties, shared values, dates and utilities.
const paid = await collections("Orders").findMany({ status: "Paid" }, { limit: 50 });
await collections("Orders").update(event.recordId, { status: "Shipped" });
await dashboard.set("sales_today", paid.length);
const r = await http.get("https://api.example.com/rate");
console.log(r.status);
  • Reading: findMany, findOne, find(id), count, search, paginate or query().where().orderBy().limit().
  • Writing: create, update, delete (with the same validations and rules as a person) and increment for atomic sums.
  • Up to 2000 records per query and 200 per getMany.
  • HTTP: only https on port 443, no internal networks or redirects, 10 s, 64 KB, 30 per minute and 1000 per day.
  • Each write fires that collection’s automations and scripts, with the chain limited to 3 levels.
  • chat.post and chat.comment post under the script’s name with the permissions of whoever turned it on.
  • get_script_guide: the exact signature of each method, what event carries per source, the limits and tested recipes.
  • test_script returns effects: what the script would do, without applying it.