invoke-ai/InvokeAI · error · UnsupportedWorkflowNodeError

call_saved_workflow batch child workflow node inputs are mal

Error message

call_saved_workflow batch child workflow node inputs are malformed

What it means

The batch node's data.inputs in the called child workflow is missing or not a mapping, so _get_batch_items cannot look up the batch field. InvokeAI requires each batch node's saved workflow JSON to contain a well-formed inputs dict; when it doesn't, expansion cannot proceed and raises UnsupportedWorkflowNodeError.

Source

Thrown at invokeai/app/services/session_processor/workflow_call_batch.py:212

def _get_batch_group_id(node_data: Mapping[str, Any]) -> str:
    inputs = node_data.get("inputs")
    if not _is_mapping(inputs):
        return "None"
    batch_group_input = inputs.get("batch_group_id")
    if not _is_mapping(batch_group_input):
        return "None"
    batch_group_id = batch_group_input.get("value")
    if not isinstance(batch_group_id, str):
        return "None"
    if batch_group_id not in SUPPORTED_BATCH_GROUP_IDS:
        raise UnsupportedWorkflowNodeError(f"Unsupported batch group id '{batch_group_id}' in called workflow")
    return batch_group_id


def _get_batch_items(node_data: Mapping[str, Any], field_name: str) -> list[Any]:
    inputs = node_data.get("inputs")
    if not _is_mapping(inputs):
        raise UnsupportedWorkflowNodeError("call_saved_workflow batch child workflow node inputs are malformed")
    batch_input = inputs.get(field_name)
    if not _is_mapping(batch_input):
        raise UnsupportedWorkflowNodeError(
            f"call_saved_workflow batch child workflow node is missing required '{field_name}' input"
        )
    batch_items = batch_input.get("value")
    if not isinstance(batch_items, list):
        raise UnsupportedWorkflowNodeError(
            f"call_saved_workflow batch child workflow node '{node_data.get('id')}' must provide a direct list for '{field_name}'"
        )
    return batch_items


def _parse_split_values(input_value: str, split_on: str) -> list[str]:
    if split_on == "":
        return [input_value]
    try:
        return input_value.split(json.loads(f'"{split_on}"'))

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Fix the workflow JSON so each batch node has data.inputs as an object containing the expected field (images/strings/integers/floats)
  2. Re-export the workflow from the InvokeAI canvas rather than hand-editing
  3. Connect the batch node's field input to a generator node so the direct-input path is never taken
  4. Migrate/upgrade: check the InvokeAI changelog for node schema changes and re-save the workflow

Example fix

// before
"data": { "id": "abc", "type": "string_batch" }
// after
"data": { "id": "abc", "type": "string_batch", "inputs": { "strings": { "value": ["a", "b"] } } }
Defensive patterns

Strategy: type-guard

Validate before calling

def batch_nodes_have_inputs(workflow: dict) -> list[str]:
    bad = []
    for node in workflow.get("nodes", []):
        if isinstance(node, dict) and node.get("type") == "invocation":
            d = node.get("data", {})
            if d.get("type") in {"image_batch", "string_batch", "integer_batch", "float_batch"} and not isinstance(d.get("inputs"), dict):
                bad.append(str(d.get("id")))
    return bad

Type guard

from collections.abc import Mapping

def has_valid_inputs(node: object) -> bool:
    return (isinstance(node, dict) and isinstance(node.get("data"), Mapping)
            and isinstance(node["data"].get("inputs"), Mapping))

Try / catch

try:
    sessions = build_batch_child_workflow_sessions(...)
except UnsupportedWorkflowNodeError as e:
    if "node inputs are malformed" in str(e):
        workflow = reexport_workflow_from_canvas(workflow_id)  # regenerate correct JSON
        sessions = build_batch_child_workflow_sessions(...)
    else:
        raise

Prevention

When it happens

Trigger: Calling a saved workflow whose image_batch/string_batch/integer_batch/float_batch node has data.inputs absent, null, an array, or otherwise not a JSON object — typically because the node was not connected to a generator and its direct value path is being read.

Common situations: Hand-written or programmatically generated workflow JSON missing the inputs block; corrupt/truncated workflow export; a node type renamed/reshaped between InvokeAI versions leaving stale node data.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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