Workflow Commands
Workflows allow you to chain multiple agents together, passing outputs from one agent as inputs to another. All workflow commands require a running daemon.openfang workflow list
List all registered workflows.Output
Output Columns
- ID: Workflow UUID
- NAME: Workflow name from the definition
- STEPS: Number of steps in the workflow
- CREATED: Timestamp when the workflow was created
Example
openfang workflow create
Create a workflow from a JSON definition file.Arguments
| Argument | Description |
|---|---|
<FILE> | Path to a JSON file describing the workflow steps. |
Workflow Definition Format
Create a JSON file with the following structure:workflow.json
Step Fields
| Field | Required | Description |
|---|---|---|
name | Yes | Step identifier (used for referencing outputs) |
agent | Yes | Agent name or template to use |
prompt | Yes | Prompt template (use {{input}} for workflow input, {{step.output}} for previous step outputs) |
timeout | No | Timeout in seconds (default: 60) |
Template Variables
{{input}}— The workflow’s initial input{{step_name.output}}— Output from a previous step
Examples
Output
openfang workflow run
Execute a workflow by ID.Arguments
| Argument | Description |
|---|---|
<WORKFLOW_ID> | Workflow UUID. Obtain from openfang workflow list. |
<INPUT> | Input text to pass to the workflow. |
Behavior
- Executes each step in sequence
- Passes output from one step as input to the next (via template variables)
- Displays progress and results for each step
- Returns the final step’s output
Examples
Example Output
Trigger Commands
Event triggers allow agents to react to system events (agent spawned, terminated, lifecycle changes, etc.).openfang trigger list
List all event triggers.Options
| Option | Description |
|---|---|
--agent-id <ID> | Filter triggers by the owning agent’s UUID. |
Output
Examples
openfang trigger create
Create an event trigger for an agent.Arguments
| Argument | Description |
|---|---|
<AGENT_ID> | UUID of the agent that owns the trigger. |
<PATTERN_JSON> | Trigger pattern as a JSON string. |
Options
| Option | Default | Description |
|---|---|---|
--prompt <TEMPLATE> | "Event: {{event}}" | Prompt template. Use {{event}} as a placeholder for the event data. |
--max-fires <N> | 0 (unlimited) | Maximum number of times the trigger will fire. |
Pattern Examples
Full Example
openfang trigger delete
Delete a trigger by ID.Arguments
| Argument | Description |
|---|---|
<TRIGGER_ID> | UUID of the trigger to delete. |
Example
Complete Workflow Example
Next Steps
Agent Commands
Spawn and manage agents
Skill Commands
Extend agent capabilities
Trigger API
Event triggers via REST API
CLI Overview
Back to CLI overview
