{"record":{"id":"3bf7ed5dbd8b7d69","repo":"langflow-ai/langflow","slug":"e","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"http","errorClass":"CustomComponentValidationError","httpStatus":400,"severity":"error","filePath":"src/backend/base/langflow/agentic/services/flow_executor.py","lineNumber":145,"sourceCode":"        if global_variables:\n            if \"request_variables\" not in graph.context:\n                graph.context[\"request_variables\"] = {}\n            graph.context[\"request_variables\"].update(global_variables)\n\n        flow_id = (global_variables or {}).get(\"FLOW_ID\")\n        if flow_id:\n            graph.flow_id = flow_id\n        graph.flow_name = graph.flow_name or flow_filename\n\n        graph.prepare()\n        inputs = InputValueRequest(input_value=input_value) if input_value else None\n\n        results = [payload async for payload in get_default_coordinator().stream(graph, initial_inputs=inputs)]\n        flow_result = extract_structured_result(results)\n    except HTTPException:\n        raise\n    except CustomComponentValidationError as e:\n        raise HTTPException(status_code=400, detail=str(e)) from e\n    except ValueError as e:\n        logger.error(f\"Flow execution error: {e}\")\n        raise HTTPException(status_code=500, detail=\"An error occurred while executing the flow.\") from e\n    except Exception as e:\n        logger.error(f\"Flow execution error: {e}\")\n        raise HTTPException(status_code=500, detail=\"An internal error occurred while executing the flow.\") from e\n    else:\n        if isinstance(flow_result, dict):\n            flow_result[\"_metrics\"] = extract_graph_token_usage(graph)\n        return flow_result\n\n\nasync def execute_flow_file_streaming(\n    flow_filename: str,\n    input_value: str | None = None,\n    global_variables: dict[str, str] | None = None,\n    *,\n    user_id: str | None = None,","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/agentic/services/flow_executor.py#L127-L163","documentation":"This is the non-streaming flow executor's 400 branch: a CustomComponentValidationError escaping graph loading/preparation is converted to HTTPException(400, detail=str(e)) so the caller sees the actual validation message (class name extraction, I/O overlap, reserved output name, etc.). The detail is the raw validator message, safe to display to the author of the flow.","triggerScenarios":"POST /api/v1/agentic/execute/{flow_name} (or /assist) where the named flow embeds a custom component whose code fails validate_custom_component_code during load_graph_for_execution; the ValueError from validation is caught as CustomComponentValidationError and re-raised as 400.","commonSituations":"Editing a .py flow file and introducing one of the validator failures (no class, overlapping names, reserved 'tool' output name, output method without return); LLM-rewritten components that drift from the required structure.","solutions":["Read detail in the 400 response — it is the specific validator message; fix the reported issue in the component code.","For overlapping/reserved-name errors rename inputs/outputs per the message; for missing return statements add 'return <value>' to each output method.","Run the flow's component code through the local validator (langflow.agentic.helpers.validation) before deploying to the flows directory.","For generic ValueError/other exceptions the endpoint returns 500 instead — check server logs (logger.error 'Flow execution error') for the underlying cause."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = await execute_flow(name, input_value)\nexcept HTTPException as e:\n    if e.status_code == 400:\n        show_author_error(e.detail)  # validator message, safe to display\n    else:\n        raise","preventionTips":["Treat 400 details from agentic execute as authoring feedback and show them to flow authors.","Pre-validate custom component code with langflow.agentic.helpers.validation before deploying flows.","Keep a CI lint for flow files that runs the same validator."],"tags":["agentic","flow-execution","custom-component","http-400"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}