The flow file format (YAML / JSON)
Everything on a flow’s canvas is also a plain text file. View file shows the flow as YAML or JSON, you can edit it there and watch the canvas follow, and the same shape is what a connected Git repository stores as .flow.yaml. The file holds only meaning — steps, links and settings — never positions: the canvas lays itself out from the structure.
- Open, read and edit a flow as YAML or JSON
- Know the keys: format, trigger, each step’s name and onError
- Write an input as an expression, and each structural node
- Copy a flow between flows, and keep it in Git
A flow is a file
Open the flow’s Configuration menu (the gear in the top bar) and pick View file (“Read this flow as YAML”). A drawer opens with the whole definition and a YAML / JSON switch. Changes on the canvas show up in the file at once; edits in the file reach the canvas about half a second after you stop typing, as long as the text parses — otherwise the drawer says YAML parse error and the canvas keeps the last good version. Edits are unsaved until you click Save, exactly like edits on the canvas.
Branch pills, end caps, the join under parallel branches and the shaded loop body are not in the file either. They are derived from the structure each time the canvas is drawn, which is why a file written by hand — or by an AI assistant, or pulled from Git — renders as neatly as one built by dragging.
A complete example
A flow that loads orders over a minimum total, scores each one in a parallel loop, reports when there were any, and has an On error step — exactly as View file writes it:
format: 2
trigger:
parameters:
- name: min_total
type: number
default: 100
next: load_orders
load_orders:
kind: script
label: Load orders
lang: postgresql
code: |
-- @param min_total number = 100
SELECT id, email, total FROM orders WHERE total >= :min_total
integration: 9b1c6e2a-5d1f-4c1e-9a7e-2f0c3b8d4e61
inputs:
min_total: nodes.flow_inputs.min_total
next: each_order
each_order:
kind: loop
label: Each order
iterate: nodes.load_orders.output.rows
mode: parallel
concurrency: 5
body:
- score
next: any_orders
score:
kind: script
label: Score
lang: python
code: |
def main(total: float):
return {"vip": total > 500}
inputs:
total: nodes.each_order.item.total
retry:
attempts: 2
delay: exponential
delaySec: 2
any_orders:
kind: condition
label: Any orders?
if: nodes.load_orders.output.rowCount > 0
then:
label: "Yes"
nodes:
- report
else:
label: "No"
nodes: []
report:
kind: script
label: Report
lang: typescript
code: |
export async function main() {
return { ok: true }
}
onError:
kind: script
label: Notify
lang: python
code: |
def main(message: str = "", step: str = ""):
print(f"{step} failed: {message}")
inputs:
message: error.message
step: error.stepNameformat: 2is always written. A file with noformatis an older one (see below).triggeris always the Flow inputs node; itsparametersare the flow’s inputs, read asnodes.flow_inputs.<param>, andnextnames the first step.- Every other step’s key is its name, the same
snake_casename expressions use:load_ordersis read asnodes.load_orders.output. It stays the same when other steps move, and changes only when the step is renamed. onError(andpreprocessor) are top-level entries with nonext— they are not on the chain.
Node kinds and their fields
| kind | Fields |
|---|---|
script | lang (python, typescript, javascript, c, cpp, postgresql, mysql), code for an inline step or script (its path) for a linked one, integration and rowLimit for SQL, dependencies for inline Python. |
condition | if, then: {label, nodes}, optional elseIfs: [{id, label, if, nodes}], else: {label, nodes}. nodes lists every step inside that branch. |
loop | iterate (an expression that gives a list), mode: parallel + concurrency or mode: while + maxIterations, breakIf, body (every step inside). |
parallel | branches: [{id, name, mayFail?, nodes}], optional sequential: true. |
flow | flowRef (the child’s id — the real reference) and flowName (a readable hint, never read back). |
aiScraper | scraper (id), scraperName (hint), optional timeoutMs. |
email | provider (absent = the project’s default), template, or html for the step’s own message when there is no template; recipients and values are inputs (to + one per template value). |
http, transform, ai, file, googleSheets, googleDrive | The built-in steps: integration (the connection’s id) and the step’s own fields under the names its form stores — for HTTP Request method, url, query, headers, body, parse, failOnError, paginate; for Transform mode plus that mode’s settings. Their values are inputs. |
message | format and destination (an id or a code name, of the same service); each field of the format is an input. |
approval | fields, approvers, timeoutSec, onTimeout, notify, allowLinks; the message is inputs.message. Defaults are omitted. |
fan_out:
kind: parallel
label: Fan out
branches:
- id: b1x9k2
name: Send e-mail
nodes: [send_email]
- id: b7qq01
name: Notify team
mayFail: true
nodes: [notify_team]
next: enrich_customer
enrich_customer:
kind: flow
label: Enrich customer
flowRef: 5f0e8a3c-2b7d-4e19-8c55-1a2b3c4d5e6f
flowName: Enrich customer
inputs:
customerId: nodes.fetch_customer.output.id
retries: 3
status: '"active"'
apiKey: vars.CRM_API_KEY
next: saveAny executable step can also carry its run settings under the same names as on the step — retry: {attempts, delay, delaySec, onlyIf}, continueOnError, skipIf, stopIf: {expr, status}, sleepAfterSec or sleepUntil, cacheTtlSec, timeoutMs — and a short note. Anything off is simply absent, so a flow without settings has none of these keys.
Inputs
Every value under inputs is the text of one expression, the same text the step’s field shows on screen. A number or a boolean written in YAML is the same JavaScript literal. Text has to carry its JavaScript quotes inside the YAML, which is why a fixed text looks doubly quoted.
| In the file | Means |
|---|---|
nodes.load_orders.output.rows[0].total | A value from step load_orders’s output. |
nodes.each_order.item.total | A field of the current item, inside that loop’s body. |
3, true | A number and a boolean. |
'"active"' | The text active. |
vars.NAME | A project or global variable, read when the step runs. |
'`Hello ${nodes.flow_inputs.name}`' | A template that mixes text and values. |
Reading a file checks it with the same rules as the editor and publishing, so a wrong expression is reported with its step and field instead of being saved.
Copy, export and keep in Git
- Export
Open View file, choose YAML or JSON and copy the text. That text is the whole flow; keep it, share it, review it in a pull request.
- Import into another flow
Create an empty flow, open its View file, replace the text with the copy and click Save. Steps get fresh ids; linked scripts, connections and child flows are referenced by id, so they must exist in the target project.
- Keep it in Git
With the project connected to a repository (Git), every flow is a
<folder>/<name>.flow.yamlfile in the same shape. A commit writes the flow; a pull lands the file as the flow’s draft — never published — so you review and publish it yourself.
Git files are validated when they are read: an unknown key or kind, a missing if or iterate, a wrong expression, or a step no path reaches is reported instead of guessed.
Older files and connected repositories
A file with no format was written in the earlier input format. Pulling it from a connected repository converts it on the way in, with the same conversion existing flows went through, and then validates it. The first commit after that shows every flow file as changed, once: the same flows, now in format 2. Nothing else is needed, and the flows behave as before, with two details you may notice: in a text that mixes values, null now prints the word null and an object prints [object Object]; and a field missing at the end of a path gives null.
What the file does not hold
- No positions, no colours, no zoom: layout is always derived.
- No version pin on a
floworaiScraperstep: callers always run the callee’s latest published version. - Not the flow’s own settings — its time limit, concurrency limit, triggers and state live outside the definition.