Declarative workflows -- staged pipelines with file inputs.
A workflow defines a sequence of stages, each assigned to an agent or profile. Stages can depend on previous stages (result piping) or read from files. Under the hood, workflows expand into work board items with dependencies, so board workers execute them automatically.
Defining a workflow
workflow(:feature, [
{:plan, :planner, "Break this into tasks", from: "specs/feature.md"},
{:implement, :coder, "Implement the plan", from: :plan},
{:test, :tester, "Write tests", from: :implement},
{:review, :reviewer, "Review everything", from: [:implement, :test]}
])Running
run_workflow(:feature) # expands stages into work items
workflow_status(:feature) # check progress
reset_workflow(:feature) # clear and re-runStage options
from: "path/to/file.md"-- read file content into specfrom: :stage_name-- pipe previous stage's resultfrom: [:a, :b]-- fan-in from multiple stagestype: :code-- work board type (default: :custom)priority: 1-- priority (default: 3)
Summary
Functions
Check if a workflow is complete (all stages done) and update status. Called after a work item completes to detect workflow completion.
Define a workflow. Validates and stores the stage definitions.
Get a workflow definition.
List all defined workflows.
Reset a workflow -- removes all its work items and sets status back to :defined.
Run a workflow by expanding its stages into work board items.
Get workflow status with all stage items.
Find which workflow (if any) a work item belongs to.
Types
@type t() :: %AgentWorkshop.Workflow{ created_at: DateTime.t(), name: atom(), stages: [stage()], status: :defined | :running | :completed | :failed }
Functions
@spec check_completion(atom()) :: :ok
Check if a workflow is complete (all stages done) and update status. Called after a work item completes to detect workflow completion.
Define a workflow. Validates and stores the stage definitions.
Get a workflow definition.
@spec list() :: [t()]
List all defined workflows.
Reset a workflow -- removes all its work items and sets status back to :defined.
Run a workflow by expanding its stages into work board items.
@spec status(atom()) :: {t(), [AgentWorkshop.Work.t() | nil]} | {:error, :not_found}
Get workflow status with all stage items.
Find which workflow (if any) a work item belongs to.