{"record":{"id":"70969a8c891b206a","repo":"iflytek/astron-agent","slug":"node-node-id-has-no-variable-part-without-brackets","errorCode":null,"errorMessage":"Node {node_id} has no variable {part_without_brackets}","messagePattern":"Node (.+?) has no variable (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/util/prompt.py","lineNumber":290,"sourceCode":"        if placeholders_with_brackets:\n            pattern = \"(\" + \"|\".join(map(re.escape, placeholders_with_brackets)) + \")\"\n            parts = re.split(pattern, template)\n        else:\n            parts = [template]\n\n        for i, part in enumerate(parts):\n\n            if part == \"\":\n                continue\n\n            # Handle placeholder information\n            if part in placeholders_with_brackets:\n                part_without_brackets = part.removeprefix(\"{{\").removesuffix(\"}}\")\n                ref_node_info = variable_pool.get_variable_ref_node_id(\n                    node_id, part_without_brackets, span\n                )\n                if not ref_node_info:\n                    raise ValueError(\n                        f\"Node {node_id} has no variable {part_without_brackets}\"\n                    )\n\n                template_unit = TemplateUnitObj(\n                    key=part_without_brackets,\n                    key_type=TemplateSplitType.VARIABLE.value,\n                    ref_node_info=ref_node_info,\n                )\n\n                if ref_node_info.ref_var_type == ValueType.LITERAL.value:\n                    template_unit.key_type = TemplateSplitType.CONSTS.value\n                    template_unit.value = ref_node_info.literal_var_value\n\n                if (\n                    template_unit.ref_node_info\n                    and template_unit.ref_node_info.ref_var_type == ValueType.REF.value\n                    and template_unit.ref_node_info.llm_resp_format\n                    == RespFormatEnum.JSON.value","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/util/prompt.py#L272-L308","documentation":"get_template_unit resolves each {{variable}} placeholder in a template via variable_pool.get_variable_ref_node_id. When the pool has no reference node registered for that variable name on the given node, it raises ValueError, meaning the template references a variable that no upstream node produces.","triggerScenarios":"Rendering a prompt template where a {{placeholder}} does not correspond to any variable defined by node_id, e.g. the upstream node was renamed/removed or the placeholder is misspelled.","commonSituations":"Editing a node's prompt after deleting an upstream node; typos in placeholder names; workflow version mismatch where the dependency edge no longer exists.","solutions":["Fix the placeholder name to match an actual upstream variable","Reconnect or re-add the upstream node that produces the missing variable","Use the workflow editor's variable picker instead of hand-typing placeholders","Run workflow validation/debug to catch dangling references before execution"],"exampleFix":"# before\n\"Summarize {{user_query}}\"  # no upstream node defines user_query\n# after\n\"Summarize {{input.query}}\"  # matches an existing upstream output","handlingStrategy":"validation","validationCode":"refs = variable_pool.get_variable_ref_node_id(node_id, \"user_query\", span)\nassert refs, \"placeholder user_query has no upstream variable on this node\"","typeGuard":null,"tryCatchPattern":"try:\n    units = get_template_unit(template, node_id, variable_pool, span)\nexcept ValueError as e:\n    logger.error(f\"dangling template reference: {e}\")\n    raise","preventionTips":["Re-check prompt placeholders after deleting/renaming upstream nodes","Run workflow validation before publishing","Prefer selecting variables from the picker UI over free text","Keep node output names stable across versions"],"tags":["variables","template","workflow-validation"],"backgroundTag":"entity-not-found","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}