Skip to content

Dapr Workflow Overhaul#1662

Merged
WhitWaldo merged 156 commits intodapr:masterfrom
WhitWaldo:wf-overhaul
Dec 26, 2025
Merged

Dapr Workflow Overhaul#1662
WhitWaldo merged 156 commits intodapr:masterfrom
WhitWaldo:wf-overhaul

Conversation

@WhitWaldo
Copy link
Copy Markdown
Contributor

@WhitWaldo WhitWaldo commented Dec 11, 2025

Description

This PR represents an effort to dramatically overhaul how the .NET implementation of Dapr Workflows is written.

This completely removes our dependency on the DurableTask libraries (including our fork of Dapr.DurableTask) and fundamentally alters how the underlying system works operationally to remove all the logic not directly used by the Dapr runtime, applies modern .NET architecture ideas and syntax (nullability support, DI, records) and most of all, seeks to avoid any breaking changes with the existing Dapr.Workflow public API.

This approach simplifies the gRPC client creation to eliminate several types of bugs seen in the development of 1.16 and to further improve reliability and performance of the client, especially during heavy load.

Updating the examples, the only change needed was that requests to get the workflow state return a nullable instance of WorkflowState, but I otherwise saw drop-in support.

Outside of just making it easier to develop and maintain the project, this implementation also fixes several issues raised by the broader community:

#1567 identified issues with Serilog registration because of the additional scope creation as part of the DI registration - because the underlying types are registered differently, the additional scope creation has been removed and this issue will be resolved.

#1537 and #1582 sought more customized workflow serialization support. I'll do you one better - this implementation completely abstracts all serialization into an IWorkflowSerializer and provides a default implementation using System.Text.Json. Via the DI registration methods, you can pass in your own JsonSerializationOptions or even implement your own concrete serializer (just needs to be able to serialize/deserialize to and from a string) to support MessagePack, BSON or whatever you want and it'll just work. Do use some caution here - changing any of these settings means that when a workflow is rehydrated, it may not deserialize properly and would throw instead of complete successfully. Further, if you're using multi-app run (not yet supported in .NET, but WIP), your other applications will need to similarly support the same serialization scheme - to my knowledge, all other Dapr SDKs support JSON exclusively, so be advised.

#1532 calls to making it easier to demonstrate testing workflows, so I've added several interfaces throughout that can be used to facilitate this.

I've added support for task execution IDs per #1541 and am working on multi-app run per #1636 along with a bunch of unit tests to validate it through.

No changes should be necessary to the documentation as it should be a drop-in replacement for the existing public API, even though the entire backing apparatus has changed.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

… the SDK

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
… necessary types from Dapr.Workflow to generalize them and reworking to modernize and improve them

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…egistering gRPC client with no request/response size limits and without timeouts that uses an IHttpClientFactory to provision clients.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…rotocolHandler (for processing workflow messages)

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…r, WorkflowActivityContextImpl, WorkflowOrchestrationContext and WorkflowWorker)

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…pe may include other values in the near future

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…d `ILogger<T>` instances properly

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…generic type and via functions

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…s, and fix a typo

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
… new approach in how registration is performed under the hood, this also resolves the issue raised at dapr#1567

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…d for it

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…his be using custom JsonSerializerOptions or even swapping it altogether to use MessagePack/BSON. So long as the implementation serializes to a string, it can be registered and used throughout Dapr.Workflow.

This solves dapr#1537

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant