Skip to content
Back to skills

441 Queue Deduplication 71c584da

ASecurity

queue.enqueue(process_workflow, user_id) ``` **Correct (deduplicated by user):** ```python from dbos import Queue, SetEnqueueOptions from dbos import error as dboserror queue = Queue("user_tasks") @app.post("/process/{user_id}") def process_for_user(user_id: str): with SetEnqueueOptions(deduplication_id=user_id): try: handle = queue.enqueue(process_workflow, user_id) return {"workflow_id": handle.get_workflow_id()} except dboserror.DBOSQueueDeduplicatedError: return {"status": "already proces...

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
documentationpython

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 441-queue-deduplication_71c584da --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 441 Queue Deduplication 71c584da?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 441 Queue Deduplication 71c584da
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-441-queue-deduplication-71c584da/badge)](https://www.skillsdirectory.com/skills/tools-only-441-queue-deduplication-71c584da)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
title: Deduplicate Queued Workflows
impact: HIGH
impactDescription: Prevents duplicate work and resource waste
tags: queue, deduplication, duplicate, idempotent
---

## Deduplicate Queued Workflows

Use deduplication IDs to ensure only one workflow with a given ID is active in a queue at a time.

**Incorrect (duplicate workflows possible):**

```python
queue = Queue("user_tasks")

@app.post("/process/{user_id}")
def process_for_user(user_id: str):
    # Multiple requests = multiple workflows for same user!
    queue.enqueue(process_workflow, user_id)
```

**Correct (deduplicated by user):**

```python
from dbos import Queue, SetEnqueueOptions
from dbos import error as dboserror

queue = Queue("user_tasks")

@app.post("/process/{user_id}")
def process_for_user(user_id: str):
    with SetEnqueueOptions(deduplication_id=user_id):
        try:
            handle = queue.enqueue(process_workflow, user_id)
            return {"workflow_id": handle.get_workflow_id()}
        except dboserror.DBOSQueueDeduplicatedError:
            return {"status": "already processing"}
```

Deduplication behavior:
- If a workflow with the same deduplication ID is `ENQUEUED` or `PENDING`, new enqueue raises `DBOSQueueDeduplicatedError`
- Once the workflow completes, a new workflow with the same ID can be enqueued
- Deduplication is per-queue (same ID can exist in different queues)

Use cases:
- One active task per user
- Preventing duplicate job submissions
- Rate limiting by entity

Reference: [Queue Deduplication](https://docs.dbos.dev/python/tutorials/queue-tutorial#deduplication)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…