FISCFED9/CLI / .agents/skills/plugins/antigravity-awesome-skills-claude/skills/dbos-python
dbos-python
VerifiedGuide for building reliable, fault-tolerant Python applications with DBOS durable workflows. Use when adding DBOS to existing Python code, creating workflows and steps, or using queues for concurrency control.
references/comm-messages.md
View on GitHub---
title: Use Messages for Workflow Notifications
impact: MEDIUM
impactDescription: Enables external signals to control workflow execution
tags: messages, send, recv, notifications
---
## Use Messages for Workflow Notifications
Send messages to workflows to signal or notify them while running. Messages are persisted and queued per topic.
**Incorrect (polling external state):**
```python
@DBOS.workflow()
def payment_workflow():
# Polling is inefficient and not durable
while True:
status = check_payment_status()
if status == "paid":
break
time.sleep(1)
```
**Correct (using messages):**
```python
PAYMENT_STATUS = "payment_status"
@DBOS.workflow()
def payment_workflow():
# Process order...
DBOS.set_event("payment_id", payment_id)
# Wait for payment notification (60 second timeout)
payment_status = DBOS.recv(PAYMENT_STATUS, timeout_seconds=60)
if payment_status == "paid":
fulfill_order()
else:
cancel_order()
# Webhook endpoint to receive payment notification
@app.post("/payment_webhook/{workflow_id}/{status}")
def payment_webhook(workflow_id: str, status: str):
DBOS.send(workflow_id, status, PAYMENT_STATUS)
return {"ok": True}
```
Key points:
- `DBOS.recv()` can only be called from workflows
- Messages are queued per topic
- `recv()` returns `None` on timeout
- Messages are persisted for exactly-once delivery
Reference: [Workflow Messaging](https://docs.dbos.dev/python/tutorials/workflow-communication#workflow-messaging-and-notifications)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |