Added transient storage for nodes#8833
Conversation
Added per-execution transient storage.
Added transient_storage to run_node.
Added transient_storage implementation.
|
Why is this useful? When we have branching or proper |
|
Note: I tried adding the transient storage to the invocation cache but the issues are that 1) execution order isn't guaranteed, and therefore 2) we'd have to include the transient storage prior to invocation when creating the cache key. I can make these changes and add a test if that's the decided route or we can make it part of the node contract that nodes using transient storage cannot use the cache. Thoughts? |
|
I'm not a big fan of intentionally breaking encapsulation, determinism, and order dependence in a way that users can't see or predict. Is there no possibility to support this using plugable dictionary inputs instead? |
I'm not sure what you mean here - inputs into what? We already make no guarantees about determinism; the goal here is to have a framework for the future when we add control flow. I have a WIP branch that removes the requirement of |
Summary
Feature: Add
transient_storagetoInvocationContextas per-workflow ephemeral state. A singletransient_storagedict is created at the start of a workflow execution and passed into each node's freshly builtInvocationContext, enabling nodes to share small amounts of in-process data during one graph run. The storage is reset between workflow executions; nodes that rely ontransient_storageshould therefore setuse_cache=Falsein their@invocationdecorator to avoid cached outputs bypassing required read/write side effects.Related Issues / Discussions
QA Instructions
pytest tests/test_graph_execution_state.pytransient_storageis available and isolated per workflow execution.use_cache=Falsein the@invocationdecorator and verify their behavior does not change when invocation caching is enabled elsewhere.Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)