Skip to main content

1. Safe Pause

To temporarily stop the worker without losing queued messages:
Messages remain in pgmq and will be processed when the worker is re-enabled. To resume:

2. Reset Stuck Semaphore

If worker_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:
  1. Unschedule cron: SELECT cron.unschedule('process-workflow-queue');
  2. Disable all orgs: UPDATE fw_module_settings SET fw_execution_worker_enabled = false, worker_running = false;
  3. Drain queues (optional): SELECT pgmq.purge_queue('workflow_execution_queue'); SELECT pgmq.purge_queue('workflow_dlq');
  4. Reset stuck executions: UPDATE fw_workflow_executions SET status = 'failed', last_error = 'Worker rollback' WHERE status IN ('queued', 'retry_pending', 'running');

7. Health Check Queries