[Feature]: Add a content-addressed node-result cache to the workflow scheduler (cache hit skips the model call, miss loads skills and runs) · Issue #3419 · EKKOLearnAI/ekko-studio · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Add a content-addressed node-result cache to the workflow scheduler (cache hit skips the model call, miss loads skills and runs) #3419
Every workflow run re-invokes the model for every node, even when the node's inputs, agent, model and skills are identical to a previous run. There is no result cache in the workflow scheduler, so re-running an unchanged workflow (manually, on a schedule, or after a downstream node fails) re-pays the full token/latency cost and re-reads every skill file from disk.
Evidence (v0.7.36 build; same logic on main)
No cache/memoization exists in the workflow service: packages/server/src/modules/studio/services/workflow/* has zero hits for cache/memo/reuse/digest apart from the import-preview digest in portability.ts.
Skill files are re-resolved from disk twice per execution pass. The run preflight calls assertWorkflowNodeSkillDependencies (services/workflow/manager.ts:388-397, invoked at :467 and :538), which calls resolveWorkflowSkillContent (services/workflow/skill-resolver.ts:113-138 — readdir/realpath-walks every candidate root and reads SKILL.md), and buildNodeUserMessage re-reads the same skill file again for every node execution (manager.ts:2476-2485).
The only result reuse that exists today is intra-run: rerunFromNode seeds initialOutputs from completed node sessions of the same run (manager.ts:2396-2404). A fresh run starts from zero.
Proposed Solution
Add a content-addressed node-result cache at the scheduling layer:
Before executing a node, compute a cache key over everything that can change the result: profile, agent, agentMode, provider/model/apiMode/reasoningEffort, the node's resolved input prompt, the resolved upstream outputs, and the selected skills plus a content hash (or mtime+size) of each resolved SKILL.md.
On a hit: skip the run and feed the stored structured node result to the scheduler, so edges/orchestration (success/failure/always routing, loop feedback, join) continue exactly as if the node had executed.
On a miss: load the skills as today (assertWorkflowNodeSkillDependencies → resolveWorkflowSkillContent), execute the node, then store the result under the same digest.
Invalidation: skill content change (hash), node/upstream change (digest), explicit purge, TTL. Never cache nodes marked approvalRequired, and make it opt-out per node for agents that mutate the workspace (coding agents) or otherwise have side effects.
Alternatives Considered
"Rerun from node" / run snapshots only avoid upstream work inside one run; they do not help a fresh run or a scheduled run.
Provider-side prompt caching is orthogonal: it lowers token cost but still invokes the model and still re-reads skills.
Use Cases
Iterating on the last node of a long workflow — every upstream node re-runs and re-bills today.
Scheduled runs where the upstream inputs did not change.
Recovering a run after a downstream failure.
Additional Context
Cache hits must stay observable: the node status/run evidence should state that a node result was reused rather than executed, otherwise a cached run is indistinguishable from a real one in the run view.
Activity