invoke-ai/InvokeAI · info · HTTPException
Video workflow not found
Error message
Video workflow not found
What it means
Raised by get_video_workflow (GET videos/i/{video_name}/workflow) as HTTP 404 when fetching the workflow or graph associated with a video throws any exception. Videos created outside a workflow (e.g. plain uploads) or with unrecorded source workflow data will not have this association, so 404 is an expected outcome, not necessarily a malfunction.
Source
Thrown at invokeai/app/api/routers/videos.py:529
except Exception:
raise HTTPException(status_code=404)
@videos_router.get(
"/i/{video_name}/workflow", operation_id="get_video_workflow", response_model=WorkflowAndGraphResponse
)
def get_video_workflow(
current_user: CurrentUserOrDefault,
video_name: str = PathParam(description="The name of video whose workflow to get"),
) -> WorkflowAndGraphResponse:
"""Gets the workflow and graph saved with a generated video (mirrors the image route)."""
_assert_video_read_access(video_name, current_user)
try:
workflow = ApiDependencies.invoker.services.videos.get_workflow(video_name)
graph = ApiDependencies.invoker.services.videos.get_graph(video_name)
return WorkflowAndGraphResponse(workflow=workflow, graph=graph)
except Exception:
raise HTTPException(status_code=404)
def _parse_range_header(range_header: str, file_size: int) -> Optional[tuple[int, int]]:
"""Parses an HTTP Range header of the form `bytes=START-END`. Returns inclusive (start, end)
byte offsets, or None if the header is malformed or unsatisfiable."""
match = re.match(r"^bytes=(\d*)-(\d*)$", range_header.strip())
if match is None:
return None
if file_size <= 0:
# No byte range is satisfiable against an empty file (a suffix range would
# otherwise "satisfy" with the invalid pair (0, -1)).
return None
start_str, end_str = match.group(1), match.group(2)
if start_str == "" and end_str == "":
return None
if start_str == "":
# suffix range: last N bytes
try:View on GitHub (pinned to 0b6a024f2f)
Solutions
- Handle 404 as 'no workflow attached' and hide/disable the workflow-view affordance in the UI.
- Verify the video exists first (GET videos/i/{video_name}) to separate 'no workflow' from 'no video'.
- If workflow data is expected, check the workflows records in the database for deletion or migration gaps.
- Check server logs if the video and workflow both exist yet the endpoint still 404s.
Example fix
// before
const { workflow } = await api.getVideoWorkflow(name); // throws when absent
// after
try {
const { workflow } = await api.getVideoWorkflow(name);
} catch (e) {
if (e.status === 404) return null; // video has no source workflow
throw e;
} Defensive patterns
Strategy: fallback
Validate before calling
const exists = await api.getVideoDto(name).then(() => true, () => false); if (!exists) return null; // video gone, workflow endpoint will 404
Try / catch
try {
return await api.getVideoWorkflow(name);
} catch (e) {
if (e.response?.status === 404) return null; // no source workflow attached
throw e;
} Prevention
- Only show 'open workflow' UI when the video was generated from a workflow.
- Treat 404 as the normal 'no workflow' case, not an error state.
- Note: the endpoint 404s without a detail body — match on status code only.
When it happens
Trigger: Requesting the workflow of a video that was never generated from a workflow; the source workflow/graph record was deleted or pruned; video_name does not exist; DB read failure.
Common situations: UI showing 'View workflow' for videos whose workflow was since deleted; videos copied between installs without workflow records; older videos predating workflow capture.
Related errors
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/a67c4ff589748658.
Report an issue: GitHub.