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

# String Interpolation

> Insert workflow values into agent instructions.

Use `{{ ... }}` inside strings to render values. Only double braces trigger interpolation; single braces are treated as literal text.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
agent summarize {
    model: model.fast
    instruction: "Summarize task {{ input.task_id }} in project {{ input.project_id }}."

    output {
        summary: string
    }
}
```

References inside interpolation are validated the same way as references elsewhere.

## Single braces are literal

Single `{ ... }` characters are passed through as-is. This makes it easy to embed JSON or other brace-heavy content in strings without escaping:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
agent format_json {
    model: model.fast
    instruction: """Return valid JSON: {"name": "{{ input.name }}", "status": "ok"}"""

    output {
        result: string
    }
}
```

In the example above, `{` and `}` around the JSON are literal text, while `{{ input.name }}` is interpolated.

## Multiline strings

Use triple quotes for multiline instructions while still using interpolation:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
agent summarize {
    model: model.fast
    instruction: """
        You are helping with task {{ input.task_id }}.
        Focus on project {{ input.project_id }}.
        Return a concise summary.
    """

    output {
        summary: string
    }
}
```

## Interpolating agent outputs

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
agent writer {
    model: model.fast
    instruction: "Write a response using this summary: {{ agent.summarize.summary }}"

    output {
        response: string
    }
}
```

Prefer focused instructions that reference structured values rather than copying large payloads into one string.
