invoke-ai/InvokeAI · error · ValueError
A saved workflow must be selected before executing call_save
Error message
A saved workflow must be selected before executing call_saved_workflow.
What it means
call_saved_workflow refuses to run when no workflow_id is set. The node requires a workflow that has been saved to the workflow records service; validate_selected_workflow checks this before anything else and raises ValueError immediately if the field is empty/None.
Source
Thrown at invokeai/app/invocations/call_saved_workflow.py:53
classification=Classification.Beta,
)
class CallSavedWorkflowInvocation(BaseInvocation):
"""Displays and later executes against a selected saved workflow."""
workflow_id: str = InputField(
default="",
description="The selected saved workflow ID, managed by the workflow editor UI.",
ui_type=UIType.SavedWorkflow,
)
workflow_inputs: dict[str, Any] = InputField(
default={},
description="Literal values for the selected workflow's exposed inputs, managed by the workflow editor UI.",
ui_hidden=True,
)
def validate_selected_workflow(self, context: InvocationContext):
if not self.workflow_id:
raise ValueError("A saved workflow must be selected before executing call_saved_workflow.")
try:
workflow_record = context._services.workflow_records.get(self.workflow_id)
except WorkflowNotFoundError as e:
raise ValueError(f"The selected saved workflow '{self.workflow_id}' could not be found.") from e
config = context._services.configuration
if config.multiuser:
queue_user_id = context._data.queue_item.user_id
user = context._services.users.get(queue_user_id)
is_admin = bool(user and user.is_admin)
is_owner = workflow_record.user_id == queue_user_id
is_default = workflow_record.workflow.meta.category is WorkflowCategory.Default
if not (is_default or is_owner or workflow_record.is_public or is_admin):
raise ValueError(f"The selected saved workflow '{self.workflow_id}' is not accessible to this user.")
return workflow_record
View on GitHub (pinned to 0b6a024f2f)
Solutions
- Select a saved workflow for the node (set workflow_id to the saved workflow's ID) before executing.
- Programmatically set workflow_id on the CallSavedWorkflow node before queueing the graph.
- Add a pre-flight check on the graph to ensure every call_saved_workflow node has a non-empty workflow_id.
Example fix
// before node = CallSavedWorkflow() # workflow_id not set graph.add_node(node) // after node = CallSavedWorkflow(workflow_id="saved-workflow-uuid") graph.add_node(node)
Defensive patterns
Strategy: validation
Validate before calling
if not node.workflow_id:
raise ValueError("select a saved workflow before executing") Try / catch
try:
output = node.invoke(context)
except ValueError as e:
if "must be selected" in str(e):
prompt_user_to_select_workflow()
else:
raise Prevention
- Always set workflow_id when constructing CallSavedWorkflow nodes programmatically
- Validate graphs for empty required fields before queueing
- Re-select workflows in the UI after editing imported graphs
When it happens
Trigger: Invoking a CallSavedWorkflow invocation (directly via invoke() or through run_node) while self.workflow_id is empty string or None — e.g. the node was added to a graph but the user never picked a workflow in the editor, or the field was programmatically left at its default.
Common situations: Building graphs via API/script where the workflow_id field was never populated; UI workflows where the user forgot to select a saved workflow; importing a graph that references a node whose workflow_id was never persisted.
Understand the failure class
Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.
Related errors
- The selected saved workflow '${self.workflow_id}' could not
- Unsupported batch group id '{batch_group_id}' in called work
- Workflow not found
- Not authorized to access this workflow
- denoising_start ({self.denoising_start}) must be less than d
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/7a1514c95cc1a915.
Report an issue: GitHub.