Flows
Build a flow
How to create a flow, add and connect steps on the canvas, use undo, layout and version history, set flow-wide instructions and time limits, fix validation problems and run a flow with input.
This page walks through the Flow Builder: creating a flow, adding steps, connecting them, saving and running.
#Create a flow
Open Flows in the sidebar.
- With no flows yet, press Create your first flow.
- Otherwise press New flow. The dialog offers Blank flow, Describe it, the built-in templates and Import from file…. See Templates and drafts.
For a blank flow, enter a Name and optionally What is it for?, then press Create and open. A blank flow contains one step: Start (a Manual start).
#The editor
| Area | What it holds |
|---|---|
| Header | Back to flows, the flow name (click to rename) and version, an amber dot for Unsaved changes, Undo, Redo, Duplicate selection, Tidy up layout, Fit to view, Version history, Edit with agent, the problem count or Ready to run, Save and Run. |
| Left palette | Steps you can add: every agent under Agents, and HTTP request, Send message, Condition, Human approval and Join branches under Logic. |
| Canvas | Your steps and arrows. |
| Right panel | The selected step's settings. |
| Last-run strip | Appears once the flow has run: its state, Show on canvas and Open run details. |
#Add steps
- Drag an item from the palette onto the canvas, or click it to add it in the middle of the view.
- Or use Add a step at the bottom of the canvas.
- A new step's settings open immediately.
Dragging an agent creates an Agent step for that agent. Every agent you have is in the palette.
#Connect steps
Drag from a step's exit dot (on its right) to another step's input dot (on its left). Some steps have more than one exit: a Condition has Yes and No, a Human approval has Approved and Rejected.
When you connect a step that produces output into an Agent or Human approval step, LoCrew automatically ticks it as an input of that step.
LoCrew refuses a connection with a message at the top of the canvas:
| Message | Why |
|---|---|
| A step cannot lead to itself. | Self-links are not allowed. |
| Nothing can lead into a start step. | The start step only has an exit. |
| Those steps are already connected. | No duplicate arrows from the same exit. |
Drawing an arrow back to a step that runs earlier creates a sends back connection, drawn dotted red. It makes that part of the flow run again. See Sending work back.
#Select, delete, duplicate
| Action | How |
|---|---|
| Select several | Shift, Ctrl or ⌘ click |
| Delete | Delete or Backspace, or the bin in the step panel. The start step cannot be deleted. |
| Duplicate | Ctrl+D. Copies are named … copy; arrows between copied steps are copied too. |
| Undo / redo | Ctrl+Z / Ctrl+Shift+Z or Ctrl+Y. Up to 100 steps back. |
| Save | Ctrl+S |
Use ⌘ instead of Ctrl on macOS. While you type in a field, only Ctrl+S works.
Tidy up layout arranges steps left to right. Fit to view shows the whole flow. A minimap (Flow overview) appears when a flow has more than eight steps.
#Change a step's type
Every step except the start step has Type of step. Changing it starts the step's settings afresh; arrows stay, moved to the matching exit, and Undo puts everything back. To change how the flow starts, use How does this flow start? on the start step: When I press Run, On a schedule or When /run is used in a conversation.
#Flow-wide settings
Click the start step to find two settings that apply to the whole flow:
| Setting | Effect |
|---|---|
| Instructions for every step in this flow | Up to 2,000 characters given to every agent step on top of its own task, for standing rules such as tone or audience. |
| Time limit for the whole run | No limit, or 5 minutes up to 7 days. A run still going after the limit is stopped and marked failed; steps in progress are cancelled. Time spent waiting for your approval counts. Resuming an interrupted run gives it the full limit again. |
#Problems and validation
The header shows N problems in red, or Ready to run in green. Click it to open the problem list; click a problem to select and centre its step. Errors block running; warnings (marked Check) do not.
Common problems:
| Message | Fix |
|---|---|
| Start is not connected to anything. Connect it to the first step. | Draw an arrow from the start step. |
| … can never run: nothing leads to it from the start. | Connect it, or delete it. |
| …: choose an agent. | Pick the agent in the step panel. |
| Describe what this agent should do. | Fill in Task. |
| … is part of a loop. | Steps run top to bottom. Mark the arrow back as sends back, or remove one to break the loop. |
| … is connected to … but does not receive its output. (warning) | Tick it under Give it the output of, if the step should see it. |
| … has fewer than two incoming branches, so it has nothing to join. (warning) | A Join step needs at least two branches. |
You can save a flow that still has problems, but you cannot run it. Problems on a step you just added stay hidden in its panel until you save.
#Save and versions
Save creates a new version (v2, v3…). Saving an unchanged flow writes nothing. Saved versions can never be changed.
Version history lists every version, newest first. Go back loads an older version into the editor as an unsaved change (Back to version N — save to keep it); saving it makes it the newest version. Nothing is ever deleted.
If the flow was saved elsewhere in the meantime: This flow was saved elsewhere (now version N, you edited version M). Reload it before saving.
#Run the flow
Run is enabled once the flow is saved and has no errors. It opens Run this flow:
- Input (optional): up to 20,000 characters. Steps that use the start step's output receive it.
- Press Run.
Agents run with their own permissions; steps that change files still ask you first if the agent is set to ask. The canvas shows each step's state as the run progresses, and the run appears in Runs.
Note
Run works for every kind of start step, and the run is recorded as started by you. A flow designed for /run that reads {{start.json.prompt}} fails when started this way, because that value only exists for runs started from a conversation. See Triggers.
#Edit with an agent
Edit with agent lets one of your agents change the flow for you.
- Choose Which agent and describe What should change (up to 4,000 characters).
- Press Suggest changes. This costs one turn of that agent, or two if its first answer needs correcting.
- Review the list of steps and connections it would add, remove or change.
- Apply changes the flow on screen. Undo takes it back; Save keeps it.
The agent's proposal is checked before you see it: it may not add validation errors, or use a channel or credential the flow does not already use.
#Ask an agent about one step
At the bottom of every step panel, Ask an agent to rewrite this step (or Ask an agent why it failed, after a failed run) sends that step, where it sits and the failure it reported to one of your agents. Suggest a rewrite (or Suggest a fix, after a failure) shows the proposed change field by field; Apply changes the step on screen only. The agent cannot add, remove or reconnect steps.
#Delete a flow
On the flow's card, open ⋯ and choose Delete flow. The flow, every saved version and its run history are removed. Agents are not affected. A flow with a run in progress cannot be deleted until you cancel the run.