Agent SwarmAgent Swarm
Concepts

Workflows

Automate multi-step processes with DAG-based workflow definitions

Workflows

Agent Swarm includes a workflow automation engine that lets you define multi-step processes as directed acyclic graphs (DAGs). Workflows connect triggers, conditions, and actions into pipelines that execute automatically when events occur.

Core Concepts

A workflow consists of:

  • Nodes — Individual steps in the pipeline (triggers, conditions, or actions)
  • Edges — Connections between nodes that define execution order and routing
  • Trigger data — Context passed from the triggering event through the pipeline

Node Types

Trigger Nodes (Entry Points)

TypeDescription
trigger-new-taskFires when a new task is created (with optional tag/source/type filters)
trigger-task-completedFires when a task completes
trigger-github-eventFires on GitHub events (PR opened/closed, issue opened, comments, reviews)
trigger-slack-messageFires on Slack messages (with optional channel/keyword filters)
trigger-emailFires on incoming AgentMail messages
trigger-webhookFires via HTTP webhook call

Condition Nodes (Routing)

TypeDescription
property-matchRoutes based on matching properties in the trigger data
code-matchRoutes based on a custom JavaScript expression evaluated in a sandbox
llm-classifyRoutes based on LLM classification of the input

Action Nodes (Execution)

TypeDescription
create-taskCreates a new task in the swarm
send-messageSends a message (Slack, email, or internal)
delegate-to-agentAssigns work to a specific agent

Defining a Workflow

Workflows are defined as JSON with nodes and edges arrays:

{
  "name": "pr-review-pipeline",
  "description": "Auto-assign PR reviews when PRs are opened",
  "definition": {
    "nodes": [
      {
        "id": "trigger",
        "type": "trigger-github-event",
        "label": "PR Opened",
        "config": { "eventType": "pull_request.opened" }
      },
      {
        "id": "create-review-task",
        "type": "create-task",
        "label": "Create Review Task",
        "config": {
          "taskTemplate": "Review PR #{{trigger.number}}: {{trigger.title}}",
          "tags": ["review", "automated"],
          "priority": 60
        }
      }
    ],
    "edges": [
      {
        "id": "e1",
        "source": "trigger",
        "sourcePort": "out",
        "target": "create-review-task"
      }
    ]
  }
}

Execution Model

When a workflow triggers:

  1. The event bus receives an event (task created, GitHub webhook, Slack message, etc.)
  2. All enabled workflows are checked — entry nodes are matched against the event
  3. If a trigger matches, execution starts and walks the DAG breadth-first
  4. Each node executes and produces an output port that determines which edges to follow
  5. Async nodes (like delegate-to-agent) pause the run until the delegated work completes, then resume

Template Interpolation

Action node configs support {{variable}} template syntax to reference trigger data and previous node outputs. For example, {{trigger.title}} inserts the title from the triggering event.

Recovery and Retry

  • Stuck run recovery — The system detects workflow runs that stall and can recover them
  • Retry failed runs — Use the retry-workflow-run MCP tool to re-execute a failed run from the point of failure

MCP Tools

ToolDescription
create-workflowCreate a new workflow with a DAG definition
get-workflowGet workflow details by ID
list-workflowsList all workflows (optionally filter by enabled status)
update-workflowUpdate a workflow's definition, name, or enabled status
delete-workflowDelete a workflow and its run history
trigger-workflowManually trigger a workflow execution
get-workflow-runGet details of a specific workflow run
list-workflow-runsList runs for a workflow
retry-workflow-runRetry a failed workflow run

Dashboard UI

The dashboard includes a Workflows section (under Operations) with:

  • Workflows list — View all workflows with enable/disable status
  • Workflow detail — Interactive React Flow graph visualization of the DAG
  • Runs list — Track all workflow executions with status
  • Run detail — Step-by-step execution view with a visual graph overlay showing node statuses

On this page