From ad43e6a8155411d38f676c6cf7473e67dbe52bb9 Mon Sep 17 00:00:00 2001 From: jessesep Date: Fri, 5 Dec 2025 01:58:44 +0100 Subject: [PATCH] Store variables in IS_CHANGED phase - no trigger needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SetVariable now stores value during IS_CHANGED (runs before execution) - This ensures values are available before any GetVariable runs - Removed trigger input from GetVariable - no longer needed - Much cleaner workflow without requiring manual connections 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- __init__.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/__init__.py b/__init__.py index e52a3c1..4ddd42c 100644 --- a/__init__.py +++ b/__init__.py @@ -61,8 +61,10 @@ class SetVariable: OUTPUT_NODE = True @classmethod - def IS_CHANGED(cls, **kwargs): - # Always re-execute to capture new values + 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 return time.time() def set_var(self, variable_name, value=None): @@ -72,19 +74,12 @@ class SetVariable: class GetVariable: - """Retrieve data by variable name - shows preview on node - - IMPORTANT: Connect the 'trigger' input to the SetVariable output to ensure - the variable is set before this node runs. - """ + """Retrieve data by variable name - shows preview on node""" @classmethod def INPUT_TYPES(cls): return { "required": { "variable_name": ("STRING", {"default": "my_var"}), - }, - "optional": { - "trigger": (ANY,), # Connect to SetVariable output to ensure execution order } } RETURN_TYPES = (ANY,) @@ -98,8 +93,7 @@ class GetVariable: # Always re-execute to get latest variable value return time.time() - def get_var(self, variable_name, trigger=None): - # trigger input is just for execution ordering, not used + def get_var(self, variable_name): if variable_name not in _variable_storage: available = list(_variable_storage.keys()) preview = f"{variable_name} = NOT SET (available: {available})"