Enable Native Dapr Workflows with Message Router Decorators #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR Depends on #232
Overview
This PR introduces a new
@message_router
decorator that enables native Dapr workflow orchestration triggered directly from Pub/Sub messages without relying on legacy Dapr Agents abstractions. Developers now have full control over the Dapr Workflow runtime and Pub/Sub client, allowing workflows and LLM/Agent activities to be registered, composed, and executed using the official Dapr APIs.This update modernizes the message routing layer to align with Dapr’s workflow primitives, improving transparency, flexibility, and maintainability.
Key Changes
decorators/routers.py
@message_router
decorator for schema-aware message routingWorkflowRuntime
and DaprClient lifecycleutils/routers.py
: message extraction, validation, and CloudEvent parsing helpersutils/registration.py
:register_message_handlers()
for runtime subscription via the active DaprClientdecorators/messaging.py
Message Router Workflow
Quickstartmessage_client.py
publisher and updated README with full configurationMessage Router Workflow
alongside LLM- and Agent-based patterns