deepset-ai/haystack · error · ValueError
Component named {receiver_component_name} not found in the p
Error message
Component named {receiver_component_name} not found in the pipeline. What it means
Pipeline.connect() raises ValueError when the receiver component name is not a node in the pipeline graph. The lookup `self.graph.nodes[receiver_component_name]['input_sockets']` raises KeyError, which is re-raised as a ValueError. It means the second argument to connect() references a component that was never added via pipeline.add_component().
Source
Thrown at haystack/core/pipeline/base.py:630
If the two components cannot be connected (for example if one of the components is
not present in the pipeline, or the connections don't match by type, and so on).
"""
# Edges may be named explicitly by passing 'node_name.edge_name' to connect().
sender_component_name, sender_socket_name = parse_connect_string(sender)
receiver_component_name, receiver_socket_name = parse_connect_string(receiver)
if sender_component_name == receiver_component_name:
raise PipelineConnectError("Connecting a Component to itself is not supported.")
# Get the nodes data.
try:
sender_sockets = self.graph.nodes[sender_component_name]["output_sockets"]
except KeyError as exc:
raise ValueError(f"Component named {sender_component_name} not found in the pipeline.") from exc
try:
receiver_sockets = self.graph.nodes[receiver_component_name]["input_sockets"]
except KeyError as exc:
raise ValueError(f"Component named {receiver_component_name} not found in the pipeline.") from exc
if not sender_sockets:
raise PipelineConnectError(
f"'{sender_component_name}' does not have any output connections. "
f"Please check that the output types of '{sender_component_name}.run' are set, "
f"for example by using the '@component.output_types' decorator."
)
# If the name of either socket is given, get the socket
sender_socket: OutputSocket | None = None
if sender_socket_name:
sender_socket = sender_sockets.get(sender_socket_name)
if not sender_socket:
raise PipelineConnectError(
f"'{sender}' does not exist. "
f"Output connections of {sender_component_name} are: "
+ ", ".join([f"{name} (type {_type_name(socket.type)})" for name, socket in sender_sockets.items()])
)View on GitHub (pinned to e318778c9b)
Solutions
- Add the receiver component first: pipeline.add_component('receiver', SomeComponent())
- Print pipeline.list_component_names() (or the graph nodes) and fix the receiver name in connect()
- Check for typos or string interpolation errors in the receiver name
- Verify you are using the same Pipeline instance for both add_component and connect
Example fix
// before
pipeline = Pipeline()
pipeline.add_component('retriever', InMemoryEmbeddingRetriever(embedding_retriever))
pipeline.connect('retriever', 'writter') # typo
// after
pipeline.add_component('writer', TextWriter())
pipeline.connect('retriever', 'writer') Defensive patterns
Strategy: validation
Validate before calling
names = pipeline.list_component_names()
assert receiver_name in names, f"{receiver_name!r} not in pipeline; available: {names}"
pipeline.connect(sender_name, receiver_name) Type guard
def has_component(pipeline, name: str) -> bool:
return name in pipeline.list_component_names() Try / catch
try:
pipeline.connect(sender, receiver)
except ValueError as e:
logger.error('Connect failed: %s; components: %s', e, pipeline.list_component_names()) Prevention
- Use constants or variables for component names instead of raw strings
- Call pipeline.add_component for every component before any connect call
- Print pipeline.list_component_names() when debugging
- Avoid typos with a small factory that registers and returns names
When it happens
Trigger: Calling pipeline.connect('sender', 'receiver') where 'receiver' was never added, or a typo in the receiver name, or the component was removed with remove_component() before connecting.
Common situations: Typos in component names; refactoring/renaming a component string; forgetting to add a component (especially in loops or conditional code); connecting components across two different pipeline instances.
Related errors
- Component named {name} not found in the pipeline.
- Component named '${component_name}' not found in the pipelin
- Input '${input_name}' not found in component '${component_na
- MarkdownHeaderSplitter only works with text documents but co
- Missing 'type' in component '{name}'
AI-assisted analysis of deepset-ai/haystack@e318778c9b (2026-08-30).
Data as JSON: /api/errors/3f49e1704af891c6.
Report an issue: GitHub.