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

# Step Types & Templates

> Reference for the three step types and the template variables available in workflow steps.

Every step in a workflow has a **type** that controls how MIRA processes it, and **instructions** that are plain-language prompts enhanced with template variables.

## Step types

<Tabs>
  <Tab title="prompt">
    ### prompt

    A `prompt` step sends the step's instructions (plus resolved template variables) to the active reasoning engine and waits for a response.

    Use `prompt` steps to:

    * Ask the engine to research, analyse, summarise, or rewrite
    * Chain reasoning across multiple passes with `{{prev_output}}`
    * Include document context with `{{document}}`

    **Example instruction:**

    ```
    Based on the following research: {{prev_output}}

    Write a concise 3-paragraph executive summary suitable for a non-technical audience.
    Highlight the three most important findings.
    ```
  </Tab>

  <Tab title="transform">
    ### transform

    A `transform` step uses the engine to reformat, restructure, or convert the previous output without performing new reasoning.

    Use `transform` steps to:

    * Convert prose to bullet points
    * Format output as a table, JSON, or Markdown
    * Apply a consistent template to the previous result

    **Example instruction:**

    ```
    Take the analysis below and format it as a Markdown table with three columns:
    | Finding | Severity | Recommendation |

    Analysis:
    {{prev_output}}
    ```
  </Tab>

  <Tab title="condition">
    ### condition

    A `condition` step sends a yes/no question to the engine based on `{{prev_output}}` and routes the next step based on the answer. Set `conditionExpr` to the question to evaluate.

    Use `condition` steps to:

    * Branch the pipeline based on document type or content
    * Gate analysis steps on whether a prior step produced useful output
    * Classify input before choosing how to process it

    **Example instruction:**

    ```
    Given this document summary:
    {{prev_output}}

    Answer with only YES or NO: Is this document primarily technical or scientific in nature?
    ```

    The step evaluates the engine's response and passes the result through `onSuccess` / `onFailure` routing rules on subsequent steps.
  </Tab>

  <Tab title="human_review">
    ### human\_review

    A `human_review` step pauses the workflow and shows the previous step's output in the chat panel. The pipeline resumes only after you click **Approve** or **Regenerate**.

    * **Approve** — continues to the next step with the current output
    * **Regenerate** — re-runs the previous `prompt` step and presents a new result

    Use `human_review` steps to:

    * Gate high-stakes outputs before delivery
    * Insert a quality check mid-pipeline
    * Collect feedback before a final transform

    `human_review` steps do not have instruction fields — they act purely as a pause gate.
  </Tab>
</Tabs>

***

## Template variables

| Variable          | Resolves to                                                               |
| ----------------- | ------------------------------------------------------------------------- |
| `{{input}}`       | The initial text typed in the prompt box when the workflow was started.   |
| `{{prev_output}}` | The full text output of the immediately preceding step.                   |
| `{{document}}`    | The concatenated content of all documents enabled in the current session. |

<Warning>
  If `{{ document }}` is used in a step but no documents are uploaded and enabled, the variable
  resolves to an empty string. Add a `human_review` step before document-dependent steps to catch
  this condition.
</Warning>

### Combining variables

Variables can be combined freely in a single instruction:

```
You are reviewing a contract.

USER REQUEST: {{input}}

CONTRACT TEXT:
{{document}}

PRIOR ANALYSIS:
{{prev_output}}

Identify any clauses that conflict with the user's request.
```

<Note>
  Edit this page — [Open a pull
  request](https://github.com/satyendra2013/mira-app/edit/main/docs/features/workflows/step-types-and-templates.mdx)
</Note>
