Examples
threadle ships working graphs for every concept. Find them under Workflows → examples.
Clicking one clones it into your library. Your own editable copy, not a read-only demo. Take it apart, rewire it, break it.
Every example is also a CLI template id and a portable JSON file under examples/workflows/ in the repo:
threadle --list-templatesthreadle run hellothreadle run detached-delay --detach # ~60s, no agents — then threadle jobs / logsthreadle run examples/workflows/knot-concat.jsonCanvas basics
Section titled “Canvas basics”Wiring, running, gating, parameterizing in the addon. Only one needs an agent. Pair with Getting started on the canvas.
| Example | CLI id | Teaches | Agent |
|---|---|---|---|
| Hello | hello | Prompt → output. Wiring with nothing else in the way | |
| Approval gate | splice-gate | An approval gate with editable text before continue | |
| One-shot agent | one-shot-agent | Prompt → agent → output. The result session appears wired | agent |
| Workflow params | param-prompt | {{param:topic}} expanding before the prompt runs | |
| MCP brief | examples/workflows/mcp-brief.json | Param + output shaped for threadle mcp / wf_*. MCP | |
| Text → Prompt | prompt-convert | Wrapping inbound text with a converter template |
threadle run examples/workflows/mcp-brief.json# then add threadle to.mcp.json — see MCP manualCompanion reading: Getting started on the canvas · MCP
Intermediate
Section titled “Intermediate”Branching, merging, iterating, guard rails, and detached server jobs. All agent-free.
| Example | CLI id | Teaches | Agent |
|---|---|---|---|
| Detached delay | detached-delay | Prompt → ◷ Delay (~60s) → output. Watch threadle jobs / logs while it runs. Close the browser and reopen later | |
| Hello MCP | hello-mcp | Prompt → ◈ MCP tool (echo) → output. Needs examples/mcp echo config as repo-root .mcp.json. MCP | |
| Merge concat | merge-concat | Two branches into a ⋈ merge | |
| Merge first-wins | merge-first | The first strategy across two branches | |
| Iterator lines | iterator-lines | ∀ iterator splitting a checklist into items | |
| Mute & bypass | mute-bypass | Mute skips a node. Bypass passes its input straight through | |
| Content breaker | content-tripwire | Parking when a regex like ERROR matches | |
| Judge branch | judge-branch | ? Judge routes text to pass / fail / unsure outs | |
| Until re-entry | until-reenter | ↻ Until counted loop body then exhausted out | |
| Wait for idle | wait-idle-gate | ◌ Wait for idle until session not generating | |
| Min-chars breaker | min-chars-tripwire | Parking when a draft comes back too short | |
| Spend ceiling | spend-tripwire | A branch breaker plus the graph-wide ceiling |
# copy examples/mcp/mcp.json.echo.example → repo-root.mcp.jsonthreadle run hello-mcp
# terminal Athreadle --no-open
# terminal B — agent-free long runthreadle run detached-delay --detachthreadle jobsthreadle attach <jobId>
threadle run knot-concatthreadle run iterator-linesthreadle run judge-branchthreadle run until-reenterthreadle run wait-idle-gatethreadle run content-tripwire --approve-allCompanion reading: Patterns · Until · Wait for idle · Detached runs · CLI
Advanced
Section titled “Advanced”Real pipelines: parallelism, per-item agent loops, multi-stage work.
| Example | CLI id | Teaches | Agent |
|---|---|---|---|
| Agent err fallback | agent-err-fallback | Red error connector (out:err) vs happy-path out → fallback convert. Agents | agent |
| Skill invoke + Judge | skill-invoke-judge | ✦ Skill mode: invoke (/{name} on Claude/Cursor/…) → ? Judge. Skills | agent |
| Iterator → agent | iterator-agent | One agent run per item, sequentially in one session | agent |
| Iterator parallel map | iterator-parallel | ∀ mode: parallel. Fresh sessions under ply, then ⋈ Merge | agent |
| Token breaker | token-circuit breaker | Skipping a branch whose payload grew too large | |
| Starter workflow | plan-implement-review | The full plan → implement → review spine, with a skill node and approvals | agent |
| Parallel fan + majority merge | ply-fan-merge | Parallelism = 2 parallel asks, merged by majority, with a duration fuse | agent |
threadle run agent-err-fallbackthreadle run iterator-parallelthreadle run plan-implement-review \ --param task="fix the flaky auth test" --approve-allCompanion reading: Patterns · Errors & retries
Expert
Section titled “Expert”| Example | CLI id | Teaches | Agent |
|---|---|---|---|
| Guarded parallel | expert-guarded-fan | Everything at once: parallel fan-out → two asks → concat merge → content breaker that skips on ERROR → approval edit → output, under a $1 graph spend ceiling | agent |
| Complex delay pipeline | complex-delay-pipeline | Five linked subgraphs, delays only: Intake → Normalize → Fast∥Deep → Assemble → circuit breaker → approval. ~20s wall with parallelism=2. use in the app seeds editable subgraphs |
threadle run expert-guarded-fan --param task="…" --approve-allthreadle run complex-delay-pipeline --approve-allRead this one before you build anything unattended. It’s the shape most production workflows converge on.
Companion reading: Patterns · Custom nodes
Full catalog
Section titled “Full catalog”| Level | CLI id | Portable file |
|---|---|---|
| beginner | hello | examples/workflows/hello.json |
| beginner | splice-gate | examples/workflows/splice-gate.json |
| beginner | one-shot-agent | examples/workflows/one-shot-agent.json |
| beginner | param-prompt | examples/workflows/param-prompt.json |
| beginner | prompt-convert | examples/workflows/prompt-convert.json |
| intermediate | detached-delay | examples/workflows/detached-delay.json |
| intermediate | hello-mcp | examples/workflows/hello-mcp.json |
| intermediate | merge-concat | examples/workflows/merge-concat.json |
| intermediate | merge-first | examples/workflows/merge-first.json |
| intermediate | iterator-lines | examples/workflows/iterator-lines.json |
| intermediate | mute-bypass | examples/workflows/mute-bypass.json |
| intermediate | content-tripwire | examples/workflows/content-tripwire.json |
| intermediate | judge-branch | examples/workflows/judge-branch.json |
| intermediate | until-reenter | examples/workflows/until-reenter.json |
| intermediate | wait-idle-gate | examples/workflows/wait-idle-gate.json |
| intermediate | min-chars-tripwire | examples/workflows/min-chars-tripwire.json |
| intermediate | spend-tripwire | examples/workflows/spend-tripwire.json |
| advanced | agent-err-fallback | examples/workflows/agent-err-fallback.json |
| advanced | iterator-agent | examples/workflows/iterator-agent.json |
| advanced | iterator-parallel | examples/workflows/iterator-parallel.json |
| advanced | token-tripwire | examples/workflows/token-tripwire.json |
| advanced | plan-implement-review | examples/workflows/plan-implement-review.json |
| advanced | ply-fan-knot | examples/workflows/ply-fan-knot.json |
| expert | expert-guarded-fan | examples/workflows/expert-guarded-fan.json |
| expert | complex-delay-pipeline | examples/workflows/complex-delay-pipeline.json. 5 subgraphs, delays only |
Using an example as a starting point
Section titled “Using an example as a starting point”- Clone it from the Examples table, or
threadle run <id>/ import the JSON. - Swap the demo agent for the one you actually use, and set a model.
- Replace the hard-coded prompt with a param.
- Adjust the circuit breaker thresholds to your budget.
- Save. It’s yours now, and exports as portable JSON.
Related
Section titled “Related”- Patterns. When to reach for which control node
- Running. What happens when you press ▶
- CLI.
--list-templatesand headless runs - Portable graphs. Sharing a
.jsonfile