> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercora.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Automations

> Standing instructions that run on a schedule, when a document arrives, when a message comes in, or when another system calls. They read the data you allow and file what they find. Changes always wait for a person.

An automation is a standing instruction: a job you describe once that Mercora then runs for you. "Every weekday at 7:00, list the invoices that went overdue yesterday." "When a freight invoice finishes processing, check it against the agreed rates and propose the deduction." This page helps you build one, test it, and act on what it finds.

Each automation has three parts:

* **When it runs**: its trigger, such as a schedule or a document arriving.
* **Steps**: what it does, in order. An AI step works something out; other steps ask a person, check a condition or wait.
* **Uses**: the data areas and connected apps it may read, and where it may propose changes.

An automation reads on its own, but it never changes your records or sends anything without a person's approval. Every proposed change becomes an item in the Inbox that waits for **Approve**.

> [!NOTE]
>
> Available when the **Automations** module is turned on for your workspace. Ask your workspace admin.

## Who can do what

Two separate permissions control automations:

| Permission | What it allows |
| - | - |
| **Automations — management** | See automation definitions and their history, and create, edit and run automations, limited to the data each automation's owner can access. |
| **Automations — results** | Read what automations found, and act on their results in the Inbox, limited to the role's own data access. |

So a finance lead can review findings without being able to change the automation, and an operator can build automations without seeing results outside their own access. See [Roles and permissions](https://docs.mercora.io/concepts/roles-and-permissions.md).

### Owner and who can see it

Every automation has an **Owner**. A run acts as its owner: it can only read what the owner's role can read, and only within the areas the automation's **Uses** allow. The owner also approves what the automation proposes and answers its questions, and a workspace admin can always step in.

Under **More settings**, **Who can see it** is either the owner and workspace admins (the default; the automation shows a **Private** tag) or **Everyone in the workspace**. A private automation, its runs and its Inbox items are invisible to everyone else.

## Find your automations

Click **Automations** in the sidebar. The list on the left groups automations as **Waiting for you**, **On** and **Off**, with a search box and **New automation**. Pick one to open it on the right, with two tabs: **Runs** (what it did) and **Steps** (what it does).

## Create an automation

**1. Start a new one**

Click **New automation**. Describe what it should do in the box, for example "When a freight invoice arrives, check it against the rate sheet and propose the deduction", and click **Draft**. Mercora drafts the trigger, steps and access for you to check. Or click **Start empty** to build it yourself.

**2. Choose when it runs**

Under **When it runs**, pick a trigger and set its details. See [Triggers](#triggers).

**3. Check the steps**

Each step reads as a sentence. Click one to open it, use **Move up** or **Move down** to reorder, or **Add a step**. See [Steps](#steps).

**4. Set what it can use**

For each data area, choose **No access**, **Read** or **Propose changes**. An area the owner can't see is disabled with the reason. A drafted automation never gets **Propose changes** on its own: it is shown as "Suggested: Propose changes" for you to accept.

**5. Test it**

Click **Test**. The automation runs on real data, but nothing is sent or saved. See [Test before you switch on](#test-before-you-switch-on).

**6. Save and switch on**

Click **Save**, then switch it on. If you haven't tested these exact steps, Mercora asks first, with **Test first** or **Switch on anyway**.

You can also start from a Copilot chat: **Make this an automation** under an answer drafts one from what the chat did. See [Copilot](https://docs.mercora.io/copilot/overview.md).

## Triggers

| Trigger | What starts a run | Settings |
| - | - | - |
| **On a schedule** | A set time, every weekday, day, week or month | Start date, how often, and time, in your time zone |
| **When a document finishes processing** | A document of the chosen types is processed | Document types, invoice categories, and **Wait for a trade match** (on by default) |
| **Only when someone runs it** | Someone clicks **Run now**, or asks the Copilot to run it | None |
| **When another system calls** | Your own system calls the Mercora API | Optional input fields (text, number, yes or no, date) |
| **When an email arrives** | An email reaches your workspace's email inbox | **From** (addresses), **Subject has any of** (words), **Only with a file** |
| **When a Teams channel gets a post** | A post in a Teams channel or group chat set to Automations | **Channels**, **Text has any of** |
| **When a WhatsApp group gets a message** | A message in a WhatsApp group set to Automations | **Groups**, **From** (numbers), **Text has any of** |

Document and message triggers only count what arrives after the automation is switched on.

### Calling an automation from your own systems

With **When another system calls**, save the automation once to get its address, shown as `POST /api/v1/agents/<id>/run` with a **Copy** button. Your system calls it with a workspace API key that has the automations scope. The run works in Mercora, and anything it would change still waits for a person there. If a step waits for your system, your system answers through the run's callback. See the [API reference](https://docs.mercora.io/api-reference/introduction.md) and [API keys](https://docs.mercora.io/admin/api-keys.md).

### Email, Teams and WhatsApp triggers

A message goes to one place only, so a recap is never captured twice:

* **Email.** Only an admin can save an email trigger. An email that matches its filters goes to the automation instead of to Deal Capture or vessel nominations. Emails from registered freight carriers stay with Freight Rates. With no filter at all, every email that isn't from a carrier goes to the automation. If no run could start, the email carries on to Deal Capture as usual.
* **Teams.** An admin sets a channel or group chat to **Automations** under **Settings → Integrations → Microsoft 365**, in **Chats and channels**. A channel set to Automations no longer goes to Deal Capture. See [Microsoft 365](https://docs.mercora.io/integrations/microsoft-365.md).
* **WhatsApp.** An admin switches a group on under **Groups for automations** in **Settings → Integrations → WhatsApp**. Hedge groups are never offered. See [WhatsApp](https://docs.mercora.io/integrations/whatsapp.md).

## Steps

Click **Add a step** to see what you can add. Steps your role or workspace can't use are shown with the reason.

| Group | Step | What it does |
| - | - | - |
| AI | **AI · work something out** | Reads what the automation may use and does the job you describe in its brief. It can use skills, and with **Can stop and ask** on, it may pause to ask the owner a question. |
| Mercora | **Find a record** | Finds a trade, contract or invoice by its reference. |
| Mercora | **Update a record** | Changes a record's fields. Always asks first. |
| Mercora | **Report a finding** | Ends the run with a card in the Inbox. |
| Apps | Actions of connected apps | For example, find an email or post to a channel. Reading runs on its own; anything else asks first. |
| People | **Ask someone to approve** | Waits until they approve, edit or reject what the step before drafted. It can't be the first step. |
| People | **Ask someone a question** | Waits for the answer and passes it to the next step. |
| Logic | **If** | Carries on only when a value matches; otherwise stops or skips ahead. |
| Logic | **Wait for** | Waits for a set time, a document to reach the trade, or another system to call back, up to a limit. |
| Logic | **Tell someone** | Leaves a note in their Inbox. The run carries on. |

App actions are available only once an admin has connected the app and switched those actions on under **Settings → Integrations**. Every app action starts off. See [Integrations](https://docs.mercora.io/integrations/overview.md).

## Test before you switch on

**Test** runs the automation's steps on real data, as you, within the areas the automation may use. For a document trigger you pick a recent document to try it on, such as Veltana's B/L RCLLCH2607841; for an API trigger you pick a recent call or paste a body; for a message trigger you pick a recent message or type one.

During a test:

* Reads are real.
* Any change the automation proposes is held and shown as the card the approver would see. It is never made.
* An **Ask someone to approve** step counts as approved, and is marked so.
* A question is shown unanswered.

The result is shown under the steps, tagged as a test, and ends with "Nothing was sent or saved".

## Runs and results

The **Runs** tab lists the newest runs, most telling first:

* A **waiting** run shows what it waits for first, such as the approval card, with the steps folded into one line.
* A **finished** run shows its answer, each step on one line, and any calculation it made. **Continue in Copilot** opens the result in a chat, **Rerun** runs it again on the same input with an optional note for the AI, and **Save as PDF** prints the answer.
* A **failed** run leads with the step that failed and why.

Editing a live automation saves a new version. Runs already under way keep the version they started with; new runs use the latest. **Versions** in the ⋯ menu lists every saved version and opens its steps read-only.

### What reaches the Inbox

An automation files its work in the Inbox, under **Needs you**:

* A **finding** it reported, or an **Automation failed** card.
* Each change it proposes, with an **Approve** chip.
* Each question it asks, with an **Answer** chip.

A clean run that found nothing files nothing, so a quiet automation doesn't fill the Inbox. See [The Inbox](https://docs.mercora.io/documents/inbox.md).

## Approve what an automation proposes

Each proposed change is one Inbox item. The card shows the change, the record it touches, why the automation suggested it, and the evidence it used, such as its calculations and the source document.

* **Approve** makes exactly that change. For anything that leaves Mercora, the button reads **Approve and send** (a message) or **Approve and run** (another action outside Mercora).
* **Edit** lets you change the values, then **Save and approve**.
* **Reject** makes no change. You can add a reason.

Only the owner or a workspace admin can decide. Everyone else who can see the automation sees who it is waiting for. Once an automation has a few decisions, the card also shows how often its proposals were approved as drafted.

A request that nobody decides eventually ends, and the card shows the date ahead of time. When it ends, nothing is changed.

For example, an automation that checks supplier invoices against their contracts might propose changing the due date on Kanchana Siam Sugar's invoice KSS-INV-26-0288 to match the payment terms of purchase contract VCS-P-2026-0688. The card shows the due date before and after, why it was suggested, and the contract it used as evidence. Nothing changes until someone who may decide clicks **Approve**.

For a question, pick one of the suggested answers, or **Something else** and type your own, then click **Answer**.

### Approve from your phone

If you switched on WhatsApp under **Settings → Notifications** and linked your number, approvals and questions waiting for you are also sent to your WhatsApp, each with a number. Reply with:

| Reply | Does |
| - | - |
| `4` | Approves request 4 |
| `4n reason` | Rejects request 4, with the rest as the reason |
| `all` | Approves every waiting approval you can decide by number |
| `4a`, `4b` | Picks a choice on question 4 |
| `4 your answer` | Answers question 4 in words |

Your reply is recorded exactly like a click in the Inbox. A number you weren't sent decides nothing. This needs your workspace's WhatsApp to be set up and sending turned on. See [WhatsApp](https://docs.mercora.io/integrations/whatsapp.md).

## Switch off or archive

From the ⋯ menu, **Switch off** stops new runs, and **Archive** removes the automation from the list. Its runs and decisions stay.

If the **Automations** module is turned off, no new runs start, and existing results stay available to people who may see them.

> [!NOTE]
>
> Each workspace has a daily limit on automation runs. Runs, tests and API calls beyond it are refused until the next day.

## Next steps

> **[The Inbox](https://docs.mercora.io/documents/inbox.md)**
>
> Where automation findings, approvals and questions wait for you.

> **[Integrations](https://docs.mercora.io/integrations/overview.md)**
>
> Allow the app actions an automation's steps can use.

> **[Copilot](https://docs.mercora.io/copilot/overview.md)**
>
> Draft an automation from a chat with Make this an automation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.