> For the complete documentation index, see [llms.txt](https://manual.formwise.ai/formwise/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.formwise.ai/formwise/advanced-features/prompt-engineering/intro-to-prompt-chaining-in-formwise.md).

# Intro To Prompt Chaining in FormWise

Build multi-step SmartForms by passing outputs between prompt steps.

## Overview

Prompt chaining lets you build **multi-step SmartForms**. Each step runs its own AI generation. Later steps can reuse earlier outputs (for example, “generate an avatar” → “write emails for that avatar”).

Use prompt chaining when you need:

* A workflow with **clear stages** (draft → refine → format)
* **Higher output consistency** (each step has a narrow job)
* Background reasoning steps that users don’t need to see

{% hint style="warning" %}
Each prompt chain step is a separate AI call. More steps increases token usage and timeout risk.
{% endhint %}

### Prerequisites

* A **SmartForm** (prompt chaining is not available on Toolsets).
* At least **two prompt chain steps** (to pass output forward).

### Build your first prompt chain

{% stepper %}
{% step %}

### Create a SmartForm

Create a new SmartForm in FormWise.

<figure><img src="https://728196400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Lugni2T5TewiPeYs1ka%2Fuploads%2FD2MPGK8FFwSE0mYoh8vf%2Fimage.png?alt=media&amp;token=26081a6a-fa2e-4610-be71-06d812987e76" alt="Create a new SmartForm"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add a “Prompt Chain” step

Inside your SmartForm, add a new step and choose **Prompt Chain**.

<figure><img src="https://728196400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Lugni2T5TewiPeYs1ka%2Fuploads%2FSACApLDuILZdhH1YovFj%2Fimage.png?alt=media&amp;token=18136b59-274b-4da5-a7f4-731944e59972" alt="Select Prompt Chain"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add at least one more step

Create Step 2 (and Step 3, Step 4, etc.). Each step can build on earlier outputs.
{% endstep %}
{% endstepper %}

### Map output between steps (`@step_x`)

In any step after Step 1, press `@` in the prompt editor. You’ll see earlier outputs like `@step_1`.

#### Always add context before a mapped step

Bad (unclear):

* ❌ “Use `@step_1` to generate the email copy.”

Good (explicit):

```
Using the customer avatar below, write a targeted email that addresses their pain points.

Customer Avatar:
@step_1
```

{% hint style="info" %}
Treat `@step_1` like a variable. Name it in plain English first.
{% endhint %}

### Customize each step

Each prompt chain step is its own “module.” You can tune it independently:

* **Instructions**: keep them narrow and unambiguous.
* **AI engine**: choose a stronger model for complex steps.
* **Datasets**: add datasets when you need stable, domain-specific facts.

### Show or hide steps from end users

Use the **eye icon** on each step:

* **Visible**: the user sees the step run and its output.
* **Hidden**: the step runs in the background. The user only sees what you expose later.

Hidden steps are useful for “prep work” like extraction, cleanup, or summarization.

### Common issues

* **You don’t see `@step_1` in the menu**: you’re editing Step 1, or you only have one step.
* **Outputs get cut off**: reduce output length, switch to a larger-context model, or split into more focused steps.

### Next steps

* Go deeper on strategy, tokens, and structure in the [Advanced Prompt Chaining Guide](/formwise/advanced-features/prompt-engineering/advanced-prompt-chaining-guide.md).
* Use the broader prompt checklist in [Prompt Engineering](/formwise/advanced-features/prompt-engineering.md).
