Code automations

When notifications, emails, and webhooks aren't enough, write the logic yourself. The Code action runs a Python script as an automation step — against your data, in a secure, isolated sandbox. What the script does is up to you: the possibilities are as wide as code.

Two ways to write the code

  • Let your own AI agent write it — any agent connected over MCP writes the script, wires the trigger, asks you for the Secrets it needs, tests it, and deploys. This is the vibecoded path: automation in minutes, no developer required.
  • Write it by hand — a code editor in the automation's settings, for developers who want full control.

How a Code step works

def main(input):
    # your logic — work with the record that triggered the run,
    # call an external API, compute, decide…
    return {"status": "processed"}
  • Inputs are detected from your code — reference what you need and the editor picks it up.
  • The output schema comes from a test run — run the step once and its output becomes typed data the next steps in the automation can use.
  • Runs are logged — every execution keeps its output and result, in the automation's log (an agent connected over MCP can read it too — ask it "why did last night's run fail?").

Secrets stay secret

API keys and credentials the code needs live in the secure vault, never in the code:

  • Add a Secret in the automation's settings — or let your agent ask for it: you get a secure one-time form, so the value never passes through the conversation.
  • At runtime the Secret is injected into the sandbox — it doesn't appear in the code, the conversation, or the logs.

The sandbox

Each run executes in an isolated environment that exists only for that run — separated from other automations, other users, and other systems. It gets your inputs and Secrets, does its work, returns its output, and is gone.

Trigger it however you need

A Code step runs from any trigger: when a record is created, updated, or deleted, at a scheduled time, or on demand.

What people build with it

  • Enrichment — on new record, call an external API (key stored as a Secret) and fill in the missing fields.
  • Scheduled digests — every morning, aggregate yesterday's records and post the summary where the team lives.
  • Guardrails — validate incoming data with real logic, beyond what formulas can express, and flag what fails.
  • Custom sync — push changes to an internal system that has an API but no Make app.

Next