Skip to content

Add Cancel and Delete actions to deployment queue items #4193

@lamualfa

Description

@lamualfa

What problem will this feature address?

Currently, the deployment queue page (/dashboard/deployments?tab=queue) provides very limited actions for queued jobs. The Cancel button only appears for cloud-hosted instances and only when a job is in the active state. There is no way to:

  • Cancel jobs that are in pending, waiting, or delayed states (only active jobs can be cancelled, and only on cloud).
  • Delete/remove jobs from the queue at all, even after they've completed or failed.
  • Remove stuck jobs that may be lingering in the queue.

This means users have no control over jobs that are waiting in the queue before they start processing, and completed/failed jobs stay in the view with no way to clean them up.

Image

Describe the solution you'd like

Add action buttons to each row in the deployment queue table:

  1. Cancel button — Available for jobs in pending, waiting, delayed, and active states. This should cancel the job via BullMQ's job.discard() or job.remove() to prevent it from being processed. Currently, cancellation only works for active jobs on cloud — this should be extended to all self-hosted users and all pre-processing states.

  2. Delete/Remove button — Available for jobs in completed, failed, and cancelled states. This removes the job from the queue entirely so it no longer clutters the queue view.

The Actions column should show the appropriate button(s) based on the job's current state:

  • pending / waiting / delayedCancel
  • activeCancel
  • completed / failed / cancelledDelete

Describe alternatives you've considered

  • "Clear all completed/failed" button — A bulk action to clean up finished jobs instead of per-row deletion. This would be a nice addition but doesn't replace the need for individual control.
  • Auto-cleanup of completed jobs — The queue already has removeOnComplete: true and removeOnFail: true set when adding jobs, so completed jobs should already be cleaned up. However, in practice they still appear in the queue view, suggesting the cleanup may not be working as expected or there's a delay. Adding explicit delete buttons would give users immediate control regardless.

Additional context

The current queue table is located at apps/dokploy/components/dashboard/deployments/show-queue-table.tsx. The cancel functionality already exists for cloud instances (api.application.cancelDeployment and api.compose.cancelDeployment), so extending it to self-hosted and additional states would primarily involve:

  1. Adding a new API route that calls BullMQ's Job.remove() / Job.discard() directly on the queue
  2. Updating the show-queue-table.tsx component to show cancel/delete buttons based on job state
  3. Removing the isCloud gate on the cancel button

Relevant queue files:

  • apps/dokploy/server/queues/deployments-queue.ts — Queue worker
  • apps/dokploy/server/queues/queueSetup.ts — Queue setup utilities
  • apps/dokploy/server/api/routers/deployment.ts — Queue list API

Will you send a PR to implement it?

Yes, I plan to submit a PR to implement this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions