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:
+9
-7
@@ -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})"
|
||||
|
||||
Reference in New Issue
Block a user