workflow is a CLI-first workflow runner for AI agents.
This repository is not positioned as a reusable Go library. The product is the workflow-cli binary and its package-based execution model for components, modules, workflows, and workflow builders.
The repository now uses a self-contained workspace layout:
workspace.yaml
components/
title_uppercase/
component.yaml
modules/
analyze-document-mod/
module.yaml
components/
local_content_word_count/
component.yaml
workflows/
doc-processor-workflow/
workflow.yaml
- A global component package lives at
components/<name>/component.yaml - A module package lives at
modules/<name>/module.yaml - A module can include local component packages under
modules/<name>/components/ - A workflow package lives at
workflows/<name>/workflow.yaml - A component package can be run and tested standalone when it defines
run.manifest
Global and local components are both supported:
- Global components are loaded from the workspace
components/directory and any extra--components-dirpaths - Local components belong to one module package and are only registered for that module at runtime
Run from the repository root:
make build
make testThe build output is:
./workflow-climake test includes:
- unit tests
- command-level tests
- end-to-end tests that build the real CLI binary
- clean-workspace e2e coverage for
init,scaffold,test, andrun
Initialize a new workspace:
./workflow-cli init ./my-workspaceScaffold a global component package:
./workflow-cli scaffold component title_uppercaseScaffold a module package with a local component:
./workflow-cli scaffold module analyze-document-modScaffold a workflow package that references a module package:
./workflow-cli scaffold workflow doc-processor-workflow --module analyze-document-modRun a standalone global component package:
./workflow-cli run component title_uppercaseRun a module package:
./workflow-cli run module analyze-document-modRun a workflow package:
./workflow-cli run workflow doc-processor-workflowRun every workflow package in a directory:
./workflow-cli run workflow --dir ./workflows/Run only selected workflow packages from a directory:
./workflow-cli run workflow --dir ./workflows/ --name doc-processor-workflowEmit structured JSON for agents:
./workflow-cli run workflow doc-processor-workflow --jsonWrite the report to a stable handoff file:
./workflow-cli run workflow doc-processor-workflow --report-file ./tmp/run-report.jsonTest a standalone component package:
./workflow-cli test component title_uppercaseTest a module package:
./workflow-cli test module analyze-document-modTest a workflow package:
./workflow-cli test workflow doc-processor-workflowPackage tests execute the real package and compare the result against test.expect in the package manifest.
workflow-cli build workflow compiles a concise workflow source file into a runnable workflow manifest by executing the built-in workflow package at workflows/module-builder/workflow.yaml.
Example:
./workflow-cli build workflow ./example/module-source.yaml --output ./tmp/generated-workflow.yamlThe built-in builder itself is package-based:
- workflow package:
workflows/module-builder/ - module package:
modules/module-builder/ - local builder components:
modules/module-builder/components/
The package model is the default direction, but the CLI still supports legacy runnable workflow files and the older source example files.
Execution Examples Run a single Workflow via file:
./workflow-cli run workflow ./example/workflow.yamlRun an entire directory of workflows:
./workflow-cli run workflow --dir ./example/Run only specific workflows from a directory by name:
./workflow-cli run workflow --dir ./example/ --name doc-processor-workflowIsolate and run a single Module inside a workflow file:
./workflow-cli run module ./example/workflow.yaml --module-id analyze-document-modEach run, test, and build command writes a JSON artifact under .workflow/reports/ unless --report-file is set.
The report includes:
- workflow and module status
- timestamps and durations
- retry counts
- per-component step attempts
- execution events
- final manifest data
workspace.yaml: workspace root configurationcomponents/: global component packagesmodules/: module packages, including module-local componentsworkflows/: workflow packages and built-in workflowsexample/: legacy compatibility examples for raw workflow/source filescmd/workflow/: CLI entrypoint and command wiringpkg/: lower-level runtime packages used by the CLIAGENTS.md: repository guidance for AI coding agents
Use this format for commits:
{commit type}({any file/package}): {commit message}
Examples:
feat(cmd/workflow): add workflow package scaffolding
fix(modules/module-builder): load package builder in build command
docs(README.md): document package-first workspace layout
test(e2e): cover init and scaffold flows