Skip to main content

Canvas or code?

You never have to choose once and for all. The canvas and graph-builder code are two ways to author the same workflow, and you can switch between them at any time.

Quick guide​

You want to…Use
Build or change an automation without writing codeThe canvas
Review workflow changes in pull requests, keep them in Git, or generate many similar workflowsGraph-builder code (tier 1)
Type-check node arguments and references between nodesGraph-builder code (tier 1)

Durable functions (tier 2) are the right choice when you want to:

  • loop until a condition that only the data decides, or branch on many intermediate results;
  • wait hours or days for a person, a payment or another system, then continue (on the canvas, with Wait for Signal);
  • undo earlier steps when a later one fails (a saga);
  • let operators adjust triggers and simple steps while developers own the core logic, with a canvas workflow that contains a Code workflow node.

The canvas and tier-1 code are the same thing​

A tier-1 file is a typed description of a canvas workflow. Exporting a workflow as code and pushing it back gives the same definition, byte for byte, whenever the fidelity report says lossless. People can keep editing on the canvas while others edit the code: fluidgrids pull brings canvas edits into the project, and fluidgrids push creates a new version from the code.

Durable functions are a node on the canvas​

A durable function appears on the canvas as a Code workflow node with its declared inputs and outputs. The canvas around it keeps working as usual: triggers, connections, environments, approvals and the run list all apply. Open the node to see its source and, on a run, its trace.

Mixing the forms​

  • A canvas workflow can contain any number of Code workflow nodes.
  • A durable function can run any canvas node as an activity (ctx.run) and start any canvas workflow as a child run (ctx.child).
  • Wait for Signal lets a canvas workflow wait for the same signals a durable function can wait for.

Next steps​