unhide endpoint if needed.
This unblocks the common case where an awaiting_user workflow
clogs the list and would otherwise require a manual SQL update to
clear.
What’s changed
Backend
-
worker/worker/storage/postgres_repo.py—workflow_runsgains two columns:hidden boolean not null default falseandhidden_at timestamptz. Added idempotently viaalter table ... add column if not existsso existing deployments upgrade on the next boot. A partial indexidx_workflow_runs_visiblekeeps the filtered list query cheap. New helper:set_workflow_hidden(workflow_id, hidden). -
mother-ai/src/routes.rs— two new endpoints:POST /v1/workflows/:workflow_id/hidePOST /v1/workflows/:workflow_id/unhide
authorize()API-key check. Per the current dev posture there is no separate admin role. -
mother-ai/src/routes.rsfetch_workflows_from_postgres— list query now includeswhere wr.hidden = false. Hidden rows still resolve in the per-workflowget_workflow_statuspath so deep links keep working.
Frontend
apps/frontend/app/api/mother-ai/workflows/[workflowId]/hide/route.tsand.../unhide/route.ts— Next.js BFF proxies for the new endpoints.apps/frontend/lib/mother-ai-client.ts— newhideWorkflow({ workflowId })client. Callers invalidate["workflows-list"]on success so the row disappears immediately.apps/frontend/components/workflow/panels/jobs-list-panel.tsx— eachWorkflowRowexposes a kebab button that confirms viawindow.confirmand callshideWorkflow. Selected row is cleared on hide so the detail panel doesn’t dangle.
Impact scope
- Backwards-compatible. Existing workflows default to
hidden = false. No migration data backfill is needed. - Open by default. Any caller with a valid mother-ai API key can
hide or unhide. A real role gate can be layered in later by tightening
the handler — endpoints are already gated through
authorize(). - Analytics safe. All telemetry queries (
compute_job_flow,compute_footer_activity,compute_live_activity, agent fleet) readprompt_threads/job_runs, which are untouched. Hiding only changes what the job list endpoint returns. - Redis fallback unaffected. When Postgres is not configured the
list endpoint falls back to scanning
cerebrum:workflow:*Redis keys; hidden flags are not enforced there because the same row falls out of Redis naturally as it ages.