Lightweight Step Run
Harness Engineering template: this showcase demonstrates one concrete capability slice of orchestrator as a control plane for agent-first software delivery.
Purpose: Three lightweight execution modes — step filtering, synchronous run, and direct assembly — enabling point-shot single-step execution without creating a full workflow.
Use Cases
- Re-run a single step from a multi-step workflow (e.g., run only
fixfor a specific ticket) - Inject ad-hoc variables into a step (e.g., specify a ticket path)
- Synchronously wait for execution results instead of polling asynchronously
- Execute a StepTemplate + Agent capability directly without an existing workflow
Prerequisites
orchestratordis running (orchestratord --foreground --workers 2)- Database initialized (
orchestrator init) - A multi-step workflow is deployed (e.g.,
plan-execute)
Steps
1. Deploy a Multi-Step Workflow
Using the plan-execute template as an example:
orchestrator apply -f docs/workflow/plan-execute.yaml --project demoVerify resources are loaded:
orchestrator get workflows --project demo
orchestrator get agents --project demo2. Phase 1 — Step Filtering (--step + --set)
Execute only specific steps from a workflow, with optional variable injection:
# Only execute the implement step
orchestrator task create \
--workflow plan-execute \
--project demo \
--step implement
# Inject a pipeline variable
orchestrator task create \
--workflow plan-execute \
--project demo \
--step fix \
--set ticket_paths=docs/ticket/T-0042.md
# Multiple steps (executed in workflow order)
orchestrator task create \
--workflow plan-execute \
--project demo \
--step plan --step implementInspect results:
orchestrator task list --project demo
orchestrator task logs <task_id>Error handling: specifying a non-existent step ID returns a clear error:
orchestrator task create --workflow plan-execute --step nonexistent
# Error: unknown step id 'nonexistent' in --step filter; available steps: plan, implement, verify3. Phase 2 — Synchronous Execution (orchestrator run)
The run command creates a task, follows logs in real time, and exits with a status code:
# Synchronous — logs stream to terminal
orchestrator run \
--workflow plan-execute \
--project demo \
--step implement \
--set goal="Fix concurrency issue in login module"
# Background mode (falls back to task create)
orchestrator run \
--workflow plan-execute \
--project demo \
--step implement \
--detachBehavior:
- Creates task, automatically follows logs until completion
- Streams agent output to the terminal in real time
- Exits with code 0 (completed) or 1 (failed)
--detachprints the task ID and returns immediately
4. Phase 3 — Direct Assembly Mode (No Workflow)
Execute a StepTemplate + Agent capability directly, without an existing workflow:
# Specify template and agent capability
orchestrator run \
--template fix-ticket \
--agent-capability fix \
--project demo \
--set ticket_paths=docs/ticket/T-0042.md
# With execution profile override
orchestrator run \
--template fix-ticket \
--agent-capability fix \
--profile host-unrestricted \
--project demo \
--set ticket_paths=docs/ticket/T-0042.mdDirect assembly mode internally constructs a single-step TaskExecutionPlan, reusing StepTemplate, Agent, and ExecutionProfile resources already applied to the workspace.
Execution Flow
Phase 1: task create --step fix --set key=val
↓
Step filter → only execute specified steps
Variable injection → injected as pipeline variables
Phase 2: orchestrator run --workflow X --step fix
↓
Create task → follow logs → wait for completion → exit code
Phase 3: orchestrator run --template T --agent-capability C
↓
Build single-step plan → create ephemeral task → executeKey Feature: Step Filtering
Step IDs specified with --step are validated server-side against the execution plan. Steps not in the filter are skipped. Filtered steps execute in their original workflow order, and the scope partitioning (task/item) mechanism is unchanged.
Key Feature: Variable Injection
Variables injected with --set key=value are merged into pipeline variables at task start. They can be referenced in StepTemplate prompts ({key}) and in prehook CEL expressions.
Key Feature: Security Guarantees
- ExecutionProfile sandbox enforcement is not bypassed
- All
runexecutions produce RunResult records, accessible viaevent list - Full audit trail, identical to regular task execution
Customization Guide
Add Point-Shot Capability to Existing Workflows
No YAML changes needed — --step and --set work with any existing workflow:
# Run only the qa step from the sdlc workflow
orchestrator run --workflow sdlc --step qa --project my-project
# Run qa + fix steps
orchestrator run --workflow sdlc --step qa --step fix --project my-projectCreate a StepTemplate for Direct Assembly
apiVersion: orchestrator.dev/v2
kind: StepTemplate
metadata:
name: fix-ticket
spec:
prompt: |
Fix the issue described in the following ticket.
Ticket path: {ticket_paths}
Project goal: {goal}
Source tree root: {source_tree}Then execute directly:
orchestrator run \
--template fix-ticket \
--agent-capability fix \
--set ticket_paths=docs/ticket/T-0042.mdFurther Reading
- Plan & Execute Template — multi-step workflow for use with
--steppartial execution - Hello World Template — minimal runnable workflow
- CLI Reference — full
runcommand parameter reference - Workflow Configuration — step definitions, scope, loop policy details