Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 1.28 KB

File metadata and controls

26 lines (19 loc) · 1.28 KB

Worker Versioning

This sample demonstrates how to use Temporal's Worker Versioning feature to safely deploy updates to workflow and activity code. It shows the difference between auto-upgrading and pinned workflows, and how to manage worker deployments with different build IDs.

The sample creates multiple worker versions (1.0, 1.1, and 2.0) within one deployment and demonstrates:

  • Auto-upgrading workflows: Automatically and controllably migrate to newer worker versions
  • Pinned workflows: Stay on the original worker version throughout their lifecycle
  • Compatible vs incompatible changes: How to make safe updates using Workflow.Patched

Steps to run this sample:

  1. Run a Temporal service. Ensure that you're using at least Server version 1.28.0 (CLI version 1.4.0).

  2. Start the main application (this will guide you through the sample):

dotnet run demo
  1. Follow the prompts to start workers in separate terminals:
    • When prompted, run: dotnet run worker-v1
    • When prompted, run: dotnet run worker-v1.1
    • When prompted, run: dotnet run worker-v2

The sample will show how auto-upgrading workflows migrate to newer workers while pinned workflows remain on their original version.