<figure class="wp-block-image aligncenter"><img src="https://flowgenius.in/wp-content/uploads/2026/01/n8n-queue-mode-job-stuck.png" alt="Step by Step Guide to solve n8n queue mode job stuck" /><figcaption style="text-align: center;">Step by Step Guide to solve n8n queue mode job stuck</p>
<hr />
</figcaption></figure>
<p> </p>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>Who this is for:</strong> Ops engineers, DevOps teams, and n8n power‑users who run n8n in queue mode (Redis or PostgreSQL) and need a fast, repeatable way to un‑block a hung execution. <strong>We cover this in detail in the </strong><a href="https://flowgenius.in/n8n-queue-mode-error-guide/">n8n Queue Mode Errors Guide.</a></p>
<hr style="margin: 55px 0;" />
<h2 style="margin-bottom: 45px; line-height: 1.3;">Quick Diagnosis</h2>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>Problem:</strong> An n8n workflow stays in <strong>“pending”</strong> (or “queued”) forever, never advancing to “running” or “finished”.</p>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>One‑line fix:</strong> Find the execution’s <code>id</code>, reset its status with the n8n CLI (or a guarded DB update), and clear any orphaned queue lock.</p>
<hr style="margin: 55px 0;" />
<h2 style="margin-bottom: 45px; line-height: 1.3;">1. Why Jobs Get Stuck in Queue Mode ?</h2>
<p><strong>If you encounter any </strong><a href="/n8n-queue-mode-duplicate-execution">n8n queue mode duplicate execution </a><strong>resolve them before continuing with the setup.</strong></p>
<table style="border-collapse: collapse; width: 100%; margin-bottom: 1.5em;">
<thead>
<tr>
<th style="padding: 13px; border: 1px solid #e0e0e0; text-align: left;">Root cause</th>
<th style="padding: 13px; border: 1px solid #e0e0e0; text-align: left;">UI / Log symptom</th>
<th style="padding: 13px; border: 1px solid #e0e0e0; text-align: left;">Typical trigger</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Orphaned Redis lock</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">`Job is still in pending state` repeats</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Worker crash or container restart</td>
</tr>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Corrupt DB row</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">`status = “pending”` but `startedAt` is `null`</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Manual DB edit or incomplete migration</td>
</tr>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Infinite loop in a node</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">No progress after first node runs</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Custom JavaScript that never resolves</td>
</tr>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Resource throttling</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Growing queue backlog, new jobs never dequeued</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">CPU/memory limits, OOM kills</td>
</tr>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Version mismatch (core vs. queue plugin)</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">`Cannot read property ‘queue’ of undefined`</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Upgrade without rebuilding the plugin</td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 2em; line-height: 1.9;">Understanding the root cause tells you whether to <strong>reset the execution</strong>, <strong>clear the queue</strong>, or <strong>fix the workflow code</strong>.</p>
<hr style="margin: 55px 0;" />
<h2 style="margin-bottom: 45px; line-height: 1.3;">2. Locate the Stuck Job</h2>
<h3 style="margin-bottom: 45px; line-height: 1.3;">2.1 UI (read‑only)</h3>
<ol style="margin-bottom: 1.8em; line-height: 1.9;">
<li>Open <strong>Execution List</strong> → filter <strong>Status = Pending</strong>.</li>
<li>Hover the row and copy the <strong>Execution ID</strong> (e.g., <code>62f9c7b1-3e8a-4d2b-9f7a-9c4e5a2d1b3c</code>).</li>
</ol>
<blockquote style="margin: 1.5em 0; padding-left: 1em; border-left: 4px solid #e0e0e0;">
<p style="margin-bottom: 0; line-height: 1.9;"><strong>EEFA:</strong> Do <strong>not</strong> click “Retry” on a stuck job; it will re‑queue the same corrupted entry.</p>
</blockquote>
<h3 style="margin-bottom: 45px; line-height: 1.3;">2.2 CLI</h3>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;"># List the most recent pending executions (requires n8n ≥ 1.0)
n8n execution:list --status=pending --limit=20</pre>
<p style="margin-bottom: 2em; line-height: 1.9;">The output shows <code>id</code>, <code>workflowId</code>, and <code>createdAt</code>.</p>
<h3 style="margin-bottom: 45px; line-height: 1.3;">2.3 Direct DB Query (PostgreSQL example)</h3>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;">SELECT id, workflow_id, status, created_at
FROM execution_entity
WHERE status = 'pending'
ORDER BY created_at ASC
LIMIT 20;</pre>
<blockquote style="margin: 1.5em 0; padding-left: 1em; border-left: 4px solid #e0e0e0;">
<p style="margin-bottom: 0; line-height: 1.9;"><strong>EEFA:</strong> Run the query on a <strong>read‑only replica</strong> first to verify rows before making changes. If you encounter any <a href="/n8n-queue-mode-missing-worker-process">n8n queue mode missing worker process </a>resolve them before continuing with the setup<strong>.</strong></p>
</blockquote>
<hr style="margin: 55px 0;" />
<h2 style="margin-bottom: 45px; line-height: 1.3;">3. Safely Release / Reset the Stuck Job</h2>
<h3 style="margin-bottom: 45px; line-height: 1.3;">3.1 Preferred: CLI “reset” command</h3>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;"># Replace with the ID you located
n8n execution:reset</pre>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>What it does</strong></p>
<ul style="margin-bottom: 1.8em; line-height: 1.9;">
<li>Sets <code>status = 'failed'</code> in the DB.</li>
<li>Deletes the Redis lock key <code>n8n:queue:lock:<id></code>.</li>
<li>Emits an <code>execution.finished</code> event so downstream triggers (e.g., Webhooks) are notified.</li>
</ul>
<blockquote style="margin: 1.5em 0; padding-left: 1em; border-left: 4px solid #e0e0e0;">
<p style="margin-bottom: 0; line-height: 1.9;"><strong>EEFA:</strong> The CLI respects the <code>executionTimeout</code> setting, preventing accidental infinite loops.</p>
</blockquote>
<h3 style="margin-bottom: 45px; line-height: 1.3;">3.2 Manual DB reset (when CLI unavailable)</h3>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>Step 1 – Mark the execution as failed</strong></p>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;">BEGIN;
UPDATE execution_entity
SET status = 'failed',
stopped_at = NOW(),
error = 'Manually reset after queue stall'
WHERE id = '<EXECUTION_ID>';</pre>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>Step 2 – Remove the Redis lock (if using Redis)</strong></p>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;"># Run this in a Redis client
redis-cli DEL "n8n:queue:lock:<EXECUTION_ID>"</pre>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;">COMMIT;</pre>
<blockquote style="margin: 1.5em 0; padding-left: 1em; border-left: 4px solid #e0e0e0;">
<p style="margin-bottom: 0; line-height: 1.9;"><strong>EEFA:</strong> Wrap the <code>UPDATE</code> in a transaction and take a <strong>DB snapshot</strong> before committing on production.</p>
</blockquote>
<h3 style="margin-bottom: 45px; line-height: 1.3;">3.3 Flush the entire queue (last resort)</h3>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>Redis backend</strong></p>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;"># List all queue keys and delete them
redis-cli KEYS "n8n:queue:*" | xargs -r redis-cli DEL</pre>
<p style="margin-bottom: 2em; line-height: 1.9;"><strong>PostgreSQL‑based queue (pg‑boss)</strong></p>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;">DELETE FROM pgboss.job WHERE state = 'created';</pre>
<blockquote style="margin: 1.5em 0; padding-left: 1em; border-left: 4px solid #e0e0e0;">
<p style="margin-bottom: 0; line-height: 1.9;"><strong>EEFA:</strong> Flushing discards **all** pending jobs. Use only during a maintenance window when the backlog can be safely dropped.</p>
</blockquote>
<hr style="margin: 55px 0;" />
<h2 style="margin-bottom: 45px; line-height: 1.3;">4. Verify the Fix & Prevent Recurrence</h2>
<h3 style="margin-bottom: 45px; line-height: 1.3;">4.1 Post‑reset sanity check</h3>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;">n8n execution:get</pre>
<p style="margin-bottom: 2em; line-height: 1.9;">You should see <code>status = "failed"</code> and a populated <code>stoppedAt</code>.</p>
<table style="border-collapse: collapse; width: 100%; margin-bottom: 1.5em;">
<thead>
<tr>
<th style="padding: 13px; border: 1px solid #e0e0e0; text-align: left;">Check</th>
<th style="padding: 13px; border: 1px solid #e0e0e0; text-align: left;">Expected result</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">UI shows the execution as <strong>Failed</strong></td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">✅</td>
</tr>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">No Redis lock key exists</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">✅ (<code>redis-cli EXISTS n8n:queue:lock:<id></code> → 0)</td>
</tr>
<tr>
<td style="padding: 13px; border: 1px solid #e0e0e0;">Queue length returns to normal</td>
<td style="padding: 13px; border: 1px solid #e0e0e0;">✅ (<code>redis-cli LLEN n8n:queue:jobs</code>)</td>
</tr>
</tbody>
</table>
<h3 style="margin-bottom: 45px; line-height: 1.3;">4.2 Preventive checklist</h3>
<ul style="margin-bottom: 1.8em; line-height: 1.9;">
<li><strong>Enable <code>executionTimeout</code></strong> in <code>config.yml</code> (e.g., <code>executionTimeout: 300</code>).</li>
<li><strong>Monitor queue depth</strong> via Prometheus (<code>n8n_queue_length</code>).</li>
<li><strong>Alert</strong> when pending executions exceed 5 minutes.</li>
<li><strong>Upgrade n8n and the queue‑mode plugin together</strong> (matching major versions).</li>
<li><strong>Back up the <code>execution_entity</code> table</strong> nightly.</li>
</ul>
<hr style="margin: 55px 0;" />
<h2 style="margin-bottom: 45px; line-height: 1.3;">5. Real‑World Example: Kubernetes Deployment</h2>
<p style="margin-bottom: 2em; line-height: 1.9;"><em>Scenario:</em> An n8n pod crashed during a large CSV import, leaving 12 jobs pending.</p>
<h3 style="margin-bottom: 45px; line-height: 1.3;">5.1 Identify the stuck executions</h3>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;">kubectl logs -l app=n8n -c n8n --since=2h | grep "pending"
# Example output: Execution IDs 9b1c2d3e-...</pre>
<h3 style="margin-bottom: 45px; line-height: 1.3;">5.2 Reset each execution from inside the pod</h3>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;"># Replace <POD_NAME> and <EXECUTION_ID> accordingly
kubectl exec -it $(kubectl get pod -l app=n8n -o jsonpath="{.items[0].metadata.name}") -- \
n8n execution:reset 9b1c2d3e-...</pre>
<h3 style="margin-bottom: 45px; line-height: 1.3;">5.3 Roll out a clean queue worker</h3>
<pre style="background: #fafafa; padding: 20px; border: 1px solid #e0e0e0; overflow: auto; margin-bottom: 2em;">kubectl rollout restart deployment/n8n</pre>
<blockquote style="margin: 1.5em 0; padding-left: 1em; border-left: 4px solid #e0e0e0;">
<p style="margin-bottom: 0; line-height: 1.9;"><strong>EEFA:</strong> The rollout forces a fresh pod that starts with a clean Redis state (the PVC is ephemeral), eliminating any lingering lock keys.</p>
</blockquote>
<hr style="margin: 55px 0;" />
<h2 style="margin-bottom: 45px; line-height: 1.3;">Conclusion</h2>
<p style="margin-bottom: 2em; line-height: 1.9;">A “job stuck” condition is almost always a <strong>state‑sync mismatch</strong> between the execution table and the queue backend. The reliable remedy is to <strong>reset the execution</strong> (CLI preferred), <strong>clear any orphaned lock</strong>, and then verify that the queue depth returns to normal. Reinforce the fix with timeout settings, queue‑depth monitoring, and version‑aligned upgrades to keep n8n running smoothly in production.</p>
Step by Step Guide to solve n8n queue mode job stuck
Who this is for: Ops engineers, DevOps teams, and n8n power‑users who run n8n in queue mode (Redis or PostgreSQL) and need a fast, repeatable way to un‑block a hung execution. We cover this in detail in the n8n Queue Mode Errors Guide.
Quick Diagnosis
Problem: An n8n workflow stays in “pending” (or “queued”) forever, never advancing to “running” or “finished”.
One‑line fix: Find the execution’s id, reset its status with the n8n CLI (or a guarded DB update), and clear any orphaned queue lock.
Understanding the root cause tells you whether to reset the execution, clear the queue, or fix the workflow code.
2. Locate the Stuck Job
2.1 UI (read‑only)
Open Execution List → filter Status = Pending.
Hover the row and copy the Execution ID (e.g., 62f9c7b1-3e8a-4d2b-9f7a-9c4e5a2d1b3c).
EEFA: Do not click “Retry” on a stuck job; it will re‑queue the same corrupted entry.
2.2 CLI
# List the most recent pending executions (requires n8n ≥ 1.0)
n8n execution:list --status=pending --limit=20
The output shows id, workflowId, and createdAt.
2.3 Direct DB Query (PostgreSQL example)
SELECT id, workflow_id, status, created_at
FROM execution_entity
WHERE status = 'pending'
ORDER BY created_at ASC
LIMIT 20;
EEFA: Run the query on a read‑only replica first to verify rows before making changes. If you encounter any n8n queue mode missing worker process resolve them before continuing with the setup.
3. Safely Release / Reset the Stuck Job
3.1 Preferred: CLI “reset” command
# Replace with the ID you located
n8n execution:reset
What it does
Sets status = 'failed' in the DB.
Deletes the Redis lock key n8n:queue:lock:<id>.
Emits an execution.finished event so downstream triggers (e.g., Webhooks) are notified.
EEFA: The CLI respects the executionTimeout setting, preventing accidental infinite loops.
3.2 Manual DB reset (when CLI unavailable)
Step 1 – Mark the execution as failed
BEGIN;
UPDATE execution_entity
SET status = 'failed',
stopped_at = NOW(),
error = 'Manually reset after queue stall'
WHERE id = '<EXECUTION_ID>';
Step 2 – Remove the Redis lock (if using Redis)
# Run this in a Redis client
redis-cli DEL "n8n:queue:lock:<EXECUTION_ID>"
COMMIT;
EEFA: Wrap the UPDATE in a transaction and take a DB snapshot before committing on production.
3.3 Flush the entire queue (last resort)
Redis backend
# List all queue keys and delete them
redis-cli KEYS "n8n:queue:*" | xargs -r redis-cli DEL
PostgreSQL‑based queue (pg‑boss)
DELETE FROM pgboss.job WHERE state = 'created';
EEFA: Flushing discards **all** pending jobs. Use only during a maintenance window when the backlog can be safely dropped.
4. Verify the Fix & Prevent Recurrence
4.1 Post‑reset sanity check
n8n execution:get
You should see status = "failed" and a populated stoppedAt.
Check
Expected result
UI shows the execution as Failed
✅
No Redis lock key exists
✅ (redis-cli EXISTS n8n:queue:lock:<id> → 0)
Queue length returns to normal
✅ (redis-cli LLEN n8n:queue:jobs)
4.2 Preventive checklist
Enable executionTimeout in config.yml (e.g., executionTimeout: 300).
Monitor queue depth via Prometheus (n8n_queue_length).
Alert when pending executions exceed 5 minutes.
Upgrade n8n and the queue‑mode plugin together (matching major versions).
Back up the execution_entity table nightly.
5. Real‑World Example: Kubernetes Deployment
Scenario: An n8n pod crashed during a large CSV import, leaving 12 jobs pending.
# Replace <POD_NAME> and <EXECUTION_ID> accordingly
kubectl exec -it $(kubectl get pod -l app=n8n -o jsonpath="{.items[0].metadata.name}") -- \
n8n execution:reset 9b1c2d3e-...
5.3 Roll out a clean queue worker
kubectl rollout restart deployment/n8n
EEFA: The rollout forces a fresh pod that starts with a clean Redis state (the PVC is ephemeral), eliminating any lingering lock keys.
Conclusion
A “job stuck” condition is almost always a state‑sync mismatch between the execution table and the queue backend. The reliable remedy is to reset the execution (CLI preferred), clear any orphaned lock, and then verify that the queue depth returns to normal. Reinforce the fix with timeout settings, queue‑depth monitoring, and version‑aligned upgrades to keep n8n running smoothly in production.