> For the complete documentation index, see [llms.txt](https://archer-bot.gitbook.io/archer.bot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://archer-bot.gitbook.io/archer.bot/intents/multi-step-intents.md).

# Multi-Step Intents

Sometimes one operation isn't enough. You want to swap, then bridge. Or check a price, then act on it. Or move from a connected wallet to your embedded wallet, then swap.

Multi-step intents let you describe the whole flow in one prompt. Archer plans the sequence, executes each step in order, and waits for your confirmation between every transaction.

## Sample Input Queries

* *"Swap 100 USDC to ETH on Arbitrum, then bridge that ETH to Base"*
* *"Check the price of SOL, then swap $20 worth on Solana"*
* *"Send my connected wallet's USDC to my Archer wallet on Base, then swap it for ETH"*
* *"Bridge 50 USDC from Polygon to Solana, then swap it for BONK"*

## How It Works

1. **Plan.** Archer parses the prompt into discrete steps. Each step is an independent intent (swap, bridge, send, price check, etc.).
2. **Execute step 1.** The first transaction goes through the normal Confirm/Cancel modal. You approve, sign, and Archer waits for on-chain confirmation.
3. **Resolve dependencies.** If step 2 depends on the output of step 1 (e.g., "bridge *that* ETH"), Archer reads the actual confirmed amount from step 1 and uses it as the input for step 2.
4. **Execute step 2.** Same Confirm/Cancel flow. You approve again. Each step requires its own signature.
5. **Continue** until every step is done or you reject one.

Each step produces its own confirmation modal. You approve or reject each one independently — there is no "approve all" shortcut. This is intentional: multi-step flows touch more value, and each transaction deserves its own review.

## What Happens If a Step Fails

If any step fails (insufficient gas, quote expired, transaction reverted), the multi-step plan halts at that point. Archer reports what succeeded, what failed, and why. You can:

* Retry the failed step
* Modify and continue (e.g., "try the bridge with higher slippage")
* Abandon the rest

Archer never silently skips a step or rolls back a successful earlier transaction — each step's outcome is final once it confirms on-chain.

## Cross-Chain Multi-Step

The most powerful multi-step pattern is cross-chain composition:

* *"Swap 0.1 ETH on Base for USDC, bridge to Solana, then swap to BONK"*

This is three steps across two chains. Archer reads the actual output amount of each step before quoting the next, so slippage and fees from earlier steps are accounted for in later ones.

## Limits

* **Max steps per prompt:** practical limit is around 5–7 steps. Beyond that, the plan becomes hard to reason about and one early failure cascades through everything.
* **Server signing applies per step.** If you've enabled server signing, each step still signs in the TEE — the loop just doesn't wait for a manual click.
* **MCP/headless support:** the agent loop returns one transaction at a time. Calling agents drive the loop themselves by invoking `prepare_*` tools sequentially.


---

# 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://archer-bot.gitbook.io/archer.bot/intents/multi-step-intents.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.
