Your first flow
A flow is a chain of steps on a canvas. Each step is a script, a query, an HTTP call, a condition, a loop — and each one can use what an earlier step returned. In this lesson you build report-pipeline: it runs daily-report, hands its result to a second step that writes a sentence, and shows the whole run on the canvas.
- Create a flow and add steps with the + between them
- Reuse a project script as a step
- Set a step’s input from an earlier step’s output
- Run the flow and inspect each step on the canvas
A flow is a column of steps
Every flow begins at Flow inputs, where its inputs are declared, and runs downward. You never place or wire nodes by hand: the canvas lays the steps out for you, one under the other, and the only way to add one is the + on the line between two steps (or under the last one). Conditions, loops and parallel branches open into columns of their own and close again below.
A step does not see the previous step’s result automatically. Each input of a step is one expression: a fixed value such as "BRL", or a read such as nodes.daily_report.output, and you set it explicitly. That is what makes a flow readable: every piece of data has a name.
Build report-pipeline
- Create the flow
In Code, press + New → Flow, type
report-pipelineas the Flow name and press Create flow. The canvas opens with a single Flow inputs node. - Add daily-report as a step
Click the + under Flow inputs. In Add Node, pick Existing Script (“Link a project script”) and choose
daily-report. It lands under Flow inputs. - Add a step that formats the message
Click the + under
daily-reportand pick Python (or TypeScript, JavaScript). Click the step, name itformat-messagein the sheet’s header and paste the code below in the middle. Itsreportrow under Inputs shows a warning: it has no value yet. - Set the input
On the
reportinput, press the picker icon and choosedaily-report→output. The field now holdsnodes.daily_report.output: the step’s name is its label insnake_case.nodes.daily_report.output.passedwould pass just that field. - Run the flow
Press Run Flow at the top. The Run tab opens and the canvas paints the run: each step is marked running while it works and turns green when it succeeds, with its duration beside it.
- Open a step’s result
Click
format-messageon the canvas: its sheet opens in Run, with the inputs it received on the left and the output it returned below the code. The flow’s own result is the output of its last step.
def main(report: dict):
return {"message": f"{report['passed']} of {report['total']} passed (average {report['average']})"}{
"message": "2 of 3 passed (average 85)"
}Reading a run on the canvas
- A failed step turns red and the flow stops there; its sheet holds the error. Start debugging at the first red step, not at the flow’s status. See Debugging flows.
- The Runs tab lists the flow’s past runs; pick one to paint it on the canvas again. Back to editing takes the run off the canvas.
- On the project’s Runs page, the flow is one row; unfold it to see the step runs it started.
Flows are published too
A flow has a draft and a published version, exactly like a script. Run Flow runs the draft; a schedule or an API endpoint runs the published one. Press Publish on the flow page before the next lesson if you want to schedule the flow instead of the script.