{"record":{"id":"986f0a92d8727dc0","repo":"invoke-ai/InvokeAI","slug":"call-saved-workflow-input-input-name-targets-i","errorCode":null,"errorMessage":"call_saved_workflow input '{input_name}' targets invalid child workflow inputs on '{node_id}'","messagePattern":"call_saved_workflow input '(.+?)' targets invalid child workflow inputs on '(.+?)'","errorType":"validation","errorClass":"InvalidWorkflowInputError","httpStatus":400,"severity":"error","filePath":"invokeai/app/services/shared/workflow_graph_builder.py","lineNumber":158,"sourceCode":"        )\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\"]\n        node_type = matching_node_data.get(\"type\")\n        if not isinstance(node_type, str):\n            raise InvalidWorkflowInputError(\n                f\"call_saved_workflow input '{input_name}' targets missing child workflow node '{node_id}'\"\n            )\n        invocation_class = InvocationRegistry.get_invocation_for_type(node_type)\n        if invocation_class is None or field_name not in invocation_class.model_fields:\n            raise InvalidWorkflowInputError(\n                f\"call_saved_workflow input '{input_name}' targets missing child workflow field '{field_name}'\"\n            )\n        inputs = matching_node_data.setdefault(\"inputs\", {})\n        if not _is_mapping(inputs):\n            raise InvalidWorkflowInputError(\n                f\"call_saved_workflow input '{input_name}' targets invalid child workflow inputs on '{node_id}'\"\n            )\n        inputs[field_name] = {\"value\": value}\n\n\ndef apply_workflow_inputs_to_graph(\n    graph: Graph, workflow: Mapping[str, Any], workflow_inputs: Mapping[str, Any]\n) -> None:\n    if not workflow_inputs:\n        return\n\n    mutable_workflow = dict(workflow)\n    apply_workflow_inputs_to_workflow(mutable_workflow, workflow_inputs)\n    for input_name, value in workflow_inputs.items():\n        node_id, field_name = parse_call_saved_workflow_dynamic_input(input_name)\n        node = graph.nodes.get(node_id)\n        if node is None:\n            continue","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/shared/workflow_graph_builder.py#L140-L176","documentation":"The matched node's 'inputs' member is not a mapping (dict), so the builder cannot insert the dynamic input value. The saved workflow's node data is malformed even though the node type and field validated.","triggerScenarios":"apply_workflow_inputs_to_workflow: matching_node_data.setdefault(\"inputs\", {}) returns a value for which _is_mapping(inputs) is False.","commonSituations":"Hand-edited workflow JSON where 'inputs' is a list or string; exports from other tools using a different inputs representation; truncated or programmatically corrupted workflow documents.","solutions":["Fix the node's 'inputs' to be a dict keyed by field name (re-export from the editor).","Re-save the workflow via the UI so the SDK serializes inputs correctly.","Validate the workflow document (inputs mapping per node) before calling apply_workflow_inputs_to_workflow."],"exampleFix":"// before\n\"inputs\": [\"prompt\"]\n// after\n\"inputs\": {\"prompt\": {\"value\": \"a cat\"}}","handlingStrategy":"type-guard","validationCode":"def node_inputs_are_mapping(workflow: dict, node_id: str) -> bool:\n    node = next((n for n in workflow.get(\"nodes\", []) if isinstance(n, dict) and n.get(\"id\") == node_id), None)\n    return isinstance(node, dict) and isinstance(node.get(\"data\", {}).get(\"inputs\"), dict)","typeGuard":"def has_mapping_inputs(node: dict) -> bool:\n    data = node.get(\"data\") if isinstance(node, dict) else None\n    return isinstance(data, dict) and isinstance(data.get(\"inputs\"), dict)","tryCatchPattern":"try:\n    apply_workflow_inputs_to_workflow(workflow, workflow_inputs)\nexcept InvalidWorkflowInputError as e:\n    if \"invalid child workflow inputs\" in str(e):\n        log.error(\"node inputs malformed in saved workflow: %s\", e)\n        raise ValueError(\"Fix or re-export the workflow; node inputs must be a dict\") from e\n    raise","preventionTips":["Only pass workflows deserialized through the official workflow schema, not raw JSON.","Never hand-edit node 'inputs' structures; use the editor.","Sanity-check each node's inputs type before programmatic graph manipulation."],"tags":["workflow","validation","schema"],"backgroundTag":"workflow-node-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}