deepset-ai/haystack · error · InvalidMappingValueError

Component '{comp_name}' not found in pipeline inputs. Availa

Error message

Component '{comp_name}' not found in pipeline inputs.
Available components: {list(pipeline_inputs.keys())}

What it means

The component part of an input_mapping path must exist in the wrapped pipeline's inputs(). If the component name is unknown, InvalidMappingValueError is raised listing available components.

Source

Thrown at haystack/core/super_component/super_component.py:204

        Validates the input mapping to ensure that specified components and sockets exist in the pipeline.

        :param pipeline_inputs: A dictionary containing pipeline input specifications.
        :param input_mapping: A dictionary mapping wrapper input names to pipeline socket paths.
        :raises InvalidMappingTypeError:
            If the input mapping is of invalid type or contains invalid types.
        :raises InvalidMappingValueError:
            If the input mapping contains nonexistent components or sockets.
        """
        if not isinstance(input_mapping, dict):
            raise InvalidMappingTypeError("input_mapping must be a dictionary")

        for wrapper_input_name, pipeline_input_paths in input_mapping.items():
            if not isinstance(pipeline_input_paths, list):
                raise InvalidMappingTypeError(f"Input paths for '{wrapper_input_name}' must be a list of strings.")
            for path in pipeline_input_paths:
                comp_name, socket_name = self._split_component_path(path)
                if comp_name not in pipeline_inputs:
                    raise InvalidMappingValueError(
                        f"Component '{comp_name}' not found in pipeline inputs.\n"
                        f"Available components: {list(pipeline_inputs.keys())}"
                    )
                if socket_name not in pipeline_inputs[comp_name]:
                    raise InvalidMappingValueError(
                        f"Input socket '{socket_name}' not found in component '{comp_name}'.\n"
                        f"Available inputs for '{comp_name}': {list(pipeline_inputs[comp_name].keys())}"
                    )

    def _resolve_input_types_from_mapping(
        self, pipeline_inputs: dict[str, dict[str, Any]], input_mapping: dict[str, list[str]]
    ) -> dict[str, dict[str, Any]]:
        """
        Resolves and validates input types based on the provided input mapping.

        This function ensures that all mapped pipeline inputs are compatible, consolidating types
        when multiple mappings exist. It also determines whether an input is mandatory or has a default value.

View on GitHub (pinned to e318778c9b)

Solutions

  1. Use the exact component name from pipeline.inputs() in the path
  2. List available names by printing pipe.inputs().keys() and fix the mapping

Example fix

// before
input_mapping = {"text": ["embedder.text"]}  # component is named 'text_embedder'
// after
input_mapping = {"text": ["text_embedder.text"]}
Defensive patterns

Strategy: validation

Validate before calling

def check_components(pipe, input_mapping):
    available = set(pipe.inputs().keys())
    for paths in input_mapping.values():
        for p in paths:
            comp = p.split(".")[0]
            if comp not in available:
                raise ValueError(f"'{comp}' not in pipeline components: {sorted(available)}")

Type guard

def component_exists(pipe, path: str) -> bool:
    return path.split(".")[0] in pipe.inputs()

Try / catch

from haystack.core.errors import InvalidMappingValueError
try:
    super_comp = SuperComponent(pipeline=pipe, input_mapping=input_mapping)
except InvalidMappingValueError as e:
    if "not found in pipeline inputs" in str(e):
        print("Available components:", list(pipe.inputs().keys()))
    else:
        raise

Prevention

When it happens

Trigger: input_mapping path references a component name not added to the pipeline, or misspelled, e.g. ["embedder.text"] when the component is named 'text_embedder'.

Common situations: Renaming a component via add_component(name=...) without updating the mapping; typos; copying mappings between pipelines with different component names.

Related errors


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