Functions

When part of your graph starts doing one nameable job — "open a ticket", "format the welcome message", "check if someone is staff" — turn it into a function. Your main canvas gets shorter, the logic gets a name, and you can call it from as many places as you like.

Extract, don't rebuild

You rarely create a function from scratch. Instead, grow the logic in place, then select the region and extract it:

  1. Marquee-select the blocks that belong together.
  2. Choose Extract function and give it a name.
  3. The editor figures out the boundary for you — values flowing into the selection become the function's inputs; the value flowing out becomes its result.

Your selection is replaced by a single call block, and the function opens on its own canvas. Nothing about the workflow's behavior changes — it just reads better.

Working inside a function

A function's canvas works exactly like the main one, with two extra fixtures: its inputs appear as sources you wire from, and its result as a sink you wire into. Breadcrumbs above the canvas show where you are — click back to return to the main graph.

Functions can have default values for inputs, so call sites only need to fill in what's unusual. They can call other functions too; well-factored workflows end up with a handful of small functions rather than one large one.

Calling a function

Once defined, your function appears in the block library alongside the built-ins. Drop a call block anywhere: its input ports mirror the function's inputs, its output carries the result. Edit the function once and every call site follows — that's the point.

One workflow, one publish

Functions are part of the workflow, not separate things to manage. One save covers the main graph and every function; validation checks them all together; publish ships them all at once. The breadcrumb is the only reminder that you're "inside" anything.

Sharing functions with other workflows

Mark a function public and it becomes part of what your workflow offers to others: any workflow that depends on yours can call it like a built-in block. This is how shared building blocks happen on the Store — a well-named public function with clear inputs is the best interface you can give another builder. Once others depend on it, treat its inputs and result as a promise: add, don't reshape (see The Store & reuse).