[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
Skip to content

[Feature]: Add a content-addressed node-result cache to the workflow scheduler (cache hit skips the model call, miss loads skills and runs) #3419

Open

Description

@XDT0408

Problem Statement

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:

  1. 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.
  2. 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.
  3. On a miss: load the skills as today (assertWorkflowNodeSkillDependencies → resolveWorkflowSkillContent), execute the node, then store the result under the same digest.
  4. 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

  1. Iterating on the last node of a long workflow — every upstream node re-runs and re-bills today.
  2. Scheduled runs where the upstream inputs did not change.
  3. 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.

Environment

  • Ekko Studio v0.7.36 (latest release, 2026-10-15)
  • Windows
  • Agent runtime: Hermes Agent 0.22.2 / DSH

Priority

High - really need this

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions