Skip to main content
The When row decides what starts a run. Each automation has one trigger: open the menu under When and pick it.
The When menu listing the triggers

The trigger menu. It lists only the triggers you can use in this workspace.

A trigger’s values are what the steps pick “from the document”, “from the request” or “from the message”. See Use values from earlier steps. Document and message triggers only count what arrives after the automation is switched on. Switching to another trigger starts it fresh: the old trigger’s settings are not kept.

When a document finishes processing

Runs once for each document of the chosen types that Mercora processes.
The document trigger with Types Invoice, Any invoice category and Wait for a trade match on

Runs for every invoice, once it's matched to a trade.

Values for the steps, listed under From the document:
  • The document: the document that started the run.
  • Its trade: the trade it’s matched to.
  • Every field Mercora extracts from the chosen types. For an invoice: Invoice number, Invoice date, Due date, Vendor name, Billed to, Currency, Subtotal, Tax amount and more.
Example. Types Invoice, Wait for a trade match on. When supplier invoice KSS-INV-26-0288 from Kanchana Siam Sugar is matched to trade VCS-S-2026-0714, a run starts, and its steps can pick “from the document · Invoice number” (KSS-INV-26-0288) and “from the document · Its trade”.

On a schedule

Runs at a set time. Fill in the sentence: Starting a date, every weekday, day, week or month, at an hour. The time is in the time zone shown at the end, yours when you set it.
The schedule trigger: Starting, every weekday, at 07:00, Europe/Zurich

Every weekday at 07:00, Zurich time, starting 3 November.

A scheduled run starts with no values of its own: its steps work from what the automation may read under Uses. Example. Every weekday at 07:00, one AI step: “List the invoices that went overdue yesterday, with their trade, counterparty and amount.” With Invoices & costs set to Read, each morning’s run files its list in the Inbox, or nothing on a day with no overdue invoices.

Only when someone runs it

Runs only when someone starts it: Run now on the automation’s page, or a request to the Copilot such as “Run the overdue invoices automation”. Use it for jobs you start by hand, and while you build an automation you’ll later put on a schedule. It hands the steps no values.

When another system calls

Runs when your own system, such as an ERP, calls Mercora’s API.
  1. Click Save once. The automation’s address then shows under When: POST /api/v1/agents/{id}/run. Click Copy.
  2. Your system calls that address with a workspace API key that has the Automations scope. Keys are made under Settings → Administration → API; see API keys.
  3. Under Fields it sends, type the name of each field your system sends, in lower_snake_case (such as contract_number), click Add a field, and pick its type: Text, Number, Yes or no or Date.
The API trigger with Fields it sends: contract_number as Text and lots as Number

An automation another system calls, with the two fields it sends.

Your system sends the fields inside input, with its own external_id for the request:
Sending the same external_id and body again with the same API key returns the run it started instead of starting a second one; after a key change it starts a new run. The same external_id with a different body is refused. The steps pick each field “from the request”: here Contract number and Lots. See the API reference.

When an email arrives

Runs for each email that reaches the workspace’s email inbox and matches the filters. Only a workspace admin can save this trigger.
The email trigger with From @kanchanasiam.example, Subject has any of invoice, and Only with a file on

Runs for emails from the supplier's domain whose subject says invoice and that carry a file.

An email goes to one place only: once it matches an automation, it no longer goes to Deal Capture or vessel nominations. With no filter at all, every email comes here. Emails from registered freight carriers always stay with Freight Rates. Values for the steps, under From the message: The message (its text), Who sent it, The sender as a member (always empty for an email, since an email’s sender can’t be verified), Where it arrived, The subject, When it arrived and Its files (attachments, as documents).

When a Teams channel or WhatsApp group gets a message

Runs for each post in a Teams channel, or each message in a WhatsApp group, that an admin set to Automations under Settings → Integrations (Microsoft 365, WhatsApp). These triggers show in the menu only once such a channel or group exists.
  • Channels or Groups: click + and pick one or more.
  • From (WhatsApp only): phone numbers written in full, such as +41 79 123 45 67. Empty: anyone in the group.
  • Text has any of: words the message must contain, at least one. Empty: any message.
The values are those of an email, without The subject. Here The sender as a member is filled when a teammate sent the message. A message goes to one place only. A Teams channel an admin sets to Automations no longer goes to Deal Capture, even when no automation listens to it. WhatsApp groups never go to Deal Capture, and a group used for hedging can’t be set to Automations.

Next steps