Your first automationLesson 6 of 8

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.

What you will learn
  • Create a flow and add steps with the + between them
  • Reuse a project script as a step
  • Bind a step’s input to 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 Start, 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.

Steps stacked under Start; a later step reads an earlier one’s output through a binding.

A step does not see the previous step’s result automatically. Each input of a step is either a fixed value or a binding — “take this from that step’s output” — and you set it explicitly. That is what makes a flow readable: every arrow of data has a name.

Build report-pipeline

  1. Create the flow

    In Code, press + New → Flow, type report-pipeline as the Flow name and press Create flow. The canvas opens with a single Start step.

  2. Add daily-report as a step

    Click the + under Start. In Add Node, pick Existing Script (“Link a project script”) and choose daily-report. It lands under Start and its side panel opens.

  3. Add a step that formats the message

    Click the + under daily-report and pick Python (or TypeScript, JavaScript). Paste the code below into the step and name it format-message. Its report input shows a warning: it has no value yet.

  4. Bind the input

    On the report input, press From node and pick daily-report → output. The row now reads daily-report → output. Picking output.passed instead would pass just that field.

  5. 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.

  6. Open a step’s result

    Click format-message on the canvas: its panel shows the inputs it received and the output it returned. The flow’s own result is the output of its last step.

format-message.py
def main(report: dict):
    return {"message": f"{report['passed']} of {report['total']} passed (average {report['average']})"}
Expected outputSuccessformat-message’s output — and the flow’s result
{
  "message": "2 of 3 passed (average 85)"
}

Reading a run on the canvas

A finished run: every step green, each with its time.
  • A failed step turns red and the flow stops there; its panel 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.

6 / 8