{"record":{"id":"8c9470d11ffd073d","repo":"deepset-ai/haystack","slug":"failed-to-perform-conversion-between-components-n","errorCode":null,"errorMessage":"Failed to perform conversion between components:\\nSender component: '${component_name}' (type: '${sender_type_name}')\\nSender socket: '${sender_socket.name}'\\nReceiver component: '${receiver_name}' (type: '${receiver_type_name}')\\nReceiver socket: '${receiver_socket.name}'\\nError: {e}","messagePattern":"Failed to perform conversion between components:\\\\nSender component: '(.+?)' \\(type: '(.+?)'\\)\\\\nSender socket: '(.+?)'\\\\nReceiver component: '(.+?)' \\(type: '(.+?)'\\)\\\\nReceiver socket: '(.+?)'\\\\nError: (.+?)","errorType":"exception","errorClass":"PipelineRuntimeError","httpStatus":null,"severity":"error","filePath":"haystack/core/pipeline/base.py","lineNumber":1692,"sourceCode":"                    value = _convert_value(value=value, conversion_strategy=conversion_strategy)\n                except Exception as e:\n                    sender_node = self.graph.nodes.get(component_name)\n                    sender_instance = sender_node.get(\"instance\") if sender_node else None\n                    sender_type_name = type(sender_instance).__name__ if sender_instance else \"unknown\"\n\n                    receiver_node = self.graph.nodes.get(receiver_name)\n                    receiver_instance = receiver_node.get(\"instance\") if receiver_node else None\n                    receiver_type_name = type(receiver_instance).__name__ if receiver_instance else \"unknown\"\n\n                    msg = (\n                        f\"Failed to perform conversion between components:\\n\"\n                        f\"Sender component: '{component_name}' (type: '{sender_type_name}')\\n\"\n                        f\"Sender socket: '{sender_socket.name}'\\n\"\n                        f\"Receiver component: '{receiver_name}' (type: '{receiver_type_name}')\\n\"\n                        f\"Receiver socket: '{receiver_socket.name}'\\n\"\n                        f\"Error: {e}\"\n                    )\n                    raise PipelineRuntimeError(component_name=None, component_type=None, message=msg) from e\n\n            if receiver_name not in inputs:\n                inputs[receiver_name] = {}\n\n            if receiver_socket.is_lazy_variadic:\n                # If the receiver socket is lazy variadic, we append the new input.\n                # Lazy variadic sockets can collect multiple inputs.\n                _write_to_lazy_variadic_socket(\n                    inputs=inputs,\n                    receiver_name=receiver_name,\n                    receiver_socket_name=receiver_socket.name,\n                    component_name=component_name,\n                    value=value,\n                )\n            else:\n                # If the receiver socket is not lazy variadic, it is greedy variadic or non-variadic.\n                # We overwrite with the new input if it's not a _NoOutputProduced marker, or if the current value\n                # is None.","sourceCodeStart":1674,"sourceCodeEnd":1710,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/pipeline/base.py#L1674-L1710","documentation":"PipelineBase._write_component_outputs wraps any exception raised while converting a sender component's output to the receiver socket's expected type into a PipelineRuntimeError with a detailed sender/receiver diagnostic. The underlying cause (the chained exception) is usually a type-conversion failure between mismatched connected sockets.","triggerScenarios":"pipeline.connect() between sockets of incompatible types where output type adaptation fails at runtime; a component's run() returns a value whose type does not match the declared output socket type of the connected receiver input.","commonSituations":"Connecting a custom component whose declared output type drifted from the receiver's declared input type after refactoring; returning a List[str] where the receiver expects a Document list; third-party components updated to new types without updating connections.","solutions":["Read the chained 'Error: ...' cause to identify the actual conversion failure, then fix the producing component's output to match the declared receiver input type.","Update the component's @component.output_types declaration to reflect the real returned type, and re-run.","Reconnect with a compatible socket or insert an adapter component that converts between the two types."],"exampleFix":"// before\n@component\nclass MyComp:\n    @component.output_types\n    def run(self) -> dict[str, str]: ...  # returns list[str]\n// after\n@component\nclass MyComp:\n    @component.output_types\n    def run(self) -> list[str]: ...","handlingStrategy":"try-catch","validationCode":"from haystack.core.type_utils import _type_name\nsender_out = pipeline.graph.edges[\"a\", \"b\"][\"conn_type\"]\n# check declared types align before running\nassert sender_out is not None, \"connected sockets have incompatible types\"","typeGuard":"def types_compatible(sender_type, receiver_type) -> bool:\n    try:\n        return receiver_type in {sender_type} or issubclass(sender_type, receiver_type)\n    except TypeError:\n        return sender_type == receiver_type","tryCatchPattern":"try:\n    result = pipeline.run(data)\nexcept PipelineRuntimeError as e:\n    logger.error(\"Conversion failed between components: %s\", e)","preventionTips":["Keep output_types declarations in sync with actual returned values","Insert adapter components when connecting differently-typed sockets","Write a smoke test that runs the full pipeline once with sample data"],"tags":["haystack","pipeline","type-conversion","runtime"],"backgroundTag":"type-mismatch","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}