> 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

## 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="/files/lGcdgso4Elj997aDck5a" 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="/files/WqTcktAk6IMVTVLLJw0Z" 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).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://manual.formwise.ai/formwise/advanced-features/prompt-engineering/intro-to-prompt-chaining-in-formwise.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
