{"record":{"id":"391956784055c470","repo":"invoke-ai/InvokeAI","slug":"call-saved-workflow-batch-child-workflow-node-no-391956","errorCode":null,"errorMessage":"call_saved_workflow batch child workflow node '{node_id}' must provide at least one batch item","messagePattern":"call_saved_workflow batch child workflow node '(.+?)' must provide at least one batch item","errorType":"validation","errorClass":"UnsupportedWorkflowNodeError","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/session_processor/workflow_call_batch.py","lineNumber":605,"sourceCode":"            generator_node_type = generator_node[\"data\"].get(\"type\") if _is_invocation_node(generator_node) else None\n            if generator_node_type == \"image_generator\" and services is None and resolve_generator_items:\n                raise UnsupportedWorkflowNodeError(\n                    \"call_saved_workflow image-generator-backed batch child workflows require runtime services\"\n                )\n            batch_items = (\n                _resolve_generator_items(generator_node, services, user_id, maximum_children)\n                if resolve_generator_items\n                else _get_generator_placeholder_items(generator_node)\n            )\n            used_generator_node_ids.add(generator_source_id)\n            if not batch_items:\n                raise UnsupportedWorkflowNodeError(\n                    f\"call_saved_workflow generator-backed batch child workflow node '{generator_source_id}' produced no batch items\"\n                )\n        else:\n            batch_items = _get_batch_items(node_data, field_name)\n            if not batch_items:\n                raise UnsupportedWorkflowNodeError(\n                    f\"call_saved_workflow batch child workflow node '{node_id}' must provide at least one batch item\"\n                )\n        batch_group_id = _get_batch_group_id(node_data)\n        destinations = _resolve_batch_destinations(node_id, field_name, workflow_nodes, workflow_edges)\n        if not destinations:\n            raise UnsupportedWorkflowNodeError(\n                f\"call_saved_workflow batch child workflow node '{node_id}' is not connected to any invocation input\"\n            )\n        group_batch_data = batch_data_by_group.setdefault(batch_group_id, [])\n        for destination_node_id, destination_field in destinations:\n            group_batch_data.append(\n                BatchDatum(\n                    node_path=destination_node_id,\n                    field_name=destination_field,\n                    items=_normalize_batch_item_for_destination(destination_field, batch_items),\n                )\n            )\n","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/session_processor/workflow_call_batch.py#L587-L623","documentation":"A supported batch node in the called saved workflow has no generator wiring and its own batch field holds no items. InvokeAI cannot expand the batch node into child executions and raises UnsupportedWorkflowNodeError requiring at least one batch item.","triggerScenarios":"build_batch_child_workflow_session_results finds a node of a SUPPORTED_BATCH_TYPES type whose BATCH_FIELD_NAMES field (the collection field on node data) is empty or missing, and _resolve_batch_items_from_inputs found no connected generator.","commonSituations":"Editing a saved workflow and clearing the batch collection list; duplicating a batch node without copying its items; creating a batch node in the UI but forgetting to add entries; workflow JSON hand-edited and the collection field dropped.","solutions":["Open the saved workflow and populate the batch node's collection field with at least one item.","Wire a generator node (range, rand int, collection, image collection) into the batch node's input instead of leaving it standalone.","Validate the workflow before enqueueing: walk nodes of supported batch types and assert the collection field is non-empty.","Re-save the workflow from the editor so the batch items persist in the workflow record."],"exampleFix":"// before\n{\"id\":\"batch1\",\"data\":{\"type\":\"batch\",\"collection\":[]}}\n// after\n{\"id\":\"batch1\",\"data\":{\"type\":\"batch\",\"collection\":[\"img_a\",\"img_b\"]}}","handlingStrategy":"validation","validationCode":"def batch_nodes_have_items(workflow, supported_types, field_names):\n    for n in workflow.get(\"nodes\", []):\n        t = n.get(\"data\", {}).get(\"type\")\n        if t in supported_types:\n            if not n[\"data\"].get(field_names[t]):\n                return False\n    return True","typeGuard":"def has_batch_items(node, field) -> bool:\n    items = node.get(\"data\", {}).get(field)\n    return isinstance(items, (list, dict)) and len(items) > 0","tryCatchPattern":"try:\n    results = build_batch_child_workflow_session_results(...)\nexcept UnsupportedWorkflowNodeError as e:\n    if \"must provide at least one batch item\" in str(e):\n        raise WorkflowConfigError(node_id=extract_node_id(str(e))) from e","preventionTips":["Always populate the batch collection when adding a batch node in the editor","Re-save workflows from the editor after hand-editing JSON","Add pre-enqueue workflow validation for all supported batch nodes","Cover batch nodes in workflow export/import tests"],"tags":["invokeai","batch","workflow-call","validation"],"backgroundTag":"batch-node-missing-items","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}