Skip to content
Back to skills

439 Advanced Patching Cee21a7f

ASecurity

@DBOS.workflow() def workflow(): foo() bar() @DBOS.workflow() def workflow(): baz() # Replaced foo() - checkpoints don't match bar() ``` **Correct (using patch):** ```python config: DBOSConfig = { "name": "my-app", "enable_patching": True, } DBOS(config=config) @DBOS.workflow() def workflow(): if DBOS.patch("use-baz"): baz() # New workflows use baz else: foo() # Old workflows continue with foo bar() ``` Deprecating patches after all old workflows complete: ```python @DBOS.workflow() def wo...

  • 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 439-advanced-patching_cee21a7f --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 439 Advanced Patching Cee21a7f?

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

Security grade badge for 439 Advanced Patching Cee21a7f
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-439-advanced-patching-cee21a7f/badge)](https://www.skillsdirectory.com/skills/tools-only-439-advanced-patching-cee21a7f)

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

SKILL.md
---
title: Use Patching for Safe Workflow Upgrades
impact: LOW
impactDescription: Deploy breaking changes without disrupting in-progress workflows
tags: patching, upgrade, versioning, migration
---

## Use Patching for Safe Workflow Upgrades

Use `DBOS.patch()` to safely deploy breaking workflow changes. Breaking changes alter what steps run or their order.

**Incorrect (breaking change without patch):**

```python
# Original
@DBOS.workflow()
def workflow():
    foo()
    bar()

# Updated - breaks in-progress workflows!
@DBOS.workflow()
def workflow():
    baz()  # Replaced foo() - checkpoints don't match
    bar()
```

**Correct (using patch):**

```python
# Enable patching in config
config: DBOSConfig = {
    "name": "my-app",
    "enable_patching": True,
}
DBOS(config=config)

@DBOS.workflow()
def workflow():
    if DBOS.patch("use-baz"):
        baz()  # New workflows use baz
    else:
        foo()  # Old workflows continue with foo
    bar()
```

Deprecating patches after all old workflows complete:

```python
# Step 1: Deprecate (runs all workflows, stops inserting marker)
@DBOS.workflow()
def workflow():
    DBOS.deprecate_patch("use-baz")
    baz()
    bar()

# Step 2: Remove entirely (after all deprecated workflows complete)
@DBOS.workflow()
def workflow():
    baz()
    bar()
```

`DBOS.patch(name)` returns:
- `True` for new workflows (started after patch deployed)
- `False` for old workflows (started before patch deployed)

Reference: [Patching](https://docs.dbos.dev/python/tutorials/upgrading-workflows#patching)

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…