# Create an automation

> Set up a rule that runs actions automatically whenever a matching event happens. A rule reads as When → If → Then: when an event fires, if your conditions…

Source: https://infranest.io/docs/create-an-automation
Last updated: 2026-09-14

---

Automations let InfraNest take action for you whenever something happens in your infrastructure, so you don't have to react manually.

## Overview
- An automation reads as **When → If → Then**: *when* an event fires, *if* your conditions match, *then* it runs your actions in order.
- Use automations to save time on repetitive responses — like alerting your team, updating a ticket, or rebooting a server — whenever a specific event occurs.
- You can build a rule from scratch or start from a ready-made template.

## Create a rule
1. Go to **Automations** and select **New automation**.
2. Under **When**, pick a trigger — the event that starts the rule.

<!-- docs-screenshots:start -->

![Create an automation](/media/8de8002e-e3b0-46c5-9806-d382566d9974)

<!-- docs-screenshots:end -->

3. Under **If** (optional), select **Add condition** to narrow when the rule runs. All conditions must match for the rule to continue.
4. Under **Then**, select **Add action** to add one or more actions. They run in order, top to bottom.
5. Select **Preview (dry run)** to see what the rule would do against a real example, then select **Save automation**.

> [!TIP]
> Use **Preview (dry run)** before saving — it shows you exactly what would happen without actually running any actions.

## Start from a template
1. Open the **Template library** tab.
2. Select **Browse all templates** to see the ready-made recipes.
3. Select **Use** on a template to start from it.
4. Adjust its trigger, conditions and actions to fit your needs, then select **Save automation**.

## Manage a rule
1. Go to **Automations** and find the rule you want to manage.
2. Use **Turn on** or **Turn off** to pause a rule without deleting it.
3. Select **Edit** to change the trigger, conditions or actions.
4. Set a **Cooldown** so the rule doesn't fire again too soon for the same thing.

> [!NOTE]
> Cooldown applies per item, not per rule. A rule covering fifty domains still handles all fifty — the wait only applies to each domain individually, so one of them being handled never holds up the others.

5. Select **Delete** to remove a rule you no longer need.

## After it runs
1. Open the automation and check its **Runs** tab to confirm it worked and see each step's result.
2. Look for statuses like **Last run failed** or **Auto-disabled after repeated failures** if something went wrong.
3. Runs are also listed in your **Audit Log** for a full history.

## Troubleshooting
- If a rule stops firing, check whether it shows **Switched off after repeated failures** — you may need to fix the underlying issue and turn it back on.
- If actions aren't running as expected, review your **Conditions** — remember all conditions must match, shown as **{n} of {total} matched** in the run details.
