Folder Structure
Every workflow package follows this structure:my-workflow-codemachine
codemachine.json
config
main.agents.js
sub.agents.js
modules.js
placeholders.js
agent-characters.json
templates
workflows
example.workflow.js
prompts
A minimum workflow requires only three files:
codemachine.json, main.agents.js, and a .workflow.js file. Everything else is optional.Required Files
| File | Location | Purpose |
|---|---|---|
codemachine.json | Root | Package manifest with name and version |
main.agents.js | config/ | Main agent definitions |
*.workflow.js | templates/workflows/ | Workflow step definitions |
Optional Files
| File | Location | Purpose |
|---|---|---|
sub.agents.js | config/ | Sub-agent definitions for orchestrated agents |
modules.js | config/ | Module definitions for looping agents |
placeholders.js | config/ | Dynamic content placeholders |
agent-characters.json | config/ | Agent personalities and display styles |
prompts/ | Root | Prompt templates for agents |
Manifest File
Every workflow package must have acodemachine.json manifest at its root:
codemachine.json
| Field | Required | Description |
|---|---|---|
name | Yes | Package identifier (used for imports) |
version | Yes | Semantic version (e.g., 1.0.0) |
description | No | Brief description of your workflow |
Real Examples
Importing Packages
Once your package has a valid manifest, you can import it using the CLI or TUI:Import Workflows
Learn about all import sources: local paths, GitHub repos, and more
Next Steps
Build Agents
Learn how to configure agents in
main.agents.js