Script API
What it is
Section titled “What it is”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:
| Variable | Purpose |
|---|---|
event | What fired the script: event.recordId, event.record, event.previousRecord, event.text… |
collections | Read and write records of the collections in scope. |
http | HTTPS requests to allowed domains. |
services / integrations | Invoke integration actions and check their status. |
dashboard | Publish values for widgets and sound alerts. |
chat | Post to a channel or comment on a record. |
notify, reports, properties, globals, dates, utilities, console | Notifications, reports, script properties, shared values, dates and utilities. |
How it works
Section titled “How it works”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,paginateorquery().where().orderBy().limit(). - Writing:
create,update,delete(with the same validations and rules as a person) andincrementfor atomic sums.
Rules and limits
Section titled “Rules and limits”- Up to 2000 records per query and 200 per
getMany. - HTTP: only
httpson 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.postandchat.commentpost under the script’s name with the permissions of whoever turned it on.
For agents (MCP)
Section titled “For agents (MCP)”get_script_guide: the exact signature of each method, whateventcarries per source, the limits and tested recipes.test_scriptreturnseffects: what the script would do, without applying it.