{"record":{"id":"93290839539871a9","repo":"iflytek/astron-agent","slug":"workflow-execution-error","errorCode":"WORKFLOW_EXECUTION_ERROR","errorMessage":"Flow output mode not configured for flow_id: {self.flowId}","messagePattern":"Flow output mode not configured for flow_id: (.+?)","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/flow/flow_node.py","lineNumber":199,"sourceCode":"        This method establishes a streaming connection to the target workflow\n        and processes the response in real-time, handling different output modes\n        and streaming content to dependent nodes when necessary.\n\n        :param url: SSE endpoint URL for the workflow API\n        :param inputs: Input parameters for the target workflow\n        :param variable_pool: Variable pool for workflow context\n        :param span: Tracing span for observability\n        :param msg_or_end_node_deps: Message dependencies for streaming output\n        :param event_log_node_trace: Optional node trace logging\n        :return: Tuple containing (outputs_dict, token_usage_dict)\n        :raises CustomException: When workflow execution fails or times out\n        \"\"\"\n        # Get the output mode configuration for the flow\n        output_mode = variable_pool.system_params.get(\n            ParamKey.FlowOutputMode, node_id=self.node_id\n        )\n        if output_mode is None:\n            raise CustomException(\n                err_code=CodeEnum.WORKFLOW_EXECUTION_ERROR,\n                cause_error=f\"Flow output mode not configured for flow_id: {self.flowId}\",\n            )\n\n        # Assemble request headers and body\n        headers, req_body = await self._assemble_request(\n            url, inputs, variable_pool, span, event_log_node_trace\n        )\n\n        # Initialize response containers\n        outputs = {}\n        token_usage = {}\n\n        try:\n            # Initialize content accumulators for streaming response\n            result_content = \"\"\n            result_reasoning_content = \"\"\n","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/flow/flow_node.py#L181-L217","documentation":"WORKFLOW_EXECUTION_ERROR from flow_node.req_flow_api_with_see: before invoking a sub-flow via API, the node reads FlowOutputMode from the variable pool's system params; if it is None the node cannot know how the sub-flow returns its output and aborts. It means the flow's output-mode parameter was never set in the execution context for this flow_id.","triggerScenarios":"Calling a sub-flow node when the parent execution did not populate ParamKey.FlowOutputMode in variable_pool.system_params — e.g. direct/debug invocation of the flow, a missing default when the flow was published without output-mode configuration, or programmatic invocation that skipped parameter injection.","commonSituations":"API/debug runs that bypass the normal publish pipeline; older flow definitions created before the output-mode setting existed; manual construction of system_params in tests or scripts omitting the key.","solutions":["Open the flow configuration and explicitly set its output mode (e.g. streaming vs. message-collection) and re-publish.","If invoking programmatically, set variable_pool.system_params[ParamKey.FlowOutputMode] before calling the flow node.","Update old flow definitions by re-saving them so the output-mode field gets a default.","Add validation at flow publish time to reject flows missing output mode, turning this into an earlier schema error."],"exampleFix":"# before: invoking flow without output mode\nawait flow_node.async_execute(variable_pool)\n# after: ensure the param exists\nfrom engine.params import ParamKey\nvariable_pool.system_params[ParamKey.FlowOutputMode] = FlowOutputMode.MESSAGE_COLLECTION\nawait flow_node.async_execute(variable_pool)","handlingStrategy":"validation","validationCode":"output_mode = variable_pool.system_params.get(ParamKey.FlowOutputMode, node_id=flow_node.node_id)\nif output_mode is None:\n    raise ValueError(\"FlowOutputMode must be set before invoking a flow node\")","typeGuard":null,"tryCatchPattern":"try:\n    output = await flow_node.async_execute(...)\nexcept CustomException as e:\n    if \"Flow output mode not configured\" in str(e.cause_error):\n        logger.error(\"set the flow's output mode in config and re-publish\")","preventionTips":["Always configure output mode when creating/publishing a flow","Set FlowOutputMode explicitly in programmatic/test invocations of flow nodes","Add publish-time schema validation requiring the output-mode field"],"tags":["workflow","configuration","subflow","missing-param"],"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"}