{"record":{"id":"1720529d54f18a7e","repo":"iflytek/astron-agent","slug":"codeenum-eng-node-protocol-validate-error","errorCode":"CodeEnum.ENG_NODE_PROTOCOL_VALIDATE_ERROR","errorMessage":"Variable aggregation node requires one output","messagePattern":"Variable aggregation node requires one output","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/variable_aggregation/variable_aggregation_node.py","lineNumber":135,"sourceCode":"        validator = type_validators.get(schema_type)\n        if validator and not validator(converted_value):\n            raise CustomException(\n                CodeEnum.VARIABLE_NODE_EXECUTION_ERROR,\n                err_msg=f\"Variable aggregation fallback value type is invalid for {schema_type}\",\n            )\n\n        return converted_value\n\n    async def async_execute(\n        self,\n        variable_pool: VariablePool,\n        span: Span,\n        event_log_node_trace: NodeLog | None = None,\n        **kwargs: Any,\n    ) -> NodeRunResult:\n        try:\n            if not self.output_identifier:\n                raise CustomException(\n                    CodeEnum.ENG_NODE_PROTOCOL_VALIDATE_ERROR,\n                    err_msg=\"Variable aggregation node requires one output\",\n                )\n\n            output_name = self.output_identifier[0]\n            output_schema = variable_pool.get_output_schema(self.node_id, output_name)\n\n            # Get all input values in order\n            inputs = {\n                input_key: variable_pool.get_variable(\n                    node_id=self.node_id,\n                    key_name=input_key,\n                    span=span,\n                )\n                for input_key in self.input_identifier\n            }\n\n            # Find first non-empty value in input order (the core functionality)","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/variable_aggregation/variable_aggregation_node.py#L117-L153","documentation":"A variable aggregation node must declare exactly one output identifier; the node's async_execute reads output_identifier and takes the first element. If output_identifier is empty/None, it raises CustomException with CodeEnum.ENG_NODE_PROTOCOL_VALIDATE_ERROR because there is nowhere to publish the aggregated result.","triggerScenarios":"Executing a variable aggregation node whose output was never configured in the node definition (empty output list), e.g. a node created programmatically or a form saved without selecting an output variable.","commonSituations":"Workflow imported/edited without the output field filled; node schema changed between versions dropping the output; manual JSON authoring of the workflow omitted outputs.","solutions":["Configure exactly one output variable on the variable aggregation node in the workflow editor","Re-save the node definition ensuring output_identifier is populated","Check the workflow JSON for an empty 'output'/'output_identifier' field and fill it","Recreate the node if its saved schema is corrupt"],"exampleFix":"# before\n{\"type\": \"variable-aggregation\", \"output_identifier\": []}\n# after\n{\"type\": \"variable-aggregation\", \"output_identifier\": [\"aggregated\"]}","handlingStrategy":"validation","validationCode":"assert node_config.get(\"output_identifier\"), \"variable aggregation node needs exactly one output\"","typeGuard":null,"tryCatchPattern":"try:\n    result = await node.async_execute(...)\nexcept CustomException as e:\n    if e.err_code == CodeEnum.ENG_NODE_PROTOCOL_VALIDATE_ERROR:\n        logger.error(f\"node {node.node_id} misconfigured: {e.err_msg}\")\n        raise","preventionTips":["Always configure the output variable when adding an aggregation node","Validate workflow JSON before deployment","Preserve the output field when importing/exporting workflows","Add schema validation for node definitions on save"],"tags":["workflow-validation","node-config","protocol"],"backgroundTag":"missing-required-config-field","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"}