/run
Parse and execute inline workflow syntax
> /plugin marketplace add mbruhler/claude-orchestration > /plugin install orchestration@orchestration-marketplace
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/run
Context preview
What this command does when you run it.
Parse and execute inline workflow syntax
Command definition
run.mddescription: Parse and execute inline workflow syntax
deprecated: true
⚠️ DEPRECATED: Orchestration Workflow Execution
**This command is deprecated.** Use the **executing-workflows** skill instead for better visualization, error handling, and progress tracking.
The skill automatically activates when you provide workflow syntax or ask to run a workflow.
Migration Guide
**Instead of:** `/orchestration:run step1 -> step2 -> step3`
**Just provide syntax:**
step1:"task" -> step2:"task" -> step3:"task"
The `executing-workflows` skill will automatically activate and execute with full visualization and steering support.
---
Legacy Usage (Still Works)
Parse and execute a workflow defined using orchestration syntax.
Arguments: {{ARGS}}
The workflow to execute. Can be provided in two formats:
1. **Raw syntax** - Direct workflow operators (e.g., `step1 -> step2`) 2. **Template format** - YAML frontmatter with `workflow` and optional `visualization` fields
Execution Phases
Phase -1: Template Detection (if applicable)
**Check for YAML frontmatter:**
If input starts with `---`, it's a template with frontmatter:
if (input.startsWith('---')) {
const { frontmatter, content } = parseYAMLFrontmatter(input)
// Extract fields
const visualization = frontmatter.visualization // Static ASCII art
const workflow = frontmatter.workflow // Raw workflow syntax
// Use workflow syntax from frontmatter, not content after ---
syntax = workflow
// Store visualization for Phase 2
staticVisualization = visualization
}**If no frontmatter detected, use input as-is for raw syntax.**
---
Phase 0: Pre-Parse (Temporary Agents)
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/features/temporary-agents.md` **Registry:** `./temp-agents/` (in current working directory)
If workflow contains temporary agent syntax (`$agent-name`):
1. **Extract Definitions** - Find `$name := {...}` patterns
const { registry, cleanedSyntax } = extractTempAgentDefinitions(syntax)2. **Expand Invocations** - Replace `$name:"instruction":var` with standard syntax
const { expanded, replacements } = expandTempAgentInvocations(cleanedSyntax, registry)3. **Build Metadata** - Track temp agent info for executor
const metadata = {
tempAgents: [...],
nodeMetadata: [...],
variables: {}
}**Example:**
Input: $scanner := {base: "general-purpose", prompt: "Security expert", model: "opus"}
$scanner:"Scan auth code":results
Output: general-purpose:"Security expert\n\nScan auth code"
+ metadata: {outputVar: "results", model: "opus"}**Errors?**
- Missing `base` or `prompt` field
- Undefined temporary agent reference
- Variable referenced but never produced
**If no temp agents detected, skip to Phase 1.**
---
Phase 1: Parse
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/core/parser.md`
1. **Tokenize** - Split by operators: `->`, `||`, `~>`, `@`, `[...]` 2. **Build AST** - Parse tokens into tree (precedence: `[]` > `||` > `->` > `~>`) 3. **Create Graph** - Convert to directed graph with nodes and edges 4. **Enhance Graph** - Add temp agent metadata if present
if (tempAgentMetadata) {
graph = enhanceGraphWithTempAgents(graph, tempAgentMetadata)
}5. **Validate** - Check for:
- Unclosed subgraphs
- Unknown agents
- Orphaned nodes
- Circular dependencies
- Invalid conditions
- Variable dependencies (if temp agents used)
**Output:**
{
nodes: [{
id, type, agent, instruction, status: "pending",
outputVar?, model?, templateVars?, tempAgentName?
}],
edges: [{from, to, condition}],
variables: {}, // If temp agents used
tempAgents: {} // If temp agents used
}**Errors?** Display clear message with context and abort.
---
Phase 2: Visualize
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/core/visualizer.md`
**Static Visualization Check:** Before generating a dynamic visualization, check if a static visualization was provided:
- Templates can include a `visualization` field in their YAML frontmatter
- If present, display the static visualization directly without modification
- Static visualizations ensure consistent display across all executions
- Skip dynamic generation when static visualization is available
**Dynamic Visualization:** If no static visualization is provided, generate and display ASCII art visualization:
╔════════════════════════════════════════════╗
║ Workflow: [name] ║
╠════════════════════════════════════════════╣
║ ║
║ [step-1] ○ ║
║ │ ║
║ ┌───┴───┐ ║
║ [step-2] [step-3] ○ ○ ║
║ └───┬───┘ ║
║ [merge] ○ ║
║ ║
╠════════════════════════════════════════════╣
║ Status: Ready to execute ║
╠════════════════════════════════════════════╣
║ (c)ontinue (e)dit (q)uit ║
╚════════════════════════════════════════════╝
**Status Indicators:**
- ○ Pending
- ● Executing
- ✓ Completed
- ✗ Failed
- ⊗ Skipped
**Confirm with user before execution.**
---
Phase 3: Execute
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/core/executor.md` **Temp Agents:** `./temp-agents/` (in current working directory)
**Algorithm:** 1. Initialize all nodes to ○ pending 2. Initialize variables map if temp agents used: `graph.variables = {}` 3. Loop until complete:
- Find executable nodes (dependencies satisfied)
- **If temp agents:** Check variable dependencies are satisfied
- **If temp agents:** Interpolate variables in instruction
- Launch agents via Task tool (parallel if multiple)
- Wait for completion
-
Read more
description: Parse and execute inline workflow syntax deprecated: true
⚠️ DEPRECATED: Orchestration Workflow Execution
**This command is deprecated.** Use the **executing-workflows** skill instead for better visualization, error handling, and progress tracking.
The skill automatically activates when you provide workflow syntax or ask to run a workflow.
Migration Guide
**Instead of:** `/orchestration:run step1 -> step2 -> step3`
**Just provide syntax:**
step1:"task" -> step2:"task" -> step3:"task"
The `executing-workflows` skill will automatically activate and execute with full visualization and steering support.
---
Legacy Usage (Still Works)
Parse and execute a workflow defined using orchestration syntax.
Arguments: {{ARGS}}
The workflow to execute. Can be provided in two formats:
1. **Raw syntax** - Direct workflow operators (e.g., `step1 -> step2`) 2. **Template format** - YAML frontmatter with `workflow` and optional `visualization` fields
Execution Phases
Phase -1: Template Detection (if applicable)
**Check for YAML frontmatter:**
If input starts with `---`, it's a template with frontmatter:
if (input.startsWith('---')) {
const { frontmatter, content } = parseYAMLFrontmatter(input)
// Extract fields
const visualization = frontmatter.visualization // Static ASCII art
const workflow = frontmatter.workflow // Raw workflow syntax
// Use workflow syntax from frontmatter, not content after ---
syntax = workflow
// Store visualization for Phase 2
staticVisualization = visualization
}**If no frontmatter detected, use input as-is for raw syntax.**
---
Phase 0: Pre-Parse (Temporary Agents)
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/features/temporary-agents.md` **Registry:** `./temp-agents/` (in current working directory)
If workflow contains temporary agent syntax (`$agent-name`):
1. **Extract Definitions** - Find `$name := {...}` patterns
const { registry, cleanedSyntax } = extractTempAgentDefinitions(syntax)2. **Expand Invocations** - Replace `$name:"instruction":var` with standard syntax
const { expanded, replacements } = expandTempAgentInvocations(cleanedSyntax, registry)3. **Build Metadata** - Track temp agent info for executor
const metadata = {
tempAgents: [...],
nodeMetadata: [...],
variables: {}
}**Example:**
Input: $scanner := {base: "general-purpose", prompt: "Security expert", model: "opus"}
$scanner:"Scan auth code":results
Output: general-purpose:"Security expert\n\nScan auth code"
+ metadata: {outputVar: "results", model: "opus"}**Errors?**
- Missing `base` or `prompt` field
- Undefined temporary agent reference
- Variable referenced but never produced
**If no temp agents detected, skip to Phase 1.**
---
Phase 1: Parse
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/core/parser.md`
1. **Tokenize** - Split by operators: `->`, `||`, `~>`, `@`, `[...]` 2. **Build AST** - Parse tokens into tree (precedence: `[]` > `||` > `->` > `~>`) 3. **Create Graph** - Convert to directed graph with nodes and edges 4. **Enhance Graph** - Add temp agent metadata if present
if (tempAgentMetadata) {
graph = enhanceGraphWithTempAgents(graph, tempAgentMetadata)
}5. **Validate** - Check for:
- Unclosed subgraphs
- Unknown agents
- Orphaned nodes
- Circular dependencies
- Invalid conditions
- Variable dependencies (if temp agents used)
**Output:**
{
nodes: [{
id, type, agent, instruction, status: "pending",
outputVar?, model?, templateVars?, tempAgentName?
}],
edges: [{from, to, condition}],
variables: {}, // If temp agents used
tempAgents: {} // If temp agents used
}**Errors?** Display clear message with context and abort.
---
Phase 2: Visualize
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/core/visualizer.md`
**Static Visualization Check:** Before generating a dynamic visualization, check if a static visualization was provided:
- Templates can include a `visualization` field in their YAML frontmatter
- If present, display the static visualization directly without modification
- Static visualizations ensure consistent display across all executions
- Skip dynamic generation when static visualization is available
**Dynamic Visualization:** If no static visualization is provided, generate and display ASCII art visualization:
╔════════════════════════════════════════════╗ ║ Workflow: [name] ║ ╠════════════════════════════════════════════╣ ║ ║ ║ [step-1] ○ ║ ║ │ ║ ║ ┌───┴───┐ ║ ║ [step-2] [step-3] ○ ○ ║ ║ └───┬───┘ ║ ║ [merge] ○ ║ ║ ║ ╠════════════════════════════════════════════╣ ║ Status: Ready to execute ║ ╠════════════════════════════════════════════╣ ║ (c)ontinue (e)dit (q)uit ║ ╚════════════════════════════════════════════╝
**Status Indicators:**
- ○ Pending
- ● Executing
- ✓ Completed
- ✗ Failed
- ⊗ Skipped
**Confirm with user before execution.**
---
Phase 3: Execute
**Reference:** `${CLAUDE_PLUGIN_ROOT}/docs/core/executor.md` **Temp Agents:** `./temp-agents/` (in current working directory)
**Algorithm:** 1. Initialize all nodes to ○ pending 2. Initialize variables map if temp agents used: `graph.variables = {}` 3. Loop until complete:
- Find executable nodes (dependencies satisfied)
- **If temp agents:** Check variable dependencies are satisfied
- **If temp agents:** Interpolate variables in instruction
- Launch agents via Task tool (parallel if multiple)
- Wait for completion
-
Other commands on orchestration.
init
Import agents from Claude Code environment to orchestration plugin context

