diff --git a/src/graphon/nodes/llm/node.py b/src/graphon/nodes/llm/node.py index 137c010a..b1839abb 100644 --- a/src/graphon/nodes/llm/node.py +++ b/src/graphon/nodes/llm/node.py @@ -1129,7 +1129,14 @@ def _fetch_jinja_inputs(self, node_data: LLMNodeData) -> dict[str, str]: variables: dict[str, str] = {} for variable_selector in node_data.prompt_config.jinja2_variables or []: - variable = self._get_required_variable(variable_selector) + variable = self.graph_runtime_state.variable_pool.get( + variable_selector.value_selector, + ) + if variable is None: + # Variable not in pool — the Jinja2 template handles this + # gracefully with {% if variable is defined %}, so skip it + # rather than raising VariableNotFoundError. + continue variables[variable_selector.variable] = self._stringify_jinja_variable( variable, )