Your first flow
This walkthrough builds the most common flow shape, a linear chain with a failure branch. You build it twice. The first time you build it on the Flow Studio canvas. The second time you write it as Flow DSL text that you can run headlessly with the CLI.
The flow
Section titled “The flow”Install dependencies, build the project, and run the tests. If the tests fail, have a local model triage the output:
flow "first-flow" v1
deps[action: "Install"] { adapter: "shell" actionId: "pnpm" args: "install"}
build[action: "Build"] { adapter: "shell" actionId: "pnpm" args: "build"}
test[action: "Test"] { adapter: "shell" actionId: "cargo" args: "test --workspace"}
triage[ai: "Triage failure"] { modelId: "local-llm" input: "The test suite failed. Summarise the root cause in two sentences."}
deps --> buildbuild --> testtest.fail --> triageThis flow has four nodes and three edges. The test.fail edge only fires when
the test step fails. On a green run, triage never executes and the local
model never loads.
On the canvas
Section titled “On the canvas”-
Open Flow Studio and create a new flow tab.
-
Drag two Shell action nodes from the Library panel onto the canvas. In the inspector, set the first to action
pnpmwith argsinstall, the second topnpmwith argsbuild. -
Add a third Shell node with action
cargoand argstest --workspace. -
Connect the nodes. Drag from each node’s output port to the next node’s input. A plain connection routes on
always. Drag from the green diamond forpassor the red diamond forfail. -
Drag an AI node onto the canvas, leave the provider as
local, pick a model you’ve loaded from the Model Hub, and write the triage prompt. Connect it from the test node’s fail port. -
Press Run. Pre-run validation checks every action node’s required fields first. A missing field blocks the run and focuses the offending node. Watch the nodes light up as they execute. Output streams to the bottom Logs panel, and the run lands in History.
Headless, with the CLI
Section titled “Headless, with the CLI”Save the DSL above as first.flow and:
flow validate first.flow # parse + static checksflow run first.flow # run with live per-node streamingflow run first.flow --json # NDJSON event stream for CIThe CLI records the run into the same SQLite history the desktop reads. Open Flow Studio’s History view and the headless run is there.
What you just used
Section titled “What you just used”- Outcome routing. The
pass,fail, andalwaysedges are the control flow. You do not write conditionals. The engine routes on each node’s outcome. - Pre-run validation. Required adapter fields are checked before anything executes.
- Local AI on the failure path. The model only runs when there is something to interpret, and the inference never leaves your machine.
- One graph, two surfaces. The canvas and the DSL are two views of the same execution graph.
Next steps
Section titled “Next steps”- DSL grammar - the full text syntax.
- DSL examples - the canonical patterns.
- Scheduling - run it nightly instead.
- Agentic runs - let the platform build and fix flows for you.