Skip to main content
A workflow is a configured execution plan. It defines which agents run, in what order, with what controls, and how context flows between them.

What Makes Up a Workflow

Every workflow has:
  • Name - Defines the objective of the overall workflow
  • Steps - Agents set in sequence
Optionally, workflows can also include:
  • Separators - Visual dividers between workflow phases
  • Tracks - Different workflow paths users can choose from
  • Condition Groups - Questions to customize which steps run
  • Sub-agents - Additional agents the workflow can use
  • Controller - An agent that guides users before the workflow starts
  • Modules - Main agents with loop ability
  • Specification - A project brief needed before starting
  • Autonomous Mode - Who drives the workflow (you or the system)

How Workflows Execute

Workflows run step by step. Each step contains an agent that performs work, produces output, and passes context to the next step.
1

Onboarding

If tracks or conditions are defined, user answers questions to configure the workflow path.
2

Step Execution

Each step runs its agent. The agent receives prompts, uses tools, and produces output.
3

Context Passing

Files, outputs, and user choices flow to the next step as placeholders.
4

Completion

All steps finish. Final outputs are available in the project directory.

Workflow vs Agent

ConceptWhat It IsScope
WorkflowExecution planOrchestrates multiple agents
AgentEngine sessionExecutes a single step
A workflow coordinates agents. An agent does the actual work.
One workflow can have many agents. One agent belongs to one step.

Components

Name

The workflow name defines the objective of the overall workflow. It’s what users see when selecting which workflow to run. A clear name helps users understand what the workflow will accomplish before they start.

Define Your Workflow Name

See how to name your workflow

Steps

Steps are agents set in sequence. The arrangement matters for execution because each step receives context from previous steps. Every workflow requires at least one step. Each step runs an agent that performs work and passes output to the next.
Think of steps like an assembly line. Each station (agent) does its job and hands off to the next. The order determines the flow of work and context.

Configure Your Steps

Learn how to set up workflow steps

Separators

Separators are visual dividers that organize your workflow into phases. They appear in the TUI timeline to help users understand workflow progress.
Use separators to group related steps together, like “Analysis Phase”, “Implementation Phase”, and “Review Phase”.

Add Separators

Learn how to add visual dividers to your workflow

Tracks

A track is a workflow variant, a path that determines which version of the workflow runs.
  • Users pick one track (like choosing a route on a map)
  • Each step can belong to specific tracks
  • If a step doesn’t belong to the selected track, it’s skipped
Think of tracks like choosing between “Quick”, “Standard”, or “Enterprise” versions of the same workflow. Selecting “Quick” runs only the steps meant for that simpler path.

Configure Tracks

Learn how to set up workflow tracks

Condition Groups

Conditions are feature flags, options that control which steps run based on what’s needed.
  • Users can select multiple conditions (like checkboxes)
  • Steps can require all selected conditions to match
  • Steps can also run if at least one condition matches
Imagine conditions like “Include UI”, “Include API”, or “Include Database”. A step tagged with “Include UI” only runs if the user selected that option.

Configure Condition Groups

Learn how to set up workflow conditions

Sub-Agents

Sub-agents are specialized helpers that main workflow agents can call upon to handle specific tasks. Think of it like a manager delegating work to team members with different expertise:
  • Main Agent: “Project Manager”
    • Sub-Agent: “Frontend Developer” (builds UI)
    • Sub-Agent: “Backend Developer” (builds API)
    • Sub-Agent: “QA Engineer” (writes tests)
Sub-agents let you break complex work into specialized roles. Each sub-agent focuses on what it does best.

Configure Sub-Agents

Learn how to set up workflow sub-agents

Controller

A controller is a conversational guide, an agent that talks to the user before the main workflow starts. It’s like a project intake meeting: the controller asks questions, gathers requirements, and plans before the automated work begins. How it works:
  1. Controller starts and begins a conversation
  2. User chats with controller (asks questions, provides context)
  3. User presses Enter with no input to signal they’re ready
  4. Workflow steps execute
Controllers let you have a planning conversation before any automated work begins. The controller remembers the conversation, so it can be resumed later.

Configure Controllers

Learn how to set up workflow controllers

Modules

Modules are main agents with loop ability. They can repeat their work until a goal is reached. Unlike regular agents that run once and finish, modules can cycle back and refine their output based on feedback or changing conditions.
Think of modules as persistent workers. They keep going until the job is done right, not just done once.

See Modules in Action

View real workflow examples using modules

Specification

A spec is a plain text document (markdown) that describes what you want to build: your project’s goals, requirements, and context. It’s like a project brief you hand to a team before they start working. You can set a workflow to never start without a spec, ensuring the agents always have clear direction.
Specs keep everyone (and every agent) on the same page. No guessing what needs to be built.

Configure Specification Mode

Learn how to require specifications

Autonomous Mode

Autonomous mode controls who drives the workflow: you or the system.
  • Always autonomous - The system runs everything automatically. You can’t pause or intervene.
  • Never autonomous - You stay in control. The system won’t proceed without your input.
  • Toggle - You can pause anytime to orchestrate manually, then hand control back to the system.
Choose based on how much oversight you need. Critical workflows might need human control. Routine tasks can run on autopilot.

Configure Autonomous Mode

Learn how to set up autonomous mode

Import Workflows

Imports are external workflows built by the CodeMachine team or community.
  • Shared via external repos
  • Contains workflows, agents, prompts, and config
  • Install via TUI or CLI
  • Anyone can share, anyone can install
Built-in workflows come with the CodeMachine package. Imports are installed separately.

Next Steps