---
title: "Sequences: conditional multi-step jobs"
description: "Run a snippet, check its output, and react: raise or clear an alert, or run another snippet."
url: "https://mikrowizard.com/docs/sequences/"
updated: "2026-11-25"
category: "Automation & Configuration"
---

# Sequences: conditional multi-step jobs

Pro

## What it is

A sequence runs a snippet, reads the output, and reacts: raise or clear an alert, or run another snippet. It turns routine checks into automatic monitoring and fixes.

**Example uses**

- Alert when a router's NTP is not synchronised.
- If an interface is disabled, run a snippet that re-enables it and alert the NOC.

Pro **Included in MikroWizard Pro.** Automate checks and follow-up actions without writing scripts.

[Compare Free and Pro](https://mikrowizard.com/docs/free-vs-pro/) · [Pricing](https://mikrowizard.com/pricing/)

A sequence starts with a **source snippet**. MikroWizard checks the output with conditions and runs actions on match. Use it for checks that RouterOS or other devices don't alert on by themselves.

[![Sequence condition flowchart](https://mikrowizard.com/wp-content/uploads/2026/11/SCR-0159-sequence-flowchart.webp)](https://mikrowizard.com/wp-content/uploads/2026/11/SCR-0159-sequence-flowchart.webp)
A condition with two actions and a nested condition.

## Create a sequence

1. Go to **Sequences** and click **Create Sequence**.
2. Enter a **Sequence Name** and select the **Source Snippet (Entry Point)**.
3. Options: **Sequence Active**, **Store Execution History**, **Store Entry Output in Backups**.
4. Click **Add Root Condition** and choose:
   - **Contains Content** or **Does Not Contain**, with the text to look for. Tick **Regex** to use a regular expression.
5. Under the condition, click **Add Action**:
   - **Trigger Alert** or **Clear Alert** with an alert definition.
   - **Execute Another Snippet** (optionally storing its output in Backups). Its output can be checked by a nested condition.
6. Save.

## Alerts

**Manage Alerts** defines alert names with a severity: Warning, Error or Critical. A triggered alert becomes an open [device event](https://mikrowizard.com/docs/device-events/); **Clear Alert** fixes it. Like all events, it shows on the [Monitoring Wall](https://mikrowizard.com/docs/monitoring-wall/) and the map, and is sent by matching [alert rules](https://mikrowizard.com/docs/alerts-notifications/).

## Run it

- Now: the run button, then choose devices or groups and **Execute**.
- On a schedule: a [Task Planer](https://mikrowizard.com/docs/task-planner/) task of type **Alert Sequence**.

The history button shows each run per device, with a trace of which conditions matched. Failed runs are kept for 90 days.

## Example: NTP not synchronised

1. Snippet *ntp-status*: `/system ntp client print`.
2. Sequence: source *ntp-status*, condition **Does Not Contain** `synchronized`.
3. Action **Trigger Alert** *NTP not synced* (Warning).
4. Second condition **Contains Content** `synchronized`, action **Clear Alert** *NTP not synced*.
5. Task Planer: **Alert Sequence**, every hour, group *All routers*.

## Example: re-enable a disabled uplink

Source snippet `/interface print where name=ether1`. Condition **Contains Content** with **Regex** `d+s+X` (the X flag means disabled), actions **Execute Another Snippet** `/interface enable ether1` and **Trigger Alert** *Uplink was disabled*.

## Common problems

| Problem | Cause and fix |
| --- | --- |
| A condition never matches | Look at the real output in the run history; RouterOS output differs between versions. Use **Regex** for flexible matching. |
| The alert never clears | Add a condition with **Clear Alert** for the good case. |
