different-ai/openwork · error
Failed to load Workflow runs (${response.status}).
Error message
Failed to load Workflow runs (${response.status}). What it means
WorkflowRunsScreen fetches GET /v1/workflow-runs in a useEffect and throws 'Failed to load Workflow runs (STATUS).' on non-2xx responses, captured into local error state via getErrorMessage's fallback. The screen renders the message instead of the runs list.
Source
Thrown at ee/apps/den-web/app/(den)/dashboard/_components/workflow-runs-screen.tsx:61
<span className="font-medium text-gray-900">{run.toolCallCount}</span>
{run.toolCalls.length > 0 ? <span className="ml-2 break-words text-gray-400">{run.toolCalls.map((call) => call.name).join(", ")}</span> : null}
</div>
),
},
{ key: "duration", header: "Duration", render: (run) => <span className="text-gray-600">{formatDuration(run.durationMs)}</span> },
{ key: "when", header: "When", render: (run) => <span className="whitespace-nowrap text-gray-500">{new Date(run.createdAt).toLocaleString()}</span> },
];
export function WorkflowRunsScreen() {
const [runs, setRuns] = useState<WorkflowRun[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
let active = true;
void requestJson("/v1/workflow-runs", { method: "GET" }, 12000)
.then(({ response, payload }) => {
if (!response.ok) throw new Error(getErrorMessage(payload, `Failed to load Workflow runs (${response.status}).`));
if (active) setRuns(getWorkflowRuns(payload));
})
.catch((reason: unknown) => {
if (active) setError(reason instanceof Error ? reason.message : "Failed to load Workflow runs.");
})
.finally(() => {
if (active) setLoading(false);
});
return () => {
active = false;
};
}, []);
return (
<DashboardPageTemplate
icon={ScrollText}
title="Workflow Runs"
description="Review recent Workflow run activity and the capabilities each run called."View on GitHub (pinned to 2b7df46e8a)
Solutions
- Read the error message shown on screen; check the status code cause.
- Re-authenticate if the session expired (401).
- Retry the load after confirming connectivity; the effect can be re-run via remount/refresh.
- Check Den server/proxy health if the failure is 5xx or timeout.
- Verify the user still belongs to an organization with workflow runs.
Example fix
// before setError(reason instanceof Error ? reason.message : "Failed to load Workflow runs."); // after setError(reason instanceof Error ? reason.message : "Failed to load Workflow runs."); // plus a Retry button that re-triggers the fetch effect via a nonce state
Defensive patterns
Strategy: retry
Validate before calling
null
Type guard
null
Try / catch
catch ((reason: unknown)) {
const msg = reason instanceof Error ? reason.message : "Failed to load Workflow runs.";
if (/\((5\d\d)|timeout/i.test(msg)) setTimeout(load, 2000); // one soft retry
else setError(msg);
} Prevention
- Show a Retry button wired to re-run the fetch effect.
- Increase the timeout on slow networks or reduce page size.
- Handle 401 by redirecting to sign-in instead of showing a raw error.
- Guard state updates with the `active` flag (already done) to avoid setState after unmount.
When it happens
Trigger: GET /v1/workflow-runs returns 401 (expired Den session), 403 (no membership), 5xx (backend error), or requestJson's 12s timeout elapses; the thrown error is caught and stored via setError.
Common situations: Opening the runs screen after a long-idle tab whose session expired, Den server restart, slow network exceeding 12s, org switch invalidating access, or proxy returning 502 for the workflow-runs route.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- Failed to load desktop policies (${response.status}).
- Failed to load inference settings (${response.status}).
- Failed to load Workflow (${response.status}).
- Failed to fetch latest-mac.yml (${response.status} ${respons
- Managed MCP outbound request exceeded the guarded redirect l
AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01).
Data as JSON: /api/errors/81752aedfd7283f0.
Report an issue: GitHub.