Angaben zum Datum
Datum aus der Quelle.
Erstmals gesehen am .
Developer Platform von Cloudflare
Workflows in Dynamic Workers mit @cloudflare/dynamic-workflows
Die Bibliothek @cloudflare/dynamic-workflows ermöglicht es, Workflows innerhalb von Dynamic Workers dauerhaft auszuführen, indem sie Workflow-Instanzen mit Metadaten markiert und den passenden Dynamic Worker beim Fortsetzen über den Worker Loader neu lädt.
You can now use @cloudflare/dynamic-workflows ↗︎ to run a Workflow inside a Dynamic Worker, ensuring durable execution for code that is loaded at runtime.
The Worker Loader loads Dynamic Workers on demand, which previously made durability challenging. Even within a Dynamic Worker, a Workflow might sleep for hours or days between steps, and by the time it resumes, the original Dynamic Worker code would no longer be in memory.
The library solves this by tagging each Workflow instance with metadata that identifies which Dynamic Worker to load — for example, a tenant ID — then reloading the matching Dynamic Worker through the Worker Loader whenever a Workflow awakens.
Because Dynamic Workers are created on-demand, you do not have to register each Workflow up front or manage them individually. Load the Workflow code in the Dynamic Worker when it is needed, and the Workflows engine handles persistence and retries behind the scenes. Your Workflow code itself is unaffected by the routing and behaves as normal.
This unlocks patterns where the Workflow code itself is dynamic. For example, this is useful with:
- SaaS platforms where each tenant defines their own automation, such as onboarding sequences, approval chains, or billing retry logic. …