Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#1995 data.latest cache is stale after nested workflow outputs

Opened by stack72 · 9/3/2026· Shipped 9/4/2026

Summary

data.latest() can return a stale value in a workflow after a nested workflow writes a new version of that data. This applies at every nesting boundary, including root -> child -> grandchild workflows.

Reproduction

  1. Seed producer/result with { value: "old" }.
  2. In the root workflow, evaluate data.latest("producer", "result") (for example in an assert) so the root expression context caches old.
  3. Invoke a child workflow. The child may invoke another child; the leaf writes { value: "new" } to producer/result.
  4. In a subsequent root step, evaluate data.latest("producer", "result").attributes.value.

Expected

The root step resolves new, because the descendant workflow completed its write before the root step ran.

Actual

The root step can resolve the cached old value (or a cached null), even though the new data is persisted.

Cause

WorkflowExecutionService.runStep() invalidates the current expression context after a direct model-method step returns dataHandles (src/domain/workflows/execution_service.ts, around lines 3179-3187). runWorkflowStep() instead creates a child execution service and forwards child events, but does not collect descendant step_completed.dataHandles or invalidate the enclosing expression context after the child completes. Each nested workflow has an independent data.latest() cache, so invalidation stops at the child boundary.

Suggested Fix

While forwarding nested workflow events, collect dataHandles from descendant completed steps. After the nested run completes, invalidate those model/data coordinates in the parent expression context. Doing this at every runWorkflowStep() boundary propagates freshness through arbitrary workflow nesting.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/4/2026, 12:02:36 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack729/3/2026, 11:26:31 PM

Sign in to post a ripple.