langflow-ai/langflow · error · ValueError
Inputs and outputs have overlapping names: {overlap}
Error message
Inputs and outputs have overlapping names: {overlap} What it means
Thrown by validate_custom_component_code when the extracted set of input names intersects the extracted set of output names for the component class. Langflow's runtime binds inputs and outputs as attributes on the same component instance, so a shared name would let one overwrite the other. Surfaced as HTTP 400 via CustomComponentValidationError.
Source
Thrown at src/backend/base/langflow/agentic/helpers/validation.py:343
4. Output methods have return statements with values
5. No reserved output names/methods that would collide with the
synthetic Tool sentinel (``component_as_tool`` / ``to_toolkit``).
"""
class_name = _safe_extract_class_name(code)
try:
if class_name is None:
msg = "Could not extract class name from code"
raise ValueError(msg)
tree = ast.parse(code)
compile(ast.Module(body=tree.body, type_ignores=[]), "<string>", "exec")
input_names, output_names = _extract_io_names(tree, class_name)
overlap = input_names & output_names
if overlap:
msg = f"Inputs and outputs have overlapping names: {overlap}"
raise ValueError(msg)
if _RESERVED_OUTPUT_NAME in output_names:
return ValidationResult(
is_valid=False,
code=code,
error=(
f"Output name {_RESERVED_OUTPUT_NAME!r} is reserved by Langflow for the "
"synthetic Tool sentinel that the wiring layer auto-generates when a "
"component is flipped to Tool Mode. Declaring it on your own Output "
"collides with that sentinel and the runtime will drop your tool. "
"Pick a name describing the produced value (e.g. 'item', 'price', 'result')."
),
class_name=class_name,
)
output_methods = _extract_output_methods(tree, class_name)
if _RESERVED_OUTPUT_METHOD in output_methods:
return ValidationResult(View on GitHub (pinned to 976ec789d2)
Solutions
- Rename either the input or the output so the sets are disjoint — the error detail lists the exact overlapping names.
- Adopt a convention: input names describe parameters (e.g. 'input_text'), output names describe products (e.g. 'result_text').
- Re-run the flow after the edit; validation happens before execution so the fix takes effect immediately.
Example fix
# before inputs = [MessageTextInput(name='data')] outputs = [Output(name='data', method='run')] # after inputs = [MessageTextInput(name='data')] outputs = [Output(name='result', method='run')]
Defensive patterns
Strategy: validation
Validate before calling
import ast
def io_names_disjoint(code: str) -> bool:
tree = ast.parse(code)
# crude mirror of _extract_io_names: collect names in inputs=[...] and outputs=[...]
def names(target):
for node in ast.walk(tree):
if isinstance(node, ast.Call) and getattr(node.func, 'id', '') == target:
return {kw.value.value for kw in node.keywords if kw.arg == 'name'}
return set()
return not (names('MessageTextInput') & names('Output')) or True # use langflow's own validator when available Try / catch
Catch CustomComponentValidationError / the 400 detail matching /overlapping names: ({.*})/, parse the set from the message, and rename the listed outputs. Prevention
- Use distinct naming conventions: inputs describe parameters, outputs describe products.
- Run flows through the canvas editor's validation before deploying to the flows directory.
- Add a lint step for generated components that checks input/output name disjointness.
When it happens
Trigger: A custom component in an executed agentic flow declares e.g. inputs=[MessageTextInput(name='data')] and outputs=[Output(name='data', method='...')]; the validator computes input_names & output_names and any non-empty overlap raises with the conflicting names listed.
Common situations: LLM-generated components that reuse a generic name like 'result' or 'text' on both sides; renaming an output to match its input for 'clarity'; copy-pasting a component and changing only one side of the naming.
Related errors
- Could not extract class name from code
- Invalid path
- Provider '{provider}' is not configured. Available providers
- {e}
- Failed to install MCP
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/509735be6d60d981.
Report an issue: GitHub.