invoke-ai/InvokeAI · error · NodeNotFoundError

Field {batch_data.field_name} not found in node {batch_data.

Error message

Field {batch_data.field_name} not found in node {batch_data.node_path}

What it means

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.

Source

Thrown at invokeai/app/services/session_queue/session_queue_common.py:150

            for datum in batch_data_list:
                pair = (datum.node_path, datum.field_name)
                if pair in paths:
                    raise BatchDuplicateNodeFieldError("Each batch data must have unique node_id and field_name")
                paths.add(pair)
        return v

    @model_validator(mode="after")
    def validate_batch_nodes_and_edges(self):
        if self.data is None:
            return self
        for batch_data_list in self.data:
            for batch_data in batch_data_list:
                try:
                    node = self.graph.get_node(batch_data.node_path)
                except NodeNotFoundError:
                    raise NodeNotFoundError(f"Node {batch_data.node_path} not found in graph")
                if batch_data.field_name not in type(node).model_fields:
                    raise NodeNotFoundError(f"Field {batch_data.field_name} not found in node {batch_data.node_path}")
        return self

    @field_validator("graph")
    def validate_graph(cls, v: Graph):
        v.validate_self()
        return v

    model_config = ConfigDict(
        json_schema_extra={
            "required": [
                "graph",
                "runs",
            ]
        }
    )


# endregion Batch

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Correct the field_name to match a real field on the node's model (check the node's schema in the editor)
  2. Re-create the batch binding using the node's current field names after any upgrade
  3. Ensure the node is of the intended type (a type change invalidates old field bindings)
  4. Validate with batch_data.field_name in type(graph.get_node(node_path)).model_fields before enqueuing

Example fix

// before
{"node_path": "denoise", "field_name": "promt"}
// after
{"node_path": "denoise", "field_name": "prompt"}
Defensive patterns

Strategy: validation

Validate before calling

def validate_batch_fields(batch, graph):
    for batch_data_list in batch.data or []:
        for d in batch_data_list:
            node = graph.get_node(d.node_path)
            if d.field_name not in type(node).model_fields:
                raise ValueError(f"Field '{d.field_name}' not on node '{d.node_path}' ({type(node).__name__}).")

Type guard

def field_exists(batch_datum, graph) -> bool:
    node = graph.get_node(batch_datum.node_path)
    return batch_datum.field_name in type(node).model_fields

Try / catch

try:
    session_queue.enqueue_queue_item(batch_session)
except NodeNotFoundError as e:
    logger.error(f"Invalid field binding: {e}")
    # fix field_name against the node's current schema

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/b1f9a897a9a74920. Report an issue: GitHub.