Scripts
What it is
Section titled “What it is”A script is JavaScript (async) code that runs in the background in an isolated sandbox. Use it when an automation or a flow is not enough: calculations across collections, HTTP calls, values for dashboards or a site’s logic.
Sources: a collection (on create, update, delete or manually), comments on its records, messages in a chat channel, an MQTT connection, integration events, a site action or a schedule.
How it works
Section titled “How it works”- Go to Settings → Scripts (Configuración → Scripts) and create one.
- Choose the source and events, and declare the scope: which collections it reads or writes, and whether it uses HTTP, services or the chat.
- Write the code in the editor and click Test (Probar): reads are real, but writes are not applied; they are shown as effects.
- Check the console and recent runs.
- Turn it on. Changing the code or the scope pauses it again.
Rules and limits
Section titled “Rules and limits”- No
fetch,require,importor DOM: everything goes through global variables (see Script API). - A script only sees the collections it declares. Whoever turns it on approves the scope and must hold those permissions.
- Code up to 50,000 characters; 250 platform calls and 500 writes per run; a chain of scripts goes at most 3 levels deep.
- HTTP only with an «HTTP for scripts» connection and the company switch turned on.
- Permissions:
scripts:view,scripts:edit,scripts:test,scripts:enable.
For agents (MCP)
Section titled “For agents (MCP)”get_script_guide: sandbox API, sources, limits and recipes. Read it before writing code.create_script(created paused) →test_script→ fix withupdate_script→set_script_enabledonly if the person asks.list_scripts,get_scriptandget_script_runsto review and debug.