compose.flow in a POST /compose request. This page is a reference for the wire format the service accepts. The authoritative schema ships with @lifi/composer-sdk; when a detail here conflicts with the SDK, the SDK wins — file an issue.
Top-level: Flow
| Field | Type | Required | Notes |
|---|---|---|---|
version | literal 1 | yes | Reserved for forward compatibility. |
id | string | yes | User-defined flow id. SDK generates a UUID when omitted. |
chainId | positive integer | yes | The EVM chain every node targets. |
inputs | FlowInput[] | yes | May be empty. Input name fields are user-defined. |
nodes | Call[] | yes | Ordered. Node id fields are user-defined and are how other nodes reference this one’s outputs. |
FlowInput
A union of resource inputs and handle inputs. Schema: FlowInputSchema = Union(ResourceInputSchema, HandleInputSchema).
ResourceInput
| 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 }. chainId must equal the flow’s chainId. |
ResourceInputSchema, ResourceSchema.
HandleInput
| Field | Type | Notes |
|---|---|---|
name | string | Unique within inputs. |
type | SolType | One of uint8..uint256, int128, int256, address, bool, bytes, bytes4, bytes32, string. |
HandleInputSchema, SolTypeSchema.
Call (node)
| Field | Type | Notes |
|---|---|---|
id | string | Unique within the flow. Cannot match a reserved ref scope (input, context, literal). |
op | string | Registered op name in the manifest. |
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. |
CallSchema, AppliedGuardSchema.
BindValue
bind entries are one of two shapes. Schema: BindValueSchema = Union(RefSchema, LiteralBindingSchema).
Ref
$ref is a dotpath with exactly one of three shapes — see References:
input.<name>context.<sender|executionAddress><nodeId>.<port>
RefSchema.
LiteralBinding
| 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. |
LiteralBindingSchema.
AppliedGuard
| Field | Type | Notes |
|---|---|---|
kind | string | Guard type registered in the manifest. |
| (additional) | any | Guard-specific config. Validated against the guard’s manifest configSchema. |
AppliedGuardSchema.
Resource
| Variant | Fields |
|---|---|
native | kind: "native", chainId |
erc20 | kind: "erc20", token (address), chainId |
ResourceSchema.
SolType
Literal union of supported Solidity scalar types: uint8, uint16, uint32, uint64, uint128, uint256, int128, int256, address, bool, bytes, bytes4, bytes32, string.
Schema: SolTypeSchema.
Worked example
Theswap-and-zap quickstart produces a Flow that, after builder.build(), serialises to:
See also
- Flow Structure — prose walkthrough of the same fields.
- References —
$refparsing rules. @lifi/compose-spec— SDK types that match this wire format.

