Skip to main content
By default, each workflow step runs in sequence and passes its output to the next step. Routing rules let you alter that flow based on the engine’s output or a fixed condition.

Rule structure

Each routing rule has three fields:
FieldDescription
ActionWhat to do: continue, retry:N, or skip
TriggerWhen to apply the action: auto or a keyword/phrase to match in the step’s output
ConditionOptional: contains, does_not_contain, always

Actions

continue

Move to the next step immediately. This is the default behaviour — adding an explicit continue rule lets you attach a trigger condition to it.Example: Continue only if the output contains “APPROVED”:
Action:    continue
Trigger:   APPROVED
Condition: contains

Auto trigger

Set Trigger to auto to apply the action unconditionally at the end of the step.
Action:    continue
Trigger:   auto
This is equivalent to the default step behaviour.

Multiple rules

A step can have multiple routing rules. MIRA evaluates them top-to-bottom and applies the first rule whose condition is satisfied. If no rule matches, the default continue behaviour applies.
Routing rules operate on the raw text output of a step. If your step produces structured output (JSON, Markdown tables), use a substring from that structure as your trigger keyword.

Example: Quality gate with retry

This configuration retries the “Summarise” step up to two times if the output is shorter than expected:
Step: Summarise findings
Instructions: Summarise the research into exactly 5 bullet points. {{prev_output}}

Routing rules:
  1. Action: retry:2  |  Trigger: "- "  |  Condition: does_not_contain
  2. Action: continue |  Trigger: auto
Edit this page — Open a pull request