{"record":{"id":"ff29dc06c87fb405","repo":"FlowiseAI/Flowise","slug":"error","errorCode":null,"errorMessage":"${error}","messagePattern":"\\$\\{error\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts","lineNumber":325,"sourceCode":"                        }\n                    ]\n                },\n                error: {\n                    name: error.name || 'Error',\n                    message: error.message || 'An error occurred during the execution of the flow'\n                },\n                state\n            }\n\n            // Add more error details if available\n            if (error.response) {\n                errorResponse.error.status = error.response.status\n                errorResponse.error.statusText = error.response.statusText\n                errorResponse.error.data = error.response.data\n                errorResponse.error.headers = error.response.headers\n            }\n\n            throw new Error(error)\n        }\n    }\n}\n\nmodule.exports = { nodeClass: ExecuteFlow_Agentflow }\n","sourceCodeStart":307,"sourceCodeEnd":331,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts#L307-L331","documentation":"Thrown at the tail of ExecuteFlow_Agentflow.run()'s catch block when any error occurs while executing a nested agentflow. The block builds a detailed errorResponse object (status, headers, data) but then discards it, throwing `new Error(error)` where `error` is the caught Error. `new Error(error)` coerces the Error to a string (\"Error: <message>\"), destroying the stack trace and the structured detail that was just assembled. The real failure is some downstream node/HTTP call inside the executed flow.","triggerScenarios":"Any exception bubbling out of the inner flow execution (a child node throws, an LLM/HTTP call fails, a tool errors). The catch at ExecuteFlow.ts:295 catches it, logs `ExecuteFlow Error:`, and re-throws the stringified form.","commonSituations":"A sub-flow node is misconfigured; a downstream HTTP/LLM node returns a non-2xx; a referenced credential is missing inside the child flow. Because the structured errorResponse is thrown away, operators only see the opaque message and must read server logs.","solutions":["Inspect server logs for the preceding `ExecuteFlow Error:` line which prints the original error with stack.","Test the child flow in isolation to find which inner node is actually failing.","Fix the reported downstream error (HTTP status, missing credential, bad model config).","Patch the throw to preserve causality: `throw new Error(error instanceof Error ? error.message : String(error), { cause: error })` so the stack and the assembled errorResponse are not lost."],"exampleFix":"// before\n            throw new Error(error)\n// after\n            throw new Error(error instanceof Error ? error.message : String(error), { cause: error })","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Caller of ExecuteFlow_Agentflow.run()\ntry {\n  const out = await execFlowNode.run(nodeData, input, options)\n} catch (e) {\n  // message is stringified original; check server log line 'ExecuteFlow Error:' for the cause\n  const cause = (e as Error).message\n  if (cause.startsWith('Error: ')) {\n    // stack was lost — surface to user and check logs\n  }\n  throw e\n}","preventionTips":["Validate child flow nodes (credentials, model, URL) before composing them into an ExecuteFlow.","Run each sub-flow standalone before wiring it into ExecuteFlow.","Keep server logging at debug during flow development to capture the original error."],"tags":["agentflow","error-wrapping","stack-trace-loss","execute-flow"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}