Revert IS_CHANGED storage - trigger input required

IS_CHANGED doesn't have access to computed input values yet.
The trigger input is required to ensure execution order.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jessesep
2025-12-05 02:06:05 +01:00
co-authored by Claude
parent ad43e6a815
commit 7fa22d3ae9
+9 -7
View File
@@ -61,10 +61,7 @@ class SetVariable:
OUTPUT_NODE = True
@classmethod
def IS_CHANGED(cls, variable_name, value=None):
# Store the value during IS_CHANGED phase (runs before all node execution)
# This ensures GetVariable nodes can find values even without trigger connection
_variable_storage[variable_name] = value
def IS_CHANGED(cls, **kwargs):
return time.time()
def set_var(self, variable_name, value=None):
@@ -74,12 +71,18 @@ class SetVariable:
class GetVariable:
"""Retrieve data by variable name - shows preview on node"""
"""Retrieve data by variable name - shows preview on node
Connect SetVariable's output to 'trigger' to ensure proper execution order.
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"variable_name": ("STRING", {"default": "my_var"}),
},
"optional": {
"trigger": (ANY,),
}
}
RETURN_TYPES = (ANY,)
@@ -90,10 +93,9 @@ class GetVariable:
@classmethod
def IS_CHANGED(cls, **kwargs):
# Always re-execute to get latest variable value
return time.time()
def get_var(self, variable_name):
def get_var(self, variable_name, trigger=None):
if variable_name not in _variable_storage:
available = list(_variable_storage.keys())
preview = f"{variable_name} = NOT SET (available: {available})"