Macros
A macro is a reusable unit of automation that you build once and call from anywhere. Another automation calls the macro and passes it inputs; the macro runs its action steps with its own private set of variables and returns its output to the automation that called it.
Use macros to share logic across hosted mailboxes, remote mailboxes, scheduled tasks, Agentic Actions, and other macros without duplicating action steps.
Macros are included with Developer Toolkit; they are not a separate purchasable module.
What a Macro Contains
Each macro has four parts:
| Part | Purpose |
|---|---|
| Name and description | How the macro appears in selectors and history. |
| Inputs | Named values the calling automation must (or may) pass in. Supports text, number, boolean, password, and structured types. |
| Actions | The ordered list of action steps the macro performs when invoked. Any action that runs in a hosted mailbox, remote mailbox, or scheduled task is also available inside a macro. |
| Output | Named values the macro returns to the calling automation. The output contains the values your actions store in {{output.name}} variables. |
Managing Macros
Click Apps in the top bar, then click Macros. From the Macros page you can:
- Create a new macro with the New Macro button.
- Edit a macro by selecting its name in the list.
- Clone a macro to start a new macro from an existing one.
- Test a macro to run it end-to-end against sample inputs without modifying live data outside the macro's own actions.
- Delete a macro when it is no longer used. Deleted macros cannot be invoked, and any action that still references a deleted macro records an exception when it runs.
The Macros dashboard tile and the topbar Create menu also link to the Macros page so you can jump straight to the list or create a macro from anywhere in the console.
The Macro Editor
Open a macro to edit it. The editor has three tabs:
Input
Define the named arguments the macro accepts. Each input has:
- A name that the macro's actions reference as
{{input.name}}. - A type (text, number, boolean, password, object, or array).
- An optional description that appears as help text on the Invoke Macro action when someone configures a call to this macro.
- A required flag.
Mark sensitive inputs (API keys, secrets) as password so their values are masked in history logs.
Actions
The ordered list of action steps the macro performs. Macros support every action that is available in hosted mailboxes, remote mailboxes, scheduled tasks, and other macros, including PSA actions, HTTP requests, AI calls, control structures, and the Invoke Macro action itself.
Reference inputs as {{input.name}}. Use {{custom.name}} for intermediate work between steps. To return a value, double-click the custom. prefix on an action's Store results in variable field to switch it to output..
Output
The Output tab shows the result the macro returns. It fills in automatically from the macro's actions: every action that stores its result in an {{output.name}} variable adds that value to the macro's output.
The calling automation reads the output from the variable named in the Invoke Macro action's Store results in variable field. For example, if the macro saves {{output.contact}} and the Invoke Macro step stores its result in lookup, the calling automation reads {{custom.lookup.contact}}.
Calling a Macro
Use the Invoke Macro action to call a macro from any container that supports it:
- Hosted Mailbox rules
- Remote Mailbox rules
- Scheduled Tasks
- Other Macros
- Agentic Action tools
A macro works like a self-contained unit with its own private set of variables. Data crosses between the macro and the calling automation in only two places: the Macro Inputs you pass in, and the output the macro returns.
- Your inputs use the calling automation's data. A Macro Inputs value such as
{{email.subject}}becomes the actual email subject, and the macro receives that finished value as{{input.name}}. - The macro works with its own variables. Steps inside the macro cannot read or change the calling automation's variables, including the triggering email and
globalvariables. If a step inside the macro needs a value, add it to the macro's inputs and pass it in. - Only the output comes back. When the macro finishes, the calling automation receives the macro's output in the Store results in variable field of the Invoke Macro step. Apart from that result, the calling automation's variables are exactly as they were before the macro ran.
Because of this, you can reuse a macro anywhere without worrying that its variable names clash with the names used by the calling automation. See Invoke Macro for examples and error handling.
Testing a Macro
The macro detail page has a Test button that opens the shared test modal. The modal:
- Lets you fill in sample values for each defined input.
- Runs the full macro end-to-end against a synthetic test trigger.
- Records the run in History under a
macro_testtrigger so you can inspect every step, variable value, and exception.
Use macro tests to verify a macro behaves correctly before you reference it from production rules and tasks.
Macros and Agentic Actions
Agentic Actions can call macros as tools. When you configure an Agentic Action, its Tools picker lists the macros defined for your organization alongside built-in actions and other Agentic Actions. Pick a macro, supply any input mappings, and the Agentic Action can invoke the macro while completing a task. It receives the macro's output as the tool result.
Use macros as Agentic Action tools when you want AI to perform a specific, well-defined task (look up a customer, create a ticket, send a notification) rather than reason through the whole task from scratch.
Variable Behavior Inside a Macro
See Variables for the full variable reference. Inside a macro:
{{input.name}}is read-only and contains the values the calling automation passed in.{{custom.name}}is the default place to store action results within the macro. These values stay inside the macro; the calling automation cannot see them.{{output.name}}defines the macro's return values. Values you store here become the macro's output.{{global.name}}is not available. A macro cannot read or change the calling automation'sglobalvariables. To use a global value inside a macro, pass it in through Macro Inputs, for example{{global.contact.id}}.{{email.name}}is not available, even when a hosted mailbox or remote mailbox calls the macro. Pass any email details the macro needs, such as{{email.subject}}, through Macro Inputs.{{meta.history.id}}and{{meta.history.url}}always reference the current processing run.
Related Topics
- Invoke Macro action: the action that calls a macro from any container
- Variables: how
input,output,custom, andglobalbehave inside and outside macros - Expression Builder: build expressions that read macro inputs and outputs