## TL;DR
The name in your `connect()` call does not match any component added to the pipeline. Print the component names, fix the typo (or the wrong name), and make sure `add_component` runs before `connect`. Nine times out of ten the component exists in your code but was never registered, or the string is misspelled.

## Error
```text
component not found in pipeline
```
(raised by Pipeline.connect when a component name is not registered)

## Steps

1. List the components actually registered on the pipeline:
```python
print(list(pipeline.graph.nodes.keys()))
```
Expected output: the exact registered names. Compare them against the names in your `connect()` calls.

2. Register the missing component, then connect using the registered name:
```python
pipeline.add_component("retriever", retriever)
pipeline.connect("retriever.documents", "prompt_builder.documents")
```
Expected output: `connect` succeeds. The dotted form is "component_name.socket_name"; a typo in either half raises this error.

3. Check the order: every `add_component` must run before any `connect` that references it. Move connects after all adds if your setup code interleaves them.
Expected output: no ordering errors. Connecting to a component added later in the script still fails, because registration happens at call time.

4. Validate the full pipeline before running:
```python
pipeline.validate()
```
Expected output: no exception. Validation also catches unconnected mandatory inputs, which is the next most common wiring failure after this one.

## When to use
- `pipeline.connect` raises "component not found"
- You renamed a component and wiring broke
- A component built in a helper function never made it into the pipeline

## When not to use
- The component is found but a socket name is wrong (that is a different error about the socket)
- The pipeline runs but produces wrong results (that is logic, not wiring)
- You are using the YAML or marshal format (check the YAML keys instead)

## Variant phrasings

### connect fails on the second half of a dotted name
The component exists but the socket does not, e.g. "retriever.document" vs "retriever.documents". Check the component's output socket names.

### error after copying a pipeline example
Example code often renames components. Diff your names against the example's connect calls.

## Why it happens
Haystack resolves `connect()` arguments as plain strings against a registry populated by `add_component`. There is no compile-time link between the variable holding your component and the string you pass to connect, so typos, renames, and ordering mistakes only surface when connect runs.

## Edge cases
- Component names are case-sensitive and must be unique; adding two components with the same name silently replaces the first in some versions.
- Serialized pipeline round-trips can rename components if the serialized form was edited by hand.
- Custom components need the component decorator with declared sockets, or connect cannot see their inputs and outputs at all.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_v0quPIKX0nRn5SoI6hrFmg
