

How a flow runs
Each signer has their own execution proxy: a contract at a deterministic address that holds the tokens while the flow runs. The user’s transaction goes to that proxy, and only the signer can drive it. See Account model. Each step passes its output to the next step onchain. Aswap → deposit flow deposits exactly what the swap produced, so you never compute intermediate amounts yourself.
You describe a flow in one of two ways:
- Composer API. You author a Flow with
@lifi/composer-sdkand choose every step. - LI.FI API. You request a
/v1/quotewhosetoTokenis a vault token, and LI.FI builds the flow for you.
The lifecycle you observe
- Request. Your backend sends a Flow to
POST /compose, or your app sends a quote request to the LI.FI API. - Validation, quoting and simulation. Composer checks the request, quotes every swap, zap and bridge, and simulates the transaction against current chain state. A flow that would revert comes back as a structured error instead of a transaction. Any guards you attach become checks inside the transaction.
- Response. You receive the transactions to submit, in order, and the expected and minimum amount of each output.
- Submission. The user signs and sends those transactions.
- Execution. The flow runs atomically: every step succeeds, or the whole transaction reverts.
- Delivery. Each output lands with its owner: the signer, a recipient, or the execution proxy if the flow does not move it. Cross-chain outputs land later.
Pre-execution simulation
Before Composer returns a transaction, it simulates the flow against the current state of its chain. The simulation overrides the signer’s balances and approvals, so a user who has not approved a token yet does not fail it. It catches the failures that would make the transaction revert onchain:- A swap that would slip past its tolerance.
- A vault that would revert, for example because it is paused, full or blocks the user.
- A pool without enough liquidity for the swap size.
Same-chain and cross-chain flows
The user always signs once. What changes is where the steps run: a flow executes on one chain, where its inputs live and the user’s transaction runs, and what it delivers can land on another chain.How a flow delivers
- Same-chain. Every step runs atomically in the user’s transaction.
- Cross-chain, deliver only. The flow ends in a bridge (
lifi.bridge) or a LI.FI Intents order (lifiIntents.order) to an address on another chain, so there is no destination flow. It’s still one transaction; the output arrives on the destination chain after it confirms. - Cross-chain, then act. The bridge delivers into an escrow. Once the funds land, LI.FI’s settlement service runs the destination flow and pays its gas, so the user needs no second signature and no gas on the destination chain. See Cross-chain flows.
- Same-chain, then act later. A continuation can also keep its escrow on the flow’s own chain. The user’s transaction or a plain transfer from any wallet funds it, and the destination flow runs later on that chain. See Same-chain continuations.
Where to go next
Composer API Quickstart
Author and compile your first flow.
Build a cross-chain flow
Sign on one chain, end up in a position on another.
LI.FI API Quickstart
Add Composer to your existing LI.FI integration.

