Skip to content

Scripts

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.

  1. Go to Settings → Scripts (Configuración → Scripts) and create one.
  2. Choose the source and events, and declare the scope: which collections it reads or writes, and whether it uses HTTP, services or the chat.
  3. Write the code in the editor and click Test (Probar): reads are real, but writes are not applied; they are shown as effects.
  4. Check the console and recent runs.
  5. Turn it on. Changing the code or the scope pauses it again.
  • No fetch, require, import or 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.
  • get_script_guide: sandbox API, sources, limits and recipes. Read it before writing code.
  • create_script (created paused) → test_script → fix with update_script → set_script_enabled only if the person asks.
  • list_scripts, get_script and get_script_runs to review and debug.