Flow Builder

Status: Implemented — Available in the web UI at http://localhost:3584 (Flows tab, 🔄 icon)

Overview

The Flow Builder is a visual editor for .armaflow.json workflow definitions. It renders workflow DAGs as interactive node graphs using React Flow (@xyflow/react), allowing drag-and-drop composition of multi-agent pipelines. Flows are stored as JSON with nodes and edges matching React Flow’s native format, while also regenerating the text .armaflow format for TUI compatibility.

Supported Node Types

Agents

NodeDirectiveDescription
🤖 Spawn Agent/spawnLaunch an AI agent with a task
⏳ Join/join, /collectWait for agents to complete, collect results

Control Flow

NodeDirectiveDescription
⇉ Parallel/parallel ... /endExecute agents concurrently
🔀 Condition/if, /elif, /elseBranch based on expression (true/false handles)
✅ Approve/approve, /gateHuman approval gate
⏸️ Wait/waitWait for agent completion or event
💻 Run Script/pipeExecute shell script between agents

Injectors (pill-shaped, output-only)

NodeDirectiveDescription
🌱 Seed Context/seed (role=system)Inject system prompts, .md files, notes
🎭 Fake Context/seed (role=user/assistant)Inject fake conversation history. Multi-node chaining supports ordered multi-message injection.
📂 Allow Paths/allowGrant workspace directory permissions
📋 Complete Schema/complete + /fieldDefine structured output schema agents must report

Output

NodeDirectiveDescription
📝 Log Output/logWrite to flow log
💬 Send Message/msgSend message to agent channel
💤 Sleep/Delay/sleepPause execution
💀 Kill Agent/killTerminate an agent

Edge Types

Edges use distinct colors and patterns to convey relationship type:

EdgeColorPatternMeaning
chaingreensolid, animatedSequential agent handoff
collectambersolidGather results from multiple agents
joinbluesolidParallel convergence
seedpurpledashedContext/fake history injection
pipecyansolid, animatedShell script data transformation
allowgraydottedWorkspace permission grant
waitbluedottedAgent completion dependency

Features

  • Drag-and-drop from palette onto canvas
  • Connect nodes by dragging between handles
  • Auto Format using dagre DAG layout algorithm
  • Snap-to-grid at 20px intervals
  • Canvas pan and zoom via React Flow controls
  • Delete nodes/edges with Backspace/Delete
  • Properties panel — click any node to edit agent settings (model, provider, timeout, budget), injector content, condition expressions
  • Provider/Model dropdowns populated from your configured providers
  • Save persists to .armaflow.json and regenerates .armaflow for TUI
  • Run executes the flow against live agents

File Format

Flows are stored as JSON alongside the text format:

.arma/flows/
  code-review-pipeline.armaflow      # Text format (TUI compatible)
  code-review-pipeline.armaflow.json # JSON format (web UI native)

The JSON schema matches FlowDefinition:

{
  "name": "my-flow",
  "description": "...",
  "trigger": "manual",
  "nodes": [
    { "id": "agent-1", "type": "spawn", "config": { "agentName": "reviewer", "task": "Review the code", "model": "claude-sonnet-4", "_position": { "x": 50, "y": 0 } } }
  ],
  "edges": [
    { "from": "start", "to": "agent-1", "label": "chain" }
  ]
}