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:
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”:retry:N
Re-run the current step up to N times. Useful for quality gates where the engine should keep trying until a condition is met.N can be 1–5. If the step has not satisfied the trigger after N retries, the workflow continues anyway.Example: Retry up to 3 times if the output does not contain a Markdown table:skip
Skip the next step and jump to the step after it. Useful for optional enrichment steps that should only run when the upstream output meets a condition.Example: Skip the “Risk Flags” step if the document does not contain the word “liability”:
Auto trigger
Set Trigger to auto to apply the action unconditionally at the end of the step.
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: