Skip to main content

Workflow Commands

Workflows allow you to chain multiple agent tasks together into automated pipelines. All workflow commands require a running daemon.
Workflows require a running daemon. Start it with openfang start before using these commands.

Listing Workflows

openfang workflow list

List all registered workflows.
Example Output:
Output Columns:
  • ID - Workflow UUID (use this for workflow run)
  • NAME - Human-readable workflow name
  • STEPS - Number of steps in the workflow
  • CREATED - Creation date

Creating Workflows

openfang workflow create

Create a workflow from a JSON definition file.
Arguments: Workflow Definition Format:
Field Reference: Example:
Workflow definitions must be valid JSON. Use a linter to validate before creating.

Running Workflows

openfang workflow run

Execute a workflow by ID.
Arguments: Example:
Real-Time Progress: The workflow execution displays:
  • Step progress with real-time status
  • Execution time for each step
  • Total workflow duration
  • Final output from the last step
Each step receives the output of previous steps via template variables ({{steps.<id>.output}}).

Workflow Examples

Content Creation Pipeline

Usage:

Code Analysis & Documentation

Data Analysis Pipeline

Template Variables

Workflow prompts support Handlebars-style template variables:

Input Variable

References the initial workflow input:

Step Output Variables

References the output of previous steps:

Multiple References

Step outputs are only available after the step has completed. Reference only previous steps in the chain.

Error Handling

Step Timeout

If a step exceeds its timeout, the workflow fails:
Solution: Increase timeout_seconds in the workflow definition:

Agent Not Found

Solution: Verify agent names and spawn missing agents:

Invalid Template Variable

Solution: Verify step IDs match the references:

Workflow Best Practices

1. Keep Steps Focused

Bad: Single massive step
Good: Multiple focused steps

2. Set Realistic Timeouts

  • Simple tasks: 30-60 seconds
  • Complex analysis: 90-180 seconds
  • Code generation: 60-120 seconds
  • Research: 120-300 seconds

3. Use Appropriate Agents

Match agents to task types:

4. Validate JSON Before Creating

5. Test Steps Individually

Before creating a workflow, test each prompt with openfang message:

Advanced Usage

Dynamic Workflows

Generate workflows programmatically:

Workflow Chaining

Use the output of one workflow as input to another:

Parallel Execution

Currently, workflow steps execute sequentially. For parallel execution, use separate workflows:

Next Steps

Trigger Commands

Automate workflows with event triggers

Skill Commands

Enhance workflows with custom skills