{"record":{"id":"b1f9a897a9a74920","repo":"invoke-ai/InvokeAI","slug":"field-batch-data-field-name-not-found-in-node-b","errorCode":null,"errorMessage":"Field {batch_data.field_name} not found in node {batch_data.node_path}","messagePattern":"Field (.+?) not found in node (.+?)","errorType":"validation","errorClass":"NodeNotFoundError","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/session_queue/session_queue_common.py","lineNumber":150,"sourceCode":"            for datum in batch_data_list:\n                pair = (datum.node_path, datum.field_name)\n                if pair in paths:\n                    raise BatchDuplicateNodeFieldError(\"Each batch data must have unique node_id and field_name\")\n                paths.add(pair)\n        return v\n\n    @model_validator(mode=\"after\")\n    def validate_batch_nodes_and_edges(self):\n        if self.data is None:\n            return self\n        for batch_data_list in self.data:\n            for batch_data in batch_data_list:\n                try:\n                    node = self.graph.get_node(batch_data.node_path)\n                except NodeNotFoundError:\n                    raise NodeNotFoundError(f\"Node {batch_data.node_path} not found in graph\")\n                if batch_data.field_name not in type(node).model_fields:\n                    raise NodeNotFoundError(f\"Field {batch_data.field_name} not found in node {batch_data.node_path}\")\n        return self\n\n    @field_validator(\"graph\")\n    def validate_graph(cls, v: Graph):\n        v.validate_self()\n        return v\n\n    model_config = ConfigDict(\n        json_schema_extra={\n            \"required\": [\n                \"graph\",\n                \"runs\",\n            ]\n        }\n    )\n\n\n# endregion Batch","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/session_queue/session_queue_common.py#L132-L168","documentation":"Beyond node existence, each batch datum's field_name must be an actual field of the referenced node's Pydantic model (checked via type(node).model_fields). NodeNotFoundError('Field <name> not found in node <id>') is raised when the node exists but has no such field.","triggerScenarios":"A batch datum targets an existing node but with a field_name the node type doesn't define — e.g. field 'prompt' on an image node, misspelled field names, or fields removed/renamed by a node version change.","commonSituations":"Typo in field_name; switching a node to a different type after saving batch data; upgrading InvokeAI where a node field was renamed; copying batch data between different node types.","solutions":["Correct the field_name to match a real field on the node's model (check the node's schema in the editor)","Re-create the batch binding using the node's current field names after any upgrade","Ensure the node is of the intended type (a type change invalidates old field bindings)","Validate with batch_data.field_name in type(graph.get_node(node_path)).model_fields before enqueuing"],"exampleFix":"// before\n{\"node_path\": \"denoise\", \"field_name\": \"promt\"}\n// after\n{\"node_path\": \"denoise\", \"field_name\": \"prompt\"}","handlingStrategy":"validation","validationCode":"def validate_batch_fields(batch, graph):\n    for batch_data_list in batch.data or []:\n        for d in batch_data_list:\n            node = graph.get_node(d.node_path)\n            if d.field_name not in type(node).model_fields:\n                raise ValueError(f\"Field '{d.field_name}' not on node '{d.node_path}' ({type(node).__name__}).\")","typeGuard":"def field_exists(batch_datum, graph) -> bool:\n    node = graph.get_node(batch_datum.node_path)\n    return batch_datum.field_name in type(node).model_fields","tryCatchPattern":"try:\n    session_queue.enqueue_queue_item(batch_session)\nexcept NodeNotFoundError as e:\n    logger.error(f\"Invalid field binding: {e}\")\n    # fix field_name against the node's current schema","preventionTips":["Check the node's schema/field list in the editor before binding batch data","Re-bind batch fields after upgrading InvokeAI (fields may be renamed)","Never copy batch bindings between different node types","Spell-check field_name against type(node).model_fields in scripts"],"tags":["batch","graph","validation"],"backgroundTag":"batch-field-not-in-node","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}