{"record":{"id":"c9062b491548afd8","repo":"invoke-ai/InvokeAI","slug":"the-selected-saved-workflow-self-workflow-id","errorCode":null,"errorMessage":"The selected saved workflow '${self.workflow_id}' could not be found.","messagePattern":"The selected saved workflow '(.+?)' could not be found\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/call_saved_workflow.py","lineNumber":58,"sourceCode":"    workflow_id: str = InputField(\n        default=\"\",\n        description=\"The selected saved workflow ID, managed by the workflow editor UI.\",\n        ui_type=UIType.SavedWorkflow,\n    )\n    workflow_inputs: dict[str, Any] = InputField(\n        default={},\n        description=\"Literal values for the selected workflow's exposed inputs, managed by the workflow editor UI.\",\n        ui_hidden=True,\n    )\n\n    def validate_selected_workflow(self, context: InvocationContext):\n        if not self.workflow_id:\n            raise ValueError(\"A saved workflow must be selected before executing call_saved_workflow.\")\n\n        try:\n            workflow_record = context._services.workflow_records.get(self.workflow_id)\n        except WorkflowNotFoundError as e:\n            raise ValueError(f\"The selected saved workflow '{self.workflow_id}' could not be found.\") from e\n\n        config = context._services.configuration\n        if config.multiuser:\n            queue_user_id = context._data.queue_item.user_id\n            user = context._services.users.get(queue_user_id)\n            is_admin = bool(user and user.is_admin)\n            is_owner = workflow_record.user_id == queue_user_id\n            is_default = workflow_record.workflow.meta.category is WorkflowCategory.Default\n            if not (is_default or is_owner or workflow_record.is_public or is_admin):\n                raise ValueError(f\"The selected saved workflow '{self.workflow_id}' is not accessible to this user.\")\n\n        return workflow_record\n\n    def invoke(self, context: InvocationContext) -> WorkflowReturnOutput:\n        self.validate_selected_workflow(context)\n\n        return WorkflowReturnOutput(values={})\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/call_saved_workflow.py#L40-L76","documentation":"The node's workflow_id is set, but no record with that ID exists in the workflow records service. validate_selected_workflow catches WorkflowNotFoundError from workflow_records.get() and re-raises as a ValueError naming the missing ID.","triggerScenarios":"Calling invoke()/run_node() with a CallSavedWorkflow whose workflow_id points to a workflow that has been deleted, never existed, or whose ID was mistyped.","commonSituations":"Renaming/deleting saved workflows while graphs still reference old IDs; hardcoding workflow IDs copied from another InvokeAI instance or database; stale graph JSON exported before a workflow was removed.","solutions":["Verify the workflow exists: list saved workflows and use the correct ID in workflow_id.","Re-save or re-create the workflow if it was deleted, then point the node at the new ID.","Re-open the graph in the editor and re-select the workflow to refresh the stale ID."],"exampleFix":"// before\nnode.workflow_id = \"8f2c...\"  # deleted workflow\n// after\nrecords = context._services.workflow_records.list_all()\nnode.workflow_id = next(w.workflow_id for w in records if w.workflow.name == \"My Workflow\")","handlingStrategy":"validation","validationCode":"from invokeai.app.services.workflow_records import WorkflowNotFoundError\ntry:\n    context._services.workflow_records.get(node.workflow_id)\nexcept WorkflowNotFoundError:\n    print(f\"workflow {node.workflow_id} missing; re-select\")","typeGuard":null,"tryCatchPattern":"try:\n    node.invoke(context)\nexcept ValueError as e:\n    if \"could not be found\" in str(e):\n        refresh_workflow_list_and_reselect()\n    else:\n        raise","preventionTips":["Verify workflow IDs against the target instance's records, never copy across instances","Check workflow still exists after deletes/renames","Refresh graph references after workflow re-creation"],"tags":["validation","workflow","not-found","invokeai"],"backgroundTag":"resource-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}