{"record":{"id":"25433e33a6e266d8","repo":"invoke-ai/InvokeAI","slug":"call-saved-workflow-input-input-name-targets-m","errorCode":null,"errorMessage":"call_saved_workflow input '{input_name}' targets missing child workflow node '{node_id}'","messagePattern":"call_saved_workflow input '(.+?)' targets missing child workflow node '(.+?)'","errorType":"validation","errorClass":"InvalidWorkflowInputError","httpStatus":400,"severity":"error","filePath":"invokeai/app/services/shared/workflow_graph_builder.py","lineNumber":127,"sourceCode":"\n    return fallback_inputs\n\n\ndef apply_workflow_inputs_to_workflow(workflow: MutableMapping[str, Any], workflow_inputs: Mapping[str, Any]) -> None:\n    if not workflow_inputs:\n        return\n\n    allowed_inputs = get_exposed_workflow_input_names(workflow)\n    for input_name, value in workflow_inputs.items():\n        if input_name not in allowed_inputs:\n            raise InvalidWorkflowInputError(\n                f\"call_saved_workflow input '{input_name}' is not exposed by the selected workflow\"\n            )\n\n        node_id, field_name = parse_call_saved_workflow_dynamic_input(input_name)\n        workflow_nodes = workflow.get(\"nodes\", [])\n        if not isinstance(workflow_nodes, list):\n            raise InvalidWorkflowInputError(\n                f\"call_saved_workflow input '{input_name}' targets missing child workflow node '{node_id}'\"\n            )\n        matching_node = next(\n            (\n                node\n                for node in workflow_nodes\n                if _is_mapping(node)\n                and _is_mapping(node.get(\"data\"))\n                and node.get(\"id\") == node_id\n                and node[\"data\"].get(\"id\") == node_id\n            ),\n            None,\n        )\n        if matching_node is None:\n            raise InvalidWorkflowInputError(\n                f\"call_saved_workflow input '{input_name}' targets missing child workflow node '{node_id}'\"\n            )\n        matching_node_data = matching_node[\"data\"]","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/shared/workflow_graph_builder.py#L109-L145","documentation":"The workflow's 'nodes' entry could not be read as a list (or is absent in the expected shape), so a call_saved_workflow input cannot target any node. The builder raises because the saved workflow document is structurally malformed for node lookup.","triggerScenarios":"apply_workflow_inputs_to_workflow parses input name to (node_id, field_name), then workflow.get(\"nodes\", []) is not a list; raising before any node matching is attempted.","commonSituations":"Saved workflow JSON was hand-edited or corrupted so 'nodes' is an object/string; an older or foreign export format lacks a proper nodes array; programmatically constructed workflow dicts with wrong shape.","solutions":["Fix the saved workflow so 'nodes' is a list of node objects (re-export from the workflow editor).","Re-save the workflow through the UI/API instead of hand-editing JSON.","Validate the workflow document shape before passing it to the builder."],"exampleFix":"// before (corrupted export)\nworkflow = {\"nodes\": {\"13\": {...}}}\n// after\nworkflow = {\"nodes\": [{\"id\": \"13\", \"data\": {...}}]}","handlingStrategy":"type-guard","validationCode":"def workflow_nodes_are_list(workflow: dict) -> bool:\n    nodes = workflow.get(\"nodes\", [])\n    return isinstance(nodes, list)\n# call before apply_workflow_inputs_to_workflow","typeGuard":"def has_valid_nodes(workflow: dict) -> bool:\n    nodes = workflow.get(\"nodes\")\n    return isinstance(nodes, list) and all(isinstance(n, dict) for n in nodes)","tryCatchPattern":"try:\n    apply_workflow_inputs_to_workflow(workflow, workflow_inputs)\nexcept InvalidWorkflowInputError as e:\n    if \"missing child workflow node\" in str(e):\n        log.error(\"Malformed workflow document (nodes not a list): %s\", e)\n        raise ValueError(\"Re-export the workflow from the editor\") from e\n    raise","preventionTips":["Never hand-edit saved workflow JSON; re-export from the workflow editor.","Validate workflow documents against the workflow schema before use.","Only pass workflows loaded through the official workflow records API."],"tags":["workflow","validation","schema"],"backgroundTag":"workflow-input-not-exposed","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}