Skip to content

Workflow graph view stuck on loading when run has no codebase_id #958

@coleam00

Description

@coleam00

Bug

When viewing a workflow execution in the Web UI, the Graph tab shows "Loading graph..." indefinitely for any workflow run that has no associated project (codebase_id = null).

This affects:

  • CLI-triggered workflow runs
  • Web UI runs where "No project" was selected
  • Any run where the codebase auto-registration failed

Root Cause

WorkflowExecution.tsx:240-245 - the workflowDef TanStack Query has an enabled gate that requires both workflowName AND codebaseCwd to be truthy:

```typescript
enabled: !!initialData?.workflowName && !!codebaseCwd,
```

When codebase_id is null on the run, codebaseCwd is never populated (it depends on fetching the codebase record), so the query never fires.

The server-side GET /api/workflows/:name route already handles missing cwd - it falls back to the first registered codebase, then to bundled defaults. The client just never lets the query fire.

Fix

Remove the !!codebaseCwd requirement from the enabled gate. Pass codebaseCwd ?? undefined to the query function (which it already does). The server fallback handles the rest.

Files

  • packages/web/src/components/workflows/WorkflowExecution.tsx - line 243 (enabled gate)
  • packages/server/src/routes/api.ts - lines 2082-2084 (server-side cwd fallback, already works)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions