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

# Automations overview

> What an automation is, what it acts on, the states it can be in, and who can set one up.

An automation does something to an order on its own, every time the same thing happens. Each one reads as a sentence:
**When** something happens, **if** the order fits, **then** do these steps. For example: when an order is paid in full,
if it has no shipment yet, then create the shipment, print the label and set the status.

You find automations under **Automations** in the menu:

| Page | What it is for |
| - | - |
| **Automations** | Every automation, in the order they run, with what each has been doing. See [Create and edit automations](/automations/create-and-edit). |
| **Custom triggers** | Buttons, keyboard shortcuts and barcodes that start automations when a person decides. See [Custom triggers](/automations/custom-triggers). |
| **Activity** | Every run on every order, and the problems that need you. See [Runs and activity](/automations/runs-and-activity). |

Packers use automations through **Floor mode**, a full-screen view of one order at a packing station. See
[Floor mode](/automations/floor-mode).

## What an automation is made of

<Steps>
  <Step title="What starts it">
    The trigger. It can be something that happens to an order, such as **An order arrives** or **The status changes**;
    time passing, such as **An order has been in a status for some days**; or a person pressing one of your
    [custom triggers](/automations/custom-triggers). Each automation has one trigger.
  </Step>

  <Step title="If the order fits">
    Conditions, for example "**Payment status** is Unpaid". The order must match all of them. With no conditions, the
    automation acts every time its trigger happens.
  </Step>

  <Step title="Do these steps, in this order">
    What it does, step by step: set a status, create a shipment, print the label, tell people, and so on. A step can stop
    the rest when it fails.
  </Step>

  <Step title="If a step fails">
    Optional: who to tell, and a custom trigger to press, when a run fails for good.
  </Step>
</Steps>

The triggers, conditions and steps you can choose come from the modules your organization uses. The full list is in
[What you can choose](/automations/create-and-edit#what-you-can-choose).

## What automations act on

In this version, automations act on **orders** only. Automations on products are not available yet.

## States

An automation is in one of four states. The list shows it as a switch, and as a tag for **Trial** and **Paused**.

| State | What happens |
| - | - |
| **On** | It acts for real every time its trigger happens and the order fits. |
| **Trial** | It records what it would have done and changes nothing. See [Trial](#trial). |
| **Paused** | New runs wait. When you resume it, each waiting run checks its conditions again on the order as it is then, and runs only if the order still fits. Nothing is skipped. |
| **Off** | Its trigger is ignored. |

A new automation starts **Off**. In the editor you choose **Off**, **Trial** or **On** under **Whether it runs**. You
pause an automation from the **Automations** list or from **Activity**, and resume it from the list.

Switching an automation off, or deleting it, cancels its runs that are still waiting: "Cancelled: the automation was
switched off."

### Trial

A trial shows what an automation would do on real orders before it does anything. It runs the same checks as a live
automation and records each run, but no step acts: nothing is set, booked, printed or sent.

* On the **Automations** list, a trial's row counts the "times it would have run. Nothing was changed."
* On the order card, its runs show **Trial: nothing was changed**.
* On **Activity**, its runs are in the **Trial** tab.

When you switch a trial automation on, Omnilinker asks first: "Switch “…” on? It has only been trying until now: from
now on it acts for real."

<Tip>
  Before you switch an automation on, look at what it would have done over the last 7 days in the editor, and try it
  on one order. Both change nothing. See [Check before you switch it on](/automations/create-and-edit#check-before-you-switch-it-on).
</Tip>

## Run order

When several automations start on the same trigger, they all look at the order as it was at that moment, then run one
after another, from the top of the **Automations** list to the bottom. Automations in groups run first, group by group;
the ones not in a group run after them. See [Order and groups](/automations/create-and-edit#order-and-groups).

## Holds

You can hold automations on one order, for example while someone sorts it out by hand. While an order is held, nothing
starts on it by itself: runs wait as **Waiting: held** until someone releases it. When the hold is released, each
waiting run checks its conditions again and runs only if the order still fits.

A custom trigger pressed on that one order still runs, because a person chose to press it. A press on several orders
at once, from the order list, leaves held orders out.

You hold an order from its card, an automation can hold it with the **Hold automations** step, and floor mode holds it
with **Hand to a person**. See [Hold automations on an order](/automations/runs-and-activity#hold-automations-on-an-order).

## When a step fails

A step that fails for a passing reason, such as a carrier that does not answer, is tried again by itself after 5, 15,
30 and 60 minutes: five tries in about two hours. A step the module refuses, for example a status that does not exist,
is not tried again, because trying again would not change the answer.

When a step has failed for good, Omnilinker sends a notification to the person who made the automation, and to the
people and role chosen under **If a step fails**. You can then retry the step from the order card or from
**Activity**. See [Runs and activity](/automations/runs-and-activity).

## Loop protection

Automations can start each other: a step that sets a status starts the automations that wait for **The status
changes**. To stop two automations from setting a status back and forth for ever:

* A chain stops after 5 automations in a row: "Stopped: automations triggered each other 5 times in a row."
* An automation acts on an order at most once in the same chain: "Stopped: this automation already acted on this
  record in the same chain."

A stopped run shows **Stopped by the loop guard** on the order card, and the person who made the automation gets a
notification. **Activity** lists the loops it stopped. The editor warns you before you save, under **Worth knowing**,
when an automation's steps start other automations.

## Permissions

Automation permissions are in the **Automations** group in the role editor. See
[Users and roles](/administration/users-and-roles).

| Permission | Lets you |
| - | - |
| **See automations** | Open **Automations** > **Automations** and the editor, read-only. |
| **Create and change automations** | Create, change, switch, pause, reorder and delete automations and groups, try an automation on an order, and pause an automation from **Activity**. Needs **See automations**. An automation acts with its own rights, not its author's: whoever has this permission can make every order create a shipment, change its status or anything else an automation can do. Give it only to people you trust with all of those. |
| **Set up buttons, shortcuts and barcodes** | Open **Automations** > **Custom triggers** and set custom triggers up. Also needs **See automations**. |
| **Use buttons, shortcuts and barcodes** | Press custom triggers: their buttons, shortcuts and barcodes, in floor mode too. An API key needs it to press one. What a trigger's automations do, they do as the rule: a button that creates shipments buys them, for someone who couldn't create a shipment by hand. |
| **Run a button on an order whose status it doesn't allow** | Answer **Run it anyway?** when a custom trigger is pressed on an order in a status it does not run in. |
| **See what automations did** | See the **Automations** section of the order card and open **Automations** > **Activity**. |
| **Retry and stop automation runs** | Retry failed steps and stop runs, on the order card and in **Activity**. Needs **See what automations did**. |
| **Hold and release automations on a record** | Hold and release automations on an order from its card. |
| **Change automation settings** | Set how long automation history is kept, under **Administration** > **Settings** > **Automations**. See [How long runs are kept](/automations/runs-and-activity#how-long-runs-are-kept). |

## Switching automations on for your organization

Automations are one feature, **Automations**, in the **Automations** group. It is on by default. When it is off, the
**Automations** menu is hidden, the pages say "Automations aren't switched on for this account.", and nothing is
recorded or run. Omnilinker switches features; see [Modules and feature availability](/administration/features).

## Next steps

<CardGroup cols={2}>
  <Card title="Create and edit automations" icon="list-checks" href="/automations/create-and-edit">
    Start from a goal, add conditions and steps, and check what it would do.
  </Card>

  <Card title="Custom triggers" icon="mouse-pointer-click" href="/automations/custom-triggers">
    Buttons, shortcuts and barcodes that start automations.
  </Card>

  <Card title="Floor mode" icon="scan-barcode" href="/automations/floor-mode">
    Scan an order at a packing station and press a tile.
  </Card>

  <Card title="Runs and activity" icon="activity" href="/automations/runs-and-activity">
    What ran, what didn't and why, and how to fix a failure.
  </Card>
</CardGroup>


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