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

# Flow Schema

> Field-by-field reference for the POST /compose request (Flow and run) and its 200 and 206 responses.

`POST /compose` takes a JSON body with two objects: `flow`, the **Flow** that describes what to execute, and `run`, the per-request values (signer, input amounts, options). Neither accepts unknown keys: an unknown `run` key fails the request schema and an unknown Flow key fails with `decode_error`, both HTTP 400. This page lists the request fields and the 200 and 206 responses. Error bodies are on [Errors](https://docs.li.fi/composer/composer-api/reference/error-codes.md).

The authoritative schema is `FlowSchema` in [`@lifi/compose-spec`](https://app.unpkg.com/@lifi/compose-spec@0.14.0/files/dist/index.d.ts); `GET /compose/manifest` publishes it as JSON Schema under `flowSchema`. When this page conflicts with the schema, the schema wins.

```json theme={"system"}
{
  "flow": { /* Flow */ },
  "run":  { /* Run */ }
}
```

## Top-level: `Flow`

```json theme={"system"}
{
  "version": 1,
  "id": "my-flow",
  "chainId": 1,
  "inputs": [ /* FlowInput[] */ ],
  "nodes":  [ /* Call[] */ ],
  "epilogue": { "remainder": { "$ref": "context.sender" } }
}
```

| Field | Type | Required | Notes |
| - | - | - | - |
| `version` | literal `1` | yes | Reserved for forward compatibility. |
| `id` | `string` | yes | Your flow id. Always send it on the wire; only the SDK's `FlowOptions.name` is optional (it defaults to a random UUID). |
| `chainId` | positive integer | yes | The EVM chain the flow executes on. |
| `inputs` | `FlowInput[]` | yes | May be empty. Input `name` fields are yours to choose. |
| `nodes` | `Call[]` | yes | Ordered. Node `id`s are how other nodes reference a node's outputs. |
| `epilogue` | `Epilogue` | no | Forwards that run after the last node. See [`Epilogue`](#epilogue). |
| `lineage` | `Lineage` | no | Written by the server. Never author it. See [`Lineage`](#lineage). |

## `FlowInput`

A resource input or a handle input.

### `ResourceInput`

```json theme={"system"}
{
  "name": "amountIn",
  "resource": { "kind": "erc20", "token": "0xC02a…Cc2", "chainId": 1 }
}
```

| Field | Type | Notes |
| - | - | - |
| `name` | `string` | Unique within `inputs`. Used as the `input.<name>` ref target. |
| `resource` | `Resource` | `{ kind: "native", chainId }` or `{ kind: "erc20", token, chainId }`. Use the flow's `chainId`: `sdk.flow()` throws on a mismatch. |

A resource input's amount is supplied per request in `run.inputs`. Funds that end up on another chain (a bridge, a cross-chain flow) are expressed by the op that moves them, not by an input on a foreign chain.

### `HandleInput`

```json theme={"system"}
{
  "name": "deadline",
  "type": "uint256"
}
```

| Field | Type | Notes |
| - | - | - |
| `name` | `string` | Unique within `inputs`. |
| `type` | `SolType` | One of `uint8..uint256`, `int128`, `int256`, `address`, `bool`, `bytes`, `bytes4`, `bytes32`, `string`. |

## `Call` (node)

```json theme={"system"}
{
  "id": "zap",
  "op": "lifi.zap",
  "bind": {
    "amountIn": { "$ref": "swap.amountOut" }
  },
  "config": {
    "resourceOut": { "kind": "erc20", "token": "0x98C2…6F5c", "chainId": 1 }
  },
  "guards": [
    { "kind": "slippage", "port": "amountOut", "bps": 100 }
  ]
}
```

| Field | Type | Notes |
| - | - | - |
| `id` | `string` | Unique within the flow. See [Node ids](#node-ids). |
| `op` | `string` | An op name from the manifest, for example `lifi.swap`. An unknown op is a `validation_error`. |
| `bind` | `Record<string, BindValue>` | Maps input port name → ref or literal. Defaults to `{}`. |
| `config` | `Record<string, unknown>` | Op-specific configuration. Defaults to `{}`. Validated against the op's manifest `configSchema`. |
| `guards` | `AppliedGuard[]` | Optional. Each entry `{ kind, ...config }` with the guard's config. |

### Node ids

A node id must satisfy these rules, in the top-level flow and in every embedded `continuationFlow`:

* Not empty and not `"__proto__"`. Both are rejected at decode with `decode_error`.
* Not a reserved ref scope: `input`, `context` or `literal`. Rejected with `validation_error`.
* Unique within its flow. A duplicate is a `validation_error`.

Any other string is a valid id, including `constructor`.

## `BindValue`

`bind` entries are a ref or a literal.

### `Ref`

```json theme={"system"}
{ "$ref": "input.amountIn" }
```

`$ref` is a dotpath. The parser splits it at the **first** dot and reads the part before the dot as the scope. See [References](https://docs.li.fi/composer/composer-api/concepts/ref-grammar.md):

* `input.<name>`: a flow input.
* `context.sender` or `context.executionAddress`: the signer, or the execution proxy. Any other `context.` key is rejected.
* `<nodeId>.<port>`: an output port of an earlier node. There is no `output.` prefix.
* `<nodeId>.<family>.<index>`: one instance of an output family. Because the split is at the first dot, `p.parts.1` addresses port `parts.1` of node `p`. `core.partition` with `config: { bps: [5000, 3000, 2000] }` produces `parts.0`, `parts.1` and `parts.2`. A ref past the last instance is an unresolved ref.

The schema only checks that the string contains a dot after its first character. Any prefix other than `input` or `context` is read as a node id, so a typo such as `inptu.amountIn` becomes an output ref and fails as unresolved. The SDK's `builder.inputs` and `builder.context` handles avoid hand-typed paths.

### `LiteralBinding`

```json theme={"system"}
{ "kind": "uint256", "value": "1000000000000000000" }
```

| Field | Type | Notes |
| - | - | - |
| `kind` | `SolType` | The literal's Solidity type. |
| `value` | `string` | Decimal for integer types; hex (`0x…`) for `bytes*`; plain string for `string`; `"true"`/`"false"` for `bool`. |

## `AppliedGuard`

```json theme={"system"}
{ "kind": "slippage", "port": "amountOut", "bps": 100 }
```

| Field | Type | Notes |
| - | - | - |
| `kind` | `string` | Guard type registered in the manifest: `slippage`, `band` or `core.numericInvariant` today. |
| *(additional)* | any | Guard-specific config. Validated against the guard's manifest `configSchema`. |

## `Resource`

```json theme={"system"}
{ "kind": "native", "chainId": 1 }
{ "kind": "erc20", "token": "0xA0b8…eB48", "chainId": 1 }
```

| Variant | Fields |
| - | - |
| `native` | `kind: "native"`, `chainId` |
| `erc20` | `kind: "erc20"`, `token` (`0x` + 40 hex characters), `chainId` |

Tempo and Arc express their native coin as an ERC-20, and the server rewrites every `native` resource on them to that token when it decodes the Flow:

| Chain | `native` becomes |
| - | - |
| Tempo (4217) | pathUSD, `0x20C0000000000000000000000000000000000000` (6 decimals). Tempo has no `msg.value` coin. |
| Arc (5042), Arc Testnet (5042002) | USDC, `0x3600000000000000000000000000000000000000` (6 decimals), the ERC-20 view of the native balance. |

Write the ERC-20 form on these chains so the Flow you send matches the Flow that runs.

## `SolType`

Literal union of supported Solidity scalar types: `uint8`, `uint16`, `uint32`, `uint64`, `uint128`, `uint256`, `int128`, `int256`, `address`, `bool`, `bytes`, `bytes4`, `bytes32`, `string`.

## `Epilogue`

The epilogue is a list of transfers the execution proxy makes after the last node runs. A **named forward** moves the proxy's whole balance of one resource to one address. The **remainder** moves every other resource the proxy still holds to one address.

```json theme={"system"}
{
  "epilogue": {
    "forwards": [
      { "resource": { "kind": "erc20", "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chainId": 1 },
        "to": "0x1111111111111111111111111111111111111111" }
    ],
    "remainder": { "$ref": "context.sender" }
  }
}
```

| Field | Type | Notes |
| - | - | - |
| `forwards` | `{ resource, to }[]` | Optional, non-empty when present. Each resource may appear once and must be on the flow's chain. Native is `{ "kind": "native", "chainId": … }`, never an `erc20` on the zero address. |
| `remainder` | `ForwardTo` | Optional. Receives every other terminal resource the proxy holds. |

At least one of `forwards` and `remainder` is required. `ForwardTo` is an EVM address or `{ "$ref": "context.sender" }`; the compiler admits no other ref.

`run.sweepTo: X` is shorthand for `epilogue: { remainder: X }`. A request that sets both `run.sweepTo` and `flow.epilogue` fails with a 400 `validation_error` at `run.sweepTo`. The SDK builder does not author `epilogue`; use `run.sweepTo`, or send a hand-built flow through `sdk.client.compile()` for named forwards. See [Sweeping and amounts](https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts.md).

## `Lineage`

```json theme={"system"}
{ "lineage": { "journeyId": "0b6f2a1e-5c1d-4a7e-9a52-3f1f0e8d2c11", "parentRequestId": "7d3e9b40-1a2c-4f5e-8b6a-9c0d1e2f3a4b" } }
```

`lineage` links the parts of one non-atomic flow. The server writes it into every flow it hands back for a later compile, such as a committed destination flow. Post such a flow back unchanged. Never author or edit `lineage`: a flow without it starts a new journey. Both fields are lowercase UUIDs.

## `continuation.settle` node

A `continuation.settle` node, the **settle node**, ends a source flow. The compile registers an escrow, and LI.FI's settlement service later runs the settle node's **destination flow**, the `continuationFlow`, from it. The escrow lives on the destination chain of a bridge or order that funds it, or on the flow's own chain for a same-chain continuation. See [Cross-chain flows](https://docs.li.fi/composer/composer-api/concepts/cross-chain-flows.md) for the model and [`continuation.settle`](https://docs.li.fi/composer/composer-api/ops/continuation-settle) for the op.

```json theme={"system"}
{
  "id": "settle",
  "op": "continuation.settle",
  "bind": { "input": { "$ref": "bridge.amountOut" } },
  "config": {
    "outcomes": [
      { "token": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
        "destination": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        "chainId": 8453 }
    ],
    "validity": { "expiresAtMs": 1793000000000 },
    "refund": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "continuationFlow": {
      "version": 1, "id": "deposit-on-base", "chainId": 8453,
      "inputs": [ { "name": "funding",
                    "resource": { "kind": "erc20", "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "chainId": 8453 } } ],
      "nodes": [
        { "id": "deposit", "op": "lifi.zap",
          "bind": { "amountIn": { "$ref": "input.funding" } },
          "config": { "resourceOut": { "kind": "erc20", "token": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB", "chainId": 8453 } },
          "guards": [ { "kind": "slippage", "port": "amountOut", "bps": 50 } ] }
      ]
    }
  }
}
```

In this example the source flow runs on Arbitrum (42161), and an earlier `bridge` node (`lifi.bridge` with no `destination`) delivers USDC to Base, so the escrow sits on Base. The destination flow deposits that USDC into Aave, and the outcome, aBasUSDC, goes to `destination`.

The funding resource is bound through `bind.input`, never through config. The node has one output port, `output`, which is delivered in the future. There is no top-level continuation field on the Flow.

`config` (`ContinuationIntent`):

| Field | Type | Required | Notes |
| - | - | - | - |
| `outcomes` | `{ token, minAmount?, destination, chainId }[]` | yes | At most one entry. `[]` is allowed only with `exact: true`. `token` is what the destination flow produces; `chainId` must equal the escrow chain; `destination` must not be the zero address. `minAmount` is an optional decimal string; the minimum received never falls below it. |
| `validity` | `{ expiresAtMs }` | yes | Epoch milliseconds, in the future at compile time. The settlement service may shorten it: trust `settlements[id].escrow.expiresAtMs` in the response. |
| `continuationFlow` | `Flow` | yes in practice | The destination flow: a complete embedded Flow with exactly one resource input. The schema marks it optional, but a settle node without it fails the compile with `validation_error`. |
| `provider` | `string` | no | Defaults to `intent-factory`, the only provider. |
| `funding` | `'inline' \| 'external'` | no | Defaults to `'inline'`. Omit it when `bind.input` is a `lifi.bridge` or `lifiIntents.order` `amountOut`. |
| `refund` | address | no | Receives the escrow's balance when it is refunded, and the destination flow's leftovers after a run. Defaults to the signer. Not the zero address. See [`refund`](https://docs.li.fi/composer/composer-api/ops/continuation-settle#config). |
| `exact` | `boolean` | no | `true` binds the escrow to the destination flow's compiled calldata (an exact destination flow). Requires ERC-20 funding. |

The destination flow follows its own rules: it must not reference `context.sender`, must not set an `epilogue`, and must not nest another settle node. The [op reference](https://docs.li.fi/composer/composer-api/ops/continuation-settle.md#destination-flow-rules) lists them, and its [Errors](https://docs.li.fi/composer/composer-api/ops/continuation-settle.md#errors) section lists every violation.

## `run`

```json theme={"system"}
{
  "signer": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "inputs": {
    "amountIn": { "kind": "directDeposit", "amount": "1000000000000000000" }
  },
  "sweepTo": { "$ref": "context.sender" }
}
```

| Field | Type | Required | Notes |
| - | - | - | - |
| `inputs` | `Record<name, string \| MaterialiserInput>` | yes | One entry per declared flow input. A resource input takes a decimal integer amount or a materialiser object `{ kind, ...config }`; a handle input takes its value as a string. |
| `signer` | address | yes | The wallet that signs the execution transaction. |
| `preconditions` | `Precondition[]` | no | On-chain state the simulation assumes: `{ type: "Erc20Balance", wallet, token, balance }`, `{ type: "NativeBalance", wallet, balance }` or `{ type: "Erc20Allowance", owner, spender, token, allowance }`. They are not checked on chain and never appear in `approvals`. |
| `assumptions` | `Record<name, string>` | no | Decimal integer amounts the compiler plans with when a materialiser resolves an input only at execution time. |
| `referrer` | `string` | no | Your referrer tag. |
| `maxPriceImpactBps` | integer 0–10000 | no | Fail with `price_impact_exceeded` above this aggregate USD price impact. |
| `checkOnChainAllowances` | `boolean` | no | Default `false`. When `true`, approvals already satisfied on chain are omitted. |
| `sweepTo` | `ForwardTo` | no | Shorthand for `flow.epilogue.remainder`. An address or exactly `{ "$ref": "context.sender" }`. Mutually exclusive with `flow.epilogue`. |
| `simulationPolicy` | `'strict' \| 'allow-revert'` | no | Default `'strict'`: a revert fails the request with 422. `'allow-revert'` returns 206 with the revert. |
| `simulateUserProgram` | `boolean` | no | Default `false`. When `true`, the final user-facing transaction (including the `deployAndExecute` wrap) is also simulated. A revert follows `simulationPolicy`; a success is echoed as `userProgramSimulation`. |

## 200 response

```json theme={"system"}
{ "success": true, "data": { /* fields below */ } }
```

Amounts are decimal strings on the wire. The SDK decodes `outputs` and `epilogue` amounts to `bigint`.

| Field | Required | Notes |
| - | - | - |
| `outputs` | yes | Every resource output port, keyed `<nodeId>.<port>`, plus every unconsumed resource input, keyed `input.<name>`. See [`outputs`](#outputs). |
| `transactionRequest` | no | `{ to, chainId, data, value, gasLimit? }`: the execution transaction. Only the signer can send it. Absent when the compiled program is empty, for example a flow whose only node is a settle node with `funding: 'external'`. |
| `userProxy` | yes | The signer's execution proxy. |
| `actions` | no | The ordered list of everything to submit: approvals, then `execute`, then one `fundEscrow` per externally funded settle node. See [`actions`](#actions). |
| `approvals` | no | `{ token, spender, amount, transactionRequest: { chainId, to, data, value: "0" } }[]`. The same approvals also appear in `actions`. |
| `epilogue` | no | The epilogue as executed: `{ forwards: [{ resource, to, amount }], remainder? }`. `amount` is the simulated balance each named forward moved. The remainder is not measured. |
| `settlements` | no | One entry per settle node, keyed by node id. See [`settlements`](#settlements). |
| `fill` | yes on `/compose` | `{ spends: [{ input, token, chainId, amount, nodeId? }], validUntilMs? }`. `spends` is what the transaction may spend of each funding input; `nodeId` names the settle node an input funds. Submit before `validUntilMs`; nothing on chain enforces it. Absent on `/compose/route`. |
| `priceImpact` | no | `{ inputValueUsd, outputValueUsd, impactBps, unpricedInputs, unpricedOutputs }`. A positive `impactBps` means the outputs are worth less than the inputs. |
| `verificationByNode` | no | Present when the compile committed a validation program for a settle node: `Record<nodeId, { validationProgramHash, paramsHash, assertedPredicate }>`. |
| `warnings` | no | `{ kind, message, path?, port?, fix? }[]`: advisory findings that did not fail the compile. `kind` is an open set; tolerate unknown kinds. Never an empty array. |
| `userProgramSimulation` | no | `{ status: "ok", returnData }` when `run.simulateUserProgram` was set and the simulation succeeded. |
| `producedHandles` | yes | `Record<"<nodeId>.<port>", { type, value, units? }>` for handle ports the op marks `expose: true`; `{}` when there are none. REST only; the SDK result type does not expose it. |

The response may also carry `producedResources`, a legacy field. Read `outputs` instead.

### `outputs`

Each entry has `resource` and `amount`, and a `role`:

* `{ "role": "consumed", "consumedBy": "<nodeId>" }`: a later node spends it.
* `{ "role": "terminal", "owner": "0x…", "delivery": … }`: nothing spends it. `owner` receives it. `delivery` is `{ "when": "now" }`, or `{ "when": "future", "etaSeconds"?, "provider"?, "trackingId"? }` for an output that lands after the transaction, such as a settle node's `output`.

`amount` is `{ estimate?, minimum? }`. `estimate` is `{ basis: "simulated" | "quoted", value }`, the expected outcome. `minimum` is `{ basis: "guard" | "op" | "input" | "declared", value }`, a floor. For a settle node's `output`, `minimum` is the minimum received, the only amount enforced on chain, and `estimate` is never enforced.

```json theme={"system"}
"outputs": {
  "swap.amountOut": {
    "role": "consumed", "consumedBy": "zap",
    "resource": { "kind": "erc20", "token": "0xA0b8…eB48", "chainId": 1 },
    "amount": { "estimate": { "basis": "quoted", "value": "2510000000" },
                "minimum":  { "basis": "op",     "value": "2434700000" } }
  },
  "zap.amountOut": {
    "role": "terminal", "owner": "0x1111…1111", "delivery": { "when": "now" },
    "resource": { "kind": "erc20", "token": "0x98C2…6F5c", "chainId": 1 },
    "amount": { "estimate": { "basis": "simulated", "value": "2509873412" },
                "minimum":  { "basis": "guard",     "value": "2484774677" } }
  }
}
```

### `actions`

`actions` is the ordered to-do list: approvals, then the execution transaction, then one escrow funding transfer per externally funded settle node. Each action has `kind: "transaction"`, a `purpose`, a `submitter` (`signer`: only the signer may send it; `anyone`: any wallet may) and a `transactionRequest`.

| `purpose` | Submitter | Notes |
| - | - | - |
| `approval` | `signer` | An ERC-20 approval the execution transaction needs. |
| `execute` | `signer` | The execution transaction; the same as top-level `transactionRequest`. |
| `fundEscrow` | `anyone` | The transfer that funds an externally funded escrow. Carries `nodeId`, the settle node. The escrow credits by balance, so any wallet may send it. Its `chainId` is the funding token's chain. |

Submit the actions in order, each on its `transactionRequest.chainId`.

### `settlements`

`Record<settleNodeId, { escrow?, binding? }>`. It describes the escrow behind each settle node and contains nothing to sign or submit. `(escrow.chainId, escrow.address)` identifies the escrow: track it with [Escrow status](https://docs.li.fi/composer/composer-api/reference/escrow-status.md). Every compile registers a fresh escrow; never reuse one.

| `escrow` field | Type | Notes |
| - | - | - |
| `chainId` | `number` | The escrow's chain. For bridge or order funding, the bridge's or order's destination chain; for external or inline funding, the flow's own chain. |
| `address` | `string` | The escrow, fresh for every compile. |
| `token` | `string` | The funding token; the zero address means native. |
| `amount` | `string` | The expected funding: the declared input amount, or the expected output of the upstream node. |
| `cap` | `string` | The most a run may spend from the escrow; see [How much a run spends](https://docs.li.fi/composer/composer-api/ops/continuation-settle.md#how-much-a-run-spends). |
| `floor` | `string` | The minimum funding. A balance at or above it starts a run; a smaller balance never does, and is refunded after expiry. |
| `owner` | `string` | The signer. Controls the escrow. |
| `refund` | `string` | Receives the escrow's funding-token balance when it is refunded. |
| `expiresAtMs` | `number` | The stored expiry. Trust it over the authored `validity.expiresAtMs`. |

`binding` is present only for exact destination flows. It discloses what the escrow will run:

| `binding` field | Notes |
| - | - |
| `executionTarget` | LI.FI's executor: the only account the escrow lets run the destination flow. |
| `calldata` | The destination flow's compiled program. Decode it to read what the run does. |
| `approvals` | `{ token, spender }[]`: allowances the executor grants before the call. |
| `payload` | The executor call that wraps `approvals` and `calldata`. |
| `payloadHash` | `keccak256(payload)`: the value the escrow's constraint holds. |

A settle node also shapes these fields:

* **`outputs['<settle id>.output']`.** `owner` is the outcome's `destination`, and `delivery.when` is `'future'`. `amount.minimum` is the minimum received, the only amount enforced on chain. `amount.estimate` (`basis: 'quoted'`) is the expected outcome: what the destination flow delivered at the minimum funding, scaled up to the expected funding by at most 100 bps. Nothing enforces it. A zero-outcome exact destination flow has no such entry.
* **`outputs['<producer id>.amountOut']`.** For bridge or order funding, `role: 'consumed'` with `consumedBy` set to the settle node: the funds go into the escrow, not to the user.
* **`actions`.** Each `fundEscrow` carries the settle `nodeId` and `submitter: 'anyone'`.
* **`fill.validUntilMs`.** Submit the user's transaction before this time, or the funds can land in an expired escrow. It is never later than the escrow's expiry. Nothing on chain enforces it.

## 206 response

With `run.simulationPolicy: "allow-revert"`, a simulation revert returns HTTP 206 instead of a 422 `simulation_revert`. The same applies when the `run.simulateUserProgram` simulation reverts.

```json theme={"system"}
{ "success": false, "error": { "kind": "simulation_revert", "message": "…" }, "data": { /* fields below */ } }
```

`data` carries `outputs`, `transactionRequest` (always present), `userProxy`, `simulationRevert: { code, rawErrorBytes, decodeResult? }`, `producedHandles` (always `{}`; REST only, the SDK result type does not expose it), and optionally `approvals`, `actions`, `settlements`, `warnings` and the legacy `producedResources`. It has no `epilogue`, `fill`, `priceImpact`, `verificationByNode` or `userProgramSimulation`.

What `outputs` holds depends on which simulation reverted. When the main simulation reverts, nothing was measured: estimates are `quoted` or absent, and minimums are `op`, `input`, `declared` or absent. When the main simulation succeeds and only the `run.simulateUserProgram` simulation reverts, `outputs` keeps the simulated amounts.

> [!WARNING]
>
> A 206 can carry a registered escrow in `settlements` and a `fundEscrow` action. Never fund an escrow from a partial result: the balance stays locked until expiry, then returns to `refund`. Fix the revert and recompile.

## Complete request

A same-chain swap of 1 WETH to USDC, then a deposit into Aave v3, with leftovers returned to the signer:

```json theme={"system"}
{
  "flow": {
    "version": 1,
    "id": "swap-and-zap-weth-to-aave",
    "chainId": 1,
    "inputs": [
      { "name": "amountIn",
        "resource": { "kind": "erc20", "token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "chainId": 1 } }
    ],
    "nodes": [
      { "id": "swap", "op": "lifi.swap",
        "bind": { "amountIn": { "$ref": "input.amountIn" } },
        "config": { "resourceOut": { "kind": "erc20", "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chainId": 1 },
                    "slippage": 0.03 } },
      { "id": "zap", "op": "lifi.zap",
        "bind": { "amountIn": { "$ref": "swap.amountOut" } },
        "config": { "resourceOut": { "kind": "erc20", "token": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c", "chainId": 1 } },
        "guards": [ { "kind": "slippage", "port": "amountOut", "bps": 100 } ] }
    ]
  },
  "run": {
    "signer": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "inputs": { "amountIn": { "kind": "directDeposit", "amount": "1000000000000000000" } },
    "sweepTo": { "$ref": "context.sender" }
  }
}
```

## See also

* [Flow Structure](https://docs.li.fi/composer/composer-api/concepts/flow-anatomy.md) — prose walkthrough of the same fields.
* [References](https://docs.li.fi/composer/composer-api/concepts/ref-grammar.md) — `$ref` parsing rules.
* [Cross-chain flows](https://docs.li.fi/composer/composer-api/concepts/cross-chain-flows.md) — what the settle node, the escrow and the destination flow do.
* [SDK reference](https://docs.li.fi/composer/composer-api/reference/sdk-api.md) — the TypeScript surface that produces this JSON.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.