# Templates

Canonical URL: https://developers.iagenify.com/sdk/workflows/templates/
Language: en

Two things a step can read: the run's input, and an upstream step's output. Both are checked when the workflow is saved.

Status: {{input.x}} · {{steps.id.output.path}} · upstream only

```javascript
{ id: "write", type: "model.generate", config: {
    model: "gemini-3.5-flash",
    prompt: "Summarise these posts since {{input.since}}:\n{{steps.read.output.result}}",
} }
```

## The two sources {#two}

| Written | Reads |
| --- | --- |
| `{{input.since}}` | The `input` the run was started with. |
| `{{steps.read.output.result}}` | That step's `output`, at that path. |

The path goes as deep as the output does: `{{steps.classify.output.usage.credits}}` reads a nested field.

## Upstream only, and it is checked {#upstream}

> **A reference to a step that is not upstream is refused on save**
>
> Reading a step that runs later would always produce nothing. Catching it at save time is the difference between a message you read and an empty string you discover in a log.

« Upstream » means along the graph: on a branch not taken, a step's output never exists, so a reference across branches is a reference to nothing.

## Knowing what a step outputs {#what-outputs}

Each step type's page says what its `output` holds. [runStep()](/sdk/ref/workflow/run-step) is the quickest way to see it for real before writing the template that reads it.

## Not every pair of braces is a template {#literal}

Instructions copied into a step — a skill's text, a prompt that discusses templating — are carried as they are. A workflow's own templates are the ones in the configuration it validates.

## In a loop {#loops}

`config.over` on a [loop](/sdk/workflows/steps/loop) is itself a template naming a list, and the repeated step reads each item from the loop.

- [runStep()](/sdk/ref/workflow/run-step): Seeing a real output.
- [Errors](/sdk/workflows/errors): The refusals.

```python
{"id": "write", "type": "model.generate", "config": {
    "model": "gemini-3.5-flash",
    "prompt": "Summarise these posts since {{input.since}}:\n{{steps.read.output.result}}",
}}
```
