II.
Page JSON
Structured · livepage:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-023
GAP-TOOLS-023: Multi-Step Workflow Composition Within Effects json
Inspect the normalized record payload exactly as the atlas UI reads it.
{
"id": "page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-023",
"_kind": "Page",
"_file": "wiki/docs/harness-features-backlog/gaps/tools-capabilities/gap-tools-023.md",
"_cluster": "wiki",
"attributes": {
"nodeKind": "Page",
"sourcePath": "docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-023.md",
"sourceKind": "repo-docs",
"title": "GAP-TOOLS-023: Multi-Step Workflow Composition Within Effects",
"displayName": "GAP-TOOLS-023: Multi-Step Workflow Composition Within Effects",
"slug": "docs/harness-features-backlog/gaps/tools-capabilities/gap-tools-023",
"articlePath": "wiki/docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-023.md",
"article": "\n# GAP-TOOLS-023: Multi-Step Workflow Composition Within Effects\n\n| Field | Value |\n|-------|-------|\n| Category | tools-capabilities |\n| Priority | High |\n| Effort | L |\n| Status | Partial |\n\n## Description\nEnable composition of multi-step workflows within a single effect, where each step can be a different task kind with conditional branching, retry logic, and data passing between steps. Extends beyond linear process definitions to support complex orchestration patterns within effects.\n\n## Current State\nProcess definitions compose effects sequentially or in parallel via `ctx.task()`, `ctx.parallel.all()`, and `ctx.parallel.map()`. However, individual effects are atomic -- there is no way to define a multi-step workflow within an effect that includes conditionals, retries, or step-to-step data transformation. Process composition gaps (GAP-PROC-001, GAP-PROC-002) cover chaining and nesting of processes but not intra-effect workflows.\n\n## Target State\nA `ctx.workflow()` intrinsic that accepts a workflow definition with: ordered steps with named outputs, conditional branching (if step A fails, run step B), configurable retry policies per step, data transformation between steps, timeout per step and for the overall workflow. Workflow execution is deterministic and replayable via the journal.\n\n## Dependencies\n- [GAP-PROC-001](../process-composition/GAP-PROC-001.md) -- process chaining for inter-process workflows\n- [GAP-PROC-002](../process-composition/GAP-PROC-002.md) -- process nesting for hierarchical workflows\n\n## Key Files\n| Component | Path |\n|-----------|------|\n| Runtime | `packages/sdk/src/runtime/` |\n| Process context | `packages/sdk/src/runtime/processContext.ts` |\n| Task definitions | `packages/sdk/src/tasks/` |\n| Replay engine | `packages/sdk/src/runtime/replay/` |\n\n## Recommendation\nPhase 3 implementation. Define `WorkflowDefinition` type with steps, branches, and retry policies. Add `ctx.workflow()` to `ProcessContext`. Ensure workflow steps map to individual journal events for replayability.\n",
"documents": []
},
"outgoingEdges": [],
"incomingEdges": [
{
"from": "page:docs-harness-features-backlog",
"to": "page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-023",
"kind": "contains_page"
}
]
}