{"record":{"id":"0e8b1fabe20e0b44","repo":"iflytek/astron-agent","slug":"variable-pool-set-parameter-error","errorCode":"VARIABLE_POOL_SET_PARAMETER_ERROR","errorMessage":"Node name: {node.node_id}, error message: {err}","messagePattern":"Node name: (.+?), error message: (.+?)","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/dsl_engine.py","lineNumber":411,"sourceCode":"            },\n            node_id=node.node_id,\n            alias_name=node.node_alias_name,\n            node_type=node.node_type,\n        )\n\n        # Update variable pool\n        output_json = {**run_result.outputs, **run_result.error_outputs}\n        output_keys = list(output_json.keys())\n\n        try:\n            await workflow_engine_ctx.variable_pool.add_variable(\n                run_result.node_id,\n                output_keys,\n                run_result,\n                span=span,\n            )\n        except Exception as err:\n            raise CustomException(\n                err_code=CodeEnum.VARIABLE_POOL_SET_PARAMETER_ERROR,\n                err_msg=f\"Node name: {node.node_id}, error message: {err}\",\n                cause_error=f\"Node name: {node.node_id}, error message: {err}\",\n            ) from err\n\n        # Handle special logic for streaming nodes\n        await self._handle_stream_node_error_output(\n            node, workflow_engine_ctx, run_result\n        )\n\n        # Callback for node end\n        await workflow_engine_ctx.callback.on_node_end(\n            node_id=node.node_id,\n            alias_name=node.node_alias_name,\n            message=run_result,\n        )\n\n        return run_result, False","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/dsl_engine.py#L393-L429","documentation":"When a node's custom return / fail-branch result is written back into the workflow variable pool, any exception raised while setting variables is wrapped as VARIABLE_POOL_SET_PARAMETER_ERROR, carrying the node id and the original message. It indicates the node produced output that could not be stored in the variable pool (wrong keys, incompatible structure, etc.).","triggerScenarios":"A node's run_result declares output keys whose values cannot be set into the variable pool (e.g. missing key, wrong type, pool schema mismatch); _create_custom_return_result or _create_fail_branch_result handling a node whose variable-set call throws.","commonSituations":"Custom-return node configured to output a variable the upstream nodes never produce; workflow DSL edited by hand so output_key names no longer match; iteration/branch nodes returning unexpected shapes after a version upgrade.","solutions":["Read the inner 'error message' in err_msg to find the exact variable that failed to set","Align the node's output_keys with what the node execution actually returns","Re-export/upgrade the workflow DSL so variable names and types match current engine expectations","Add a code/fail branch to handle nodes that may not produce all declared outputs"],"exampleFix":"// before\noutput_keys: [\"result\", \"trace_id\"]  # trace_id never produced by node\n// after\noutput_keys: [\"result\"]","handlingStrategy":"try-catch","validationCode":"# before running, confirm declared output keys exist in the node result\nmissing = [k for k in output_keys if k not in run_result.outputs]\nif missing:\n    raise ValueError(f\"node {node_id} missing outputs: {missing}\")","typeGuard":null,"tryCatchPattern":"try:\n    pool.set(node_id, output_keys, run_result)\nexcept CustomException as e:\n    logger.error(\"variable pool set failed for node %s: %s\", node_id, e.err_msg)\n    route_to_fail_branch(node_id, e)","preventionTips":["Keep output_keys in sync with what nodes actually return","Re-export DSL after editor changes instead of hand-editing","Add fail branches for nodes with optional outputs"],"tags":["workflow","variable-pool","node-execution"],"backgroundTag":"invalid-state-transition","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}