Workflow File Location
Workflow files live intemplates/workflows/ and use the .workflow.js extension:
my-workflow-codemachine
templates
workflows
my-workflow.workflow.js
Basic Structure
Every workflow exports a default object with a name and steps:templates/workflows/my-workflow.workflow.js
Name
Names should be short and descriptive. They define the objective of your workflow and help users understand what it accomplishes.Code Review PipelineAPI GeneratorDocumentation WriterBug Fixer
Steps
Steps are agents set in sequence. TheresolveStep() function loads an agent from your config/main.agents.js.
Arrangement matters. Each step receives context from previous steps, so the order determines how information flows through your workflow.
Workflow Modes
Choose how your workflow runs:| Mode | Description | Best For |
|---|---|---|
| Manual | User controls flow, agents wait for input | Interactive workflows, brainstorming |
| Continuous | Runs automatically from start to finish | Batch processing, reports |
| Hybrid | Mix of interactive and auto-advancing agents | Complex workflows with checkpoints |
autonomousMode:
| Value | Behavior |
|---|---|
'never' or false | Manual - waits for user at each step |
'always' or true | Continuous - auto-advances through all steps |
Adding Separators
Useseparator() to add visual dividers between workflow phases:
templates/workflows/code-review.workflow.js
Interactive vs Non-Interactive Steps
By default, steps are interactive - the workflow waits for user input. Setinteractive: false to auto-advance:
A common pattern is making the first step interactive for gathering requirements, then running subsequent steps non-interactively.
Complete Simple Example
Here’s a complete workflow for a basic code generation pipeline:templates/workflows/code-generator.workflow.js
Running Your Workflow
Once your workflow is complete, run it with:Keyboard Shortcuts
| Key | Action |
|---|---|
| Shift+Tab | Toggle Autonomous Mode |
| Tab | Toggle Timeline Panel |
| P | Pause Workflow |
| Ctrl+S | Skip current prompt or agent |
| Escape | Stop Confirmation |
| H | History View |
| Enter | Toggle Expand / Open Log |
| Arrow Up/Down | Navigate |
| Arrow Right | Focus Prompt Box |