1. Safe Pause
To temporarily stop the worker without losing queued messages:2. Reset Stuck Semaphore
Ifworker_running = true persists (e.g., worker crashed mid-run):
3. Queue Backlog Investigation
4. Execution Failure Investigation
5. Emergency: Disable Worker for All Orgs
6. Rollback / Cleanup
If the feature must be fully reverted:- Unschedule cron:
SELECT cron.unschedule('process-workflow-queue'); - Disable all orgs:
UPDATE fw_module_settings SET fw_execution_worker_enabled = false, worker_running = false; - Drain queues (optional):
SELECT pgmq.purge_queue('workflow_execution_queue'); SELECT pgmq.purge_queue('workflow_dlq'); - Reset stuck executions:
UPDATE fw_workflow_executions SET status = 'failed', last_error = 'Worker rollback' WHERE status IN ('queued', 'retry_pending', 'running');