Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/coleam00/Archon/llms.txt

Use this file to discover all available pages before exploring further.

Archon workflows are YAML files stored in .archon/workflows/. This page documents every field in the workflow schema, from top-level metadata through all seven node types and their advanced options. All workflows use a DAG (directed acyclic graph) execution model — nodes with satisfied dependencies run concurrently.
Use archon validate workflows to check your YAML against this schema before running. The validator returns actionable error messages with “did you mean?” suggestions for typos.

Top-level fields

name: my-workflow          # Required
description: "..."         # Required
provider: claude           # Optional: registered provider id
model: sonnet              # Optional: model string (forwarded verbatim to SDK)
interactive: false         # Optional: force foreground execution in Web UI
nodes: [...]               # Required: array of node definitions
FieldTypeRequiredDescription
namestringYesWorkflow identifier. Must be unique within the discovery scope.
descriptionstringYesHuman-readable description shown in workflow list.
providerstringNoRegistered provider id (claude, codex, pi). Inherited by all nodes unless overridden.
modelstringNoModel string forwarded verbatim to the resolved SDK. Not validated by Archon.
modelReasoningEffortenumNoCodex reasoning effort: minimal, low, medium, high, xhigh.
webSearchModeenumNoCodex web search: disabled, cached, live.
additionalDirectoriesstring[]NoAdditional directories Codex can read (absolute paths).
interactivebooleanNoForce foreground execution in the Web UI. Required for approval-gate workflows.
effortenumNoClaude effort level: low, medium, high, max.
thinkingobject/stringNoClaude thinking config. See Claude-specific fields.
fallbackModelstringNoModel to fall back to if the primary model is unavailable.
betasstring[]NoClaude beta features to enable (non-empty array).
sandboxobjectNoClaude sandbox settings. See Sandbox.
worktree.enabledbooleanNoPin worktree isolation on (true) or off (false). Omit to let the caller decide.
mutates_checkoutbooleanNoSet false to allow concurrent runs on the same path (default: true = serialize runs).
tagsstring[]NoArbitrary tags for filtering.
nodesDagNode[]YesArray of workflow nodes.

Node common fields

Every node type shares these base fields:
FieldTypeDescription
idstringRequired. Unique node identifier within the workflow. Used for depends_on references and $nodeId.output substitution.
depends_onstring[]IDs of nodes that must complete before this node runs. Nodes without depends_on start immediately.
whenstringConditional expression. The node is skipped if this evaluates to false. Supports $nodeId.output references.
trigger_ruleenumJoin semantics for nodes with multiple dependencies. See Trigger rules.
modelstringPer-node model override.
providerstringPer-node provider override (claude, codex, pi).
output_formatobjectJSON Schema object. Forces the AI to return structured JSON. See Structured output.
idle_timeoutnumberTimeout in ms for a node to produce its first output. Must be a finite positive number.
retryobjectRetry config for this node. Not supported on loop nodes.
contextenumfresh (new AI session) or shared (inherit parent session).

Node types

Runs an inline prompt through the configured AI provider.
- id: analyze
  prompt: |
    Analyze the authentication module at $ARGUMENTS.
    Check for common security vulnerabilities and summarize findings.
  model: opus
  allowed_tools: [Read, Bash]
FieldTypeRequiredDescription
promptstringYesThe prompt text. Supports variable substitution.
All AI-only fields are available.
Runs a named command from .archon/commands/. The command file’s content is loaded from disk and variable-substituted before being sent to the AI.
- id: plan
  command: plan-feature
  depends_on: [analyze]
FieldTypeRequiredDescription
commandstringYesCommand name (must be a valid command in .archon/commands/).
All AI-only fields are available.
Runs a shell script. stdout is captured as $nodeId.output for downstream nodes. No AI is involved.
- id: get-tests
  bash: |
    cd $CODEBASE_ROOT
    bun test --json 2>&1 | head -100
  timeout: 30000
FieldTypeRequiredDescription
bashstringYesShell script body. Supports variable substitution.
timeoutnumberNoTimeout in milliseconds. Must be a positive number.
$nodeId.output values from upstream nodes are auto shell-quoted when substituted into bash: scripts, making them safe to embed in shell commands.
AI-specific fields (provider, model, output_format, allowed_tools, denied_tools, hooks, mcp, skills, agents, effort, thinking, maxBudgetUsd, systemPrompt, fallbackModel, betas, sandbox) are accepted in the YAML but ignored at runtime with a warning.
Runs an inline TypeScript/Python script or a named script from .archon/scripts/. stdout is captured as $nodeId.output. Requires runtime: bun or runtime: uv.
# Inline TypeScript
- id: process-data
  script: |
    const data = JSON.parse(process.env.INPUT ?? '{}');
    console.log(JSON.stringify({ result: data.items.length }));
  runtime: bun
  timeout: 10000

# Named script from .archon/scripts/
- id: run-analysis
  script: analyze-pr-diff
  runtime: bun
  deps:
    - lodash
FieldTypeRequiredDescription
scriptstringYesInline script body or named script from .archon/scripts/.
runtimeenumYesbun (TypeScript/JavaScript) or uv (Python).
depsstring[]NoDependencies to install before running (e.g., ["lodash", "axios"]).
timeoutnumberNoTimeout in milliseconds. Must be a positive number.
$nodeId.output values substituted into script: nodes are embedded as-is (not shell-quoted). Treat them as untrusted input and parse with language features (e.g., JSON.parse).
Runs an AI prompt repeatedly until a completion signal is detected in the output, or until max_iterations is reached.
- id: improve
  loop:
    prompt: |
      Review the current implementation and improve it.
      When satisfied, output COMPLETE.
      Previous output: $LOOP_PREV_OUTPUT
    until: COMPLETE
    max_iterations: 5
    fresh_context: true
Loop config fields (loop:):
FieldTypeRequiredDescription
promptstringYesPrompt executed each iteration. Supports variable substitution including $LOOP_PREV_OUTPUT.
untilstringYesCompletion signal string detected in AI output (e.g., COMPLETE).
max_iterationsintegerYesMaximum iterations. Exceeding this fails the node. Must be a positive integer.
fresh_contextbooleanNoStart a fresh AI session each iteration (default: false).
until_bashstringNoOptional bash script run after each iteration. Exit code 0 = complete.
interactivebooleanNoPause between iterations for user input via archon workflow approve.
gate_messagestringRequired if interactive: trueMessage shown to user when paused.
retry is not supported on loop nodes — loop manages its own iteration logic.
Interactive loop example:
- id: review-loop
  loop:
    prompt: |
      User feedback: $LOOP_USER_INPUT
      Implement the requested changes, then output COMPLETE when done.
    until: COMPLETE
    max_iterations: 10
    interactive: true
    gate_message: "Review the draft. Add feedback and approve, or just approve to finish."
Pauses workflow execution until a human approves or rejects via archon workflow approve / archon workflow reject, or via the Web UI.
- id: review-gate
  approval:
    message: "Review the generated PR diff before pushing."
    capture_response: true
    on_reject:
      prompt: |
        The reviewer rejected with reason: $REJECTION_REASON
        Address the feedback and update the implementation.
      max_attempts: 3
Approval config fields (approval:):
FieldTypeRequiredDescription
messagestringYesMessage shown to the reviewer when the workflow pauses.
capture_responsebooleanNoStore the approver’s comment as $<node-id>.output for downstream nodes (default: false).
on_reject.promptstringNoPrompt to run when rejected. $REJECTION_REASON is available here.
on_reject.max_attemptsintegerNoMaximum rejection+retry cycles (1–10).
Approval-gate workflows require interactive: true at the workflow level for correct behavior in the Web UI.
Terminates the workflow run immediately with a reason string.
- id: check-condition
  bash: |
    if [ ! -f ".archon/config.yaml" ]; then echo "missing"; fi

- id: abort-if-missing
  cancel: "No .archon/config.yaml found. Initialize the repo with archon setup first."
  depends_on: [check-condition]
  when: "$check-condition.output == 'missing'"
FieldTypeRequiredDescription
cancelstringYesReason string. Must be non-empty. Recorded in the run’s event log.

Trigger rules

Trigger rules control what upstream node states allow a downstream node to run. Set via trigger_rule on any node.
RuleDescription
all_successAll upstream nodes must succeed (default)
one_successAt least one upstream node must succeed
none_failed_min_one_successNo upstream node failed, and at least one succeeded
all_doneAll upstream nodes must be in a terminal state (success or failure)
- id: finalize
  prompt: "Summarize the results of all checks."
  depends_on: [lint, test, typecheck]
  trigger_rule: all_done   # Run even if some checks failed

Structured output

Set output_format (a JSON Schema object) to force the AI to return structured JSON. The output is then accessible via $nodeId.output.field in downstream nodes.
  • Claude: Enforced via SDK structured output
  • Codex: Enforced via SDK
  • Pi: Best-effort via prompt augmentation + JSON extraction
- id: classify
  command: classify-issue
  output_format:
    type: object
    properties:
      type:
        type: string
        enum: [BUG, FEATURE, DOCS]
      priority:
        type: string
        enum: [LOW, MEDIUM, HIGH]
    required: [type, priority]

- id: route
  prompt: |
    Issue type: $classify.output.type
    Priority: $classify.output.priority
    Route this issue to the appropriate team.
  depends_on: [classify]

AI-only fields

These fields apply to prompt:, command:, and loop: nodes. They are accepted but ignored (with a warning) on bash: and script: nodes.
FieldTypeDescription
allowed_toolsstring[]Restrict the AI to only these tools (Claude only)
denied_toolsstring[]Deny specific tools from the AI (Claude only)
hooksobjectPer-node SDK hook callbacks. See Hooks.
mcpstringPath to an MCP server config file (Claude only). Env vars expanded at execution time.
skillsstring[]Skill directories to preload via AgentDefinition wrapping (Claude only). Non-empty array.
agentsobjectInline sub-agent definitions invokable via the Task tool (Claude only). See Agents.
systemPromptstringOverride the system prompt for this node (Claude only).

Claude-specific fields (workflow-level and per-node)

These fields apply to both workflow level (as defaults for all nodes) and per-node level (as overrides).
Controls Claude’s reasoning depth.
effort: high   # 'low' | 'medium' | 'high' | 'max'
ValueDescription
lowFastest, least thorough
mediumBalanced
highMore thorough
maxMost thorough, slowest
Claude extended thinking configuration. Accepts a string shorthand or a full object.
# String shorthand
thinking: adaptive

# Full object form
thinking:
  type: enabled
  budgetTokens: 8000
ValueDescription
adaptive / { type: adaptive }SDK chooses thinking depth adaptively
enabled / { type: enabled, budgetTokens: N }Always think; optional token budget
disabled / { type: disabled }Disable extended thinking
Maximum spend in USD for this node or workflow.
maxBudgetUsd: 0.50   # $0.50 limit
Must be a positive number.
Model to fall back to if the primary model is unavailable.
model: claude-opus-4-5
fallbackModel: claude-sonnet-4-5
Claude beta features to enable. Must be a non-empty array of strings.
betas:
  - interleaved-thinking-2025-05-14
OS-level filesystem and network restrictions for Claude sessions.
sandbox:
  enabled: true
  network:
    allowedDomains:
      - api.github.com
      - registry.npmjs.org
  filesystem:
    allowWrite:
      - /tmp
      - $ARTIFACTS_DIR
    denyRead:
      - ~/.ssh
Sandbox fields:
FieldTypeDescription
enabledbooleanEnable sandbox restrictions
autoAllowBashIfSandboxedbooleanAutomatically allow bash when sandboxed
allowUnsandboxedCommandsbooleanAllow certain commands to bypass sandboxing
network.allowedDomainsstring[]Domains the sandbox can reach
network.allowManagedDomainsOnlybooleanRestrict to SDK-managed domain list only
filesystem.allowWritestring[]Paths allowed for writes
filesystem.denyWritestring[]Paths denied for writes
filesystem.denyReadstring[]Paths denied for reads

Hooks

Per-node hooks let you attach static responses to Claude SDK lifecycle events. Each hook event maps to an array of matchers.
- id: safe-edit
  prompt: "Implement the feature."
  hooks:
    PreToolUse:
      - matcher: "^(Bash|Execute)$"
        response:
          decision: block
          reason: "Bash is not allowed in this node."
    PostToolUse:
      - matcher: "^Write$"
        response:
          decision: approve
Supported hook events: PreToolUse, PostToolUse, PostToolUseFailure, Notification, UserPromptSubmit, SessionStart, SessionEnd, Stop, SubagentStart, SubagentStop, PreCompact, PermissionRequest, Setup, TeammateIdle, TaskCompleted, Elicitation, ElicitationResult, ConfigChange, WorktreeCreate, WorktreeRemove, InstructionsLoaded Hook matcher fields:
FieldTypeDescription
matcherstringRegex pattern to match tool names or event subtypes (optional)
responseobjectThe SyncHookJSONOutput to return when the hook fires
timeoutnumberTimeout in seconds (default: SDK default of 60)

Inline agents

Define sub-agents that Claude can invoke via the Task tool within a node.
- id: complex-task
  prompt: "Use the review-agent to check the implementation."
  agents:
    review-agent:
      description: "Reviews code for correctness and style."
      prompt: "Review the provided code and return a structured critique."
      model: claude-haiku-4-5
      tools: [Read, Bash]
      disallowedTools: [Write]
      maxTurns: 10
Agent IDs must be kebab-case (lowercase letters, digits, and hyphens only). Agent definition fields:
FieldTypeRequiredDescription
descriptionstringYesDescription shown to the parent agent
promptstringYesSystem prompt for the sub-agent
modelstringNoModel override for the sub-agent
toolsstring[]NoTools available to the sub-agent
disallowedToolsstring[]NoTools explicitly denied
skillsstring[]NoSkill directories to preload
maxTurnsintegerNoMaximum turns for the sub-agent

Retry configuration

Control retry behavior on individual nodes (bash:, script:, prompt:, command: — not supported on loop:).
- id: flaky-api-call
  bash: curl https://api.example.com/data
  retry:
    maxAttempts: 3
    backoffMs: 1000
    backoffMultiplier: 2
FieldTypeDescription
maxAttemptsintegerMaximum total attempts (including the first)
backoffMsnumberInitial delay between retries in milliseconds
backoffMultipliernumberMultiplier applied to backoff on each retry

Complete example

name: archon-pr-review
description: "Review a pull request: classify, analyze, and report."
provider: claude
model: sonnet
interactive: true

nodes:
  - id: get-diff
    bash: |
      gh pr diff $ARGUMENTS 2>&1 | head -500

  - id: classify
    command: classify-pr
    output_format:
      type: object
      properties:
        risk: { type: string, enum: [low, medium, high] }
        areas: { type: array, items: { type: string } }
      required: [risk, areas]
    depends_on: [get-diff]

  - id: analyze
    prompt: |
      Risk level: $classify.output.risk
      Areas changed: $classify.output.areas
      PR diff:
      $get-diff.output

      Provide a detailed review with specific line-level feedback.
    effort: high
    depends_on: [classify]

  - id: approval-gate
    approval:
      message: "Review the analysis above. Approve to post the comment, or reject with feedback."
      on_reject:
        prompt: |
          Reviewer feedback: $REJECTION_REASON
          Revise the review accordingly.
        max_attempts: 2
    depends_on: [analyze]

  - id: post-comment
    bash: |
      gh pr comment $ARGUMENTS --body "$analyze.output"
    depends_on: [approval-gate]

Authoring Workflows

Step-by-step guide to writing your first workflow.

Variable Reference

All substitution variables available in workflow nodes.

Loop Nodes

Deep dive into iterative loop node configuration.

Approval Nodes

How to build human-in-the-loop workflows with approval gates.

Build docs developers (and LLMs) love