Skip to content

fix(api): store expanded workflow, not raw body - #46

Open
addadi wants to merge 1 commit into
nullclaw:mainfrom
addadi:fix/strategy-store-expanded-workflow
Open

fix(api): store expanded workflow, not raw body#46
addadi wants to merge 1 commit into
nullclaw:mainfrom
addadi:fix/strategy-store-expanded-workflow

Conversation

@addadi

@addadi addadi commented Aug 22, 2026

Copy link
Copy Markdown

Fixes #34
Fixes #36

handleCreateRun stored the raw request body as workflow_json, discarding the expanded steps from expandStrategy. With strategy: sequential, applyChain added depends_on to the expanded steps — but those were only used for DB step prepopulation, never persisted in workflow_json. The engine then read the raw body at runtime, saw no depends_on, and dispatched every step as a graph root (no chain, no ordering).

When a strategy is present, replace obj.steps with the expanded effective_steps and serialize that as workflow_json, so the chain dependencies persist for normalizeWorkflowRoot to convert into DAG edges. The idempotency-conflict check compares against the stored expanded form.

Verified: 3-step sequential workflow completes in order (a→b→c) with correct depends_on stored in the DB. Full suite green (zig build test, 355/355).

handleCreateRun stored the raw request body as workflow_json, discarding
the expanded steps from expandStrategy. With strategy: sequential,
applyChain added depends_on to the expanded steps — but those were only
used for DB step prepopulation, never persisted in workflow_json. The
engine then read the raw body at runtime, saw no depends_on, and
dispatched every step as a graph root (no chain, no ordering).

When a strategy is present, replace obj.steps with the expanded
effective_steps and serialize that as workflow_json, so the chain
dependencies persist for normalizeWorkflowRoot to convert into DAG
edges. Idempotency-conflict check compares against the stored expanded
form.

Fixes nullclaw#34
Fixes nullclaw#36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant