squadcue

Flow Canvas — User Manual

What the canvas is

The canvas is a drag-and-drop pipeline editor (built on Drawflow) for wiring repeatable agent workflows out of typed nodes: fetch a page, summarize with Claude, pause for human approval, push to Telegram. The canvas is just a view over a graph JSON — hitting Run converts the graph you currently see into a staged run (topological sort; independent nodes execute in parallel). Every run stores a snapshot of the flow definition (runs/<id>/flow_snapshot.json) plus per-node params, output, duration, and errors (runs/<id>/steps.json), so any run can be replayed or audited later.

Quick start

  1. Open the Canvas tab and pick Demo: fetch → AI summary → approve → notify (flows/demo_daily_digest.json) from the flow selector.
  2. The demo has 4 nodes wired in a line:
    • n1 · fetch — downloads the Hacker News front page, strips HTML.
    • n2 · claude — prompts Claude (sonnet) to summarize the 5 most interesting stories, injecting the page text via ``.
    • n3 · gate — pauses the run and shows the digest for human approval (1-hour timeout).
    • n4 · tg — pushes the approved digest to your Telegram.
  3. Hit Run. When the gate fires, a Telegram card with Approve / Reject buttons arrives on your phone — first response wins, no need to open the cockpit.
  4. Single-click a node to see its live result panel; double-click to edit its params (JSON) and label.

Node reference

Parameter names below are exactly what flow_engine.py reads from params. Any string param marked templatable accepts `` (see next section).

action

Runs a predefined console action (a registered local command) and captures its output.

claude

Spawns a one-shot headless Claude CLI (claude -p) with your prompt on stdin.

codex

Spawns Codex CLI as a read-only red team (codex exec --sandbox read-only) — it can inspect the workroot but cannot write files. Use it for second opinions and reviews, not for making changes.

gate

Human approval checkpoint. Pauses the run, pushes a Telegram button card (Approve / Reject), and waits. Anything other than approve stops the flow.

shell

Runs a PowerShell command (powershell -NoProfile -Command <cmd>).

fetch

Downloads an http/https URL (2 MB cap, 30 s timeout) and optionally strips HTML tags.

tg

Sends a Telegram message via the configured bot.

wait

Sleeps for a fixed interval — useful to space out API calls or wait for a file drop.

readfile

Reads a local text file via Python (UTF-8 first, falling back through utf-8-sig / cp950 / big5 — avoids console codepage mangling). The path supports glob patterns; with a glob it auto-picks the newest match by lexicographic sort, so dated filenames like report_2026-08-03.json resolve to the latest one.

writefile

Writes (or appends) text to a local file as UTF-8 via Python.

kb

BM25 full-text search (CJK-friendly) over your locally indexed markdown folders.

swarm ⚠ experimental

Runs N parallel Claude calls on the same prompt from different angles (default angle set: optimistic / critical fault-finding / data-driven / user perspective / contrarian), then optionally merges them into one balanced conclusion with a final Claude call.

tournament ⚠ experimental

Runs N parallel attempts at the prompt, then a judge call scores them on your criteria and the winning attempt’s text is passed downstream.

pipeline (advanced)

Inlines the stages of a registered server-side pipeline into the flow.

Wiring data between nodes

Every node stores its output under its node id in a shared results map. Downstream nodes reference it with double-brace templating, exactly:


Runs, retry, and approval