deepset-ai/haystack · error · ValueError

Component named '${component_name}' not found in the pipelin

Error message

Component named '${component_name}' not found in the pipeline.

What it means

Pipeline.validate_input() (invoked by run()/run_async_generator()) raises ValueError when a top-level key in the run data dict is not a component in the pipeline. Inputs are keyed by component name; an unknown key means either a typo or input intended for a component that isn't in this pipeline.

Source

Thrown at haystack/core/pipeline/base.py:1145

        """
        Validates pipeline input data.

        Validates that data:
        * Each Component name actually exists in the Pipeline
        * Each Component is not missing any input
        * Each Component has only one input per input socket, if not variadic
        * Each Component doesn't receive inputs that are already sent by another Component

        :param data:
            A dictionary of inputs for the pipeline's components. Each key is a component name.

        :raises ValueError:
            If inputs are invalid according to the above.
        """
        for component_name, component_inputs in data.items():
            # Check that the component exists
            if component_name not in self.graph.nodes:
                raise ValueError(f"Component named '{component_name}' not found in the pipeline.")
            # Check that no input is provided that the component can't accept
            instance = self.graph.nodes[component_name]["instance"]
            for input_name in component_inputs.keys():
                if input_name not in instance.__haystack_input__._sockets_dict:
                    raise ValueError(f"Input '{input_name}' not found in component '{component_name}'.")

        for component_name in self.graph.nodes:
            instance = self.graph.nodes[component_name]["instance"]
            for socket_name, socket in instance.__haystack_input__._sockets_dict.items():
                component_inputs = data.get(component_name, {})
                # Check that no mandatory input is missing for any component in the pipeline
                if socket.senders == [] and socket.is_mandatory and socket_name not in component_inputs:
                    raise ValueError(f"Missing mandatory input '{socket_name}' for component '{component_name}'.")

                # Check if an input is provided more than once for non-variadic sockets
                if socket.senders and socket_name in component_inputs:
                    self._make_socket_auto_variadic(
                        component_name=component_name, receiver_socket=socket, error_type=ValueError

View on GitHub (pinned to e318778c9b)

Solutions

  1. Key run() inputs by exact component name: pipeline.run({'comp': {'input': value}})
  2. Check the component names via pipeline.list_component_names() and fix the data dict keys
  3. If the component was removed/renamed, update the run() inputs accordingly

Example fix

// before
pipeline.run({'question': 'What is AI?'})
// after
pipeline.run({'prompt_builder': {'question': 'What is AI?'}})
Defensive patterns

Strategy: validation

Validate before calling

names = pipeline.list_component_names()
for comp_name in data.keys():
    assert comp_name in names, f"run() key {comp_name!r} is not a component; available: {names}"

Type guard

def run_inputs_valid(pipeline, data: dict) -> bool:
    names = pipeline.list_component_names()
    return all(k in names for k in data)

Try / catch

try:
    result = pipeline.run(data)
except ValueError as e:
    if 'not found in the pipeline' in str(e):
        logger.error('%s; components: %s', e, pipeline.list_component_names())

Prevention

When it happens

Trigger: pipeline.run({'component_name': {'input': value}}) where 'component_name' is misspelled, was removed from the pipeline, or the caller mixed up component names and input parameter names.

Common situations: Passing run inputs flat (run({'prompt': ...})) instead of nested per-component; renaming a component in add_component but not updating run() call sites; building inputs dynamically from config with stale names.

Related errors


AI-assisted analysis of deepset-ai/haystack@e318778c9b (2026-08-30). Data as JSON: /api/errors/96a7fe70651f9dd5. Report an issue: GitHub.