{"record":{"id":"92f81ed9793b2408","repo":"invoke-ai/InvokeAI","slug":"invalid-collector-node-node-id-err","errorCode":null,"errorMessage":"Invalid collector node ({node.id}): {err}","messagePattern":"Invalid collector node \\((.+?)\\): (.+?)","errorType":"validation","errorClass":"InvalidEdgeError","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/shared/graph.py","lineNumber":1860,"sourceCode":"            if not are_connections_compatible(\n                self.get_node(edge.source.node_id),\n                edge.source.field,\n                destination_node,\n                edge.destination.field,\n            ):\n                raise InvalidEdgeError(f\"Edge source and target types do not match ({edge})\")\n\n    def _validate_special_nodes(self) -> None:\n        # TODO: may need to validate all iterators & collectors in subgraphs so edge connections in parent graphs will be available\n        for node in self.nodes.values():\n            if isinstance(node, IterateInvocation):\n                err = self._is_iterator_connection_valid(node.id)\n                if err is not None:\n                    raise InvalidEdgeError(f\"Invalid iterator node ({node.id}): {err}\")\n            if isinstance(node, CollectInvocation):\n                err = self._is_collector_connection_valid(node.id)\n                if err is not None:\n                    raise InvalidEdgeError(f\"Invalid collector node ({node.id}): {err}\")\n\n    def validate_self(self) -> None:\n        \"\"\"\n        Validates the graph.\n\n        Raises an exception if the graph is invalid:\n        - `DuplicateNodeIdError`\n        - `NodeIdMismatchError`\n        - `InvalidSubGraphError`\n        - `NodeNotFoundError`\n        - `NodeFieldNotFoundError`\n        - `CyclicalGraphError`\n        - `InvalidEdgeError`\n        \"\"\"\n\n        self._validate_unique_node_ids()\n        self._validate_node_id_mapping()\n        self._validate_edge_nodes_and_fields()","sourceCodeStart":1842,"sourceCodeEnd":1878,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/shared/graph.py#L1842-L1878","documentation":"InvalidEdgeError raised in validate_self() for each CollectInvocation whose connections fail _is_collector_connection_valid(). A collector aggregates 'item'-typed edges into a collection, so all incoming edges must have the same type; the checker's err string is embedded in the message.","triggerScenarios":"validate_self() encountering a CollectInvocation with incoming item edges of differing/incompatible types, or malformed connections to its 'item'/'collection' fields (via _is_collector_connection_valid).","commonSituations":"Collecting outputs of heterogeneous nodes (image + string) into one collector, iterating a collection and feeding differently-typed branches into the same collector, hand-edited workflow JSON.","solutions":["Make every edge into the collector's 'item' field carry the same type","Split heterogeneous outputs into separate collectors","Add conversion nodes so all inputs share one type","Remove stale edges after refactoring the graph"],"exampleFix":"// before\ng.add_edge(image_node, \"image\", collector, \"item\")\ng.add_edge(prompt_node, \"prompt\", collector, \"item\")  # mixed types\n// after\ng.add_edge(img_a, \"image\", collector, \"item\")\ng.add_edge(img_b, \"image\", collector, \"item\")","handlingStrategy":"validation","validationCode":"def collector_inputs_ok(graph, collect_node_id):\n    return graph._is_collector_connection_valid(collect_node_id) is None\n\nfor node_id in g.nodes:\n    if isinstance(g.get_node(node_id), CollectInvocation):\n        assert collector_inputs_ok(g, node_id), node_id","typeGuard":"def is_valid_collector(graph, node) -> bool:\n    if not isinstance(node, CollectInvocation):\n        return False\n    return graph._is_collector_connection_valid(node.id) is None","tryCatchPattern":"from invokeai.app.services.shared.graph import InvalidEdgeError\n\ntry:\n    graph.validate_self()\nexcept InvalidEdgeError as e:\n    if \"Invalid collector node\" in str(e):\n        fix_collector_connections(e)\n    raise","preventionTips":["Feed a collector only edges of one identical item type","Split heterogeneous outputs into separate collectors","Validate graphs containing iterate/collect pairs as a unit"],"tags":["invokeai","graph-validation","collector","collect"],"backgroundTag":"invalid-collector-node","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}