Skip to content

Conversation

Cyb3rWard0g
Copy link
Collaborator

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

  • Added decorators/routers.py
    • Implements a new @message_router decorator for schema-aware message routing
    • Fully compatible with native WorkflowRuntime and DaprClient lifecycle
    • Supports Union types, forward references, and robust model validation
    • Designed for explicit developer control rather than hidden orchestration
  • Added supporting utilities
    • utils/routers.py: message extraction, validation, and CloudEvent parsing helpers
    • utils/registration.py: register_message_handlers() for runtime subscription via the active DaprClient
  • Deprecated legacy message router
    • Added deprecation warnings to decorators/messaging.py
    • Directs users to migrate to the new Dapr-native decorator
  • Added new Message Router Workflow Quickstart
    • Demonstrates event-driven orchestration using Pub/Sub → Workflow integration
    • Includes LLM-powered create_outline and write_post workflow activities
    • Adds message_client.py publisher and updated README with full configuration
  • Updated quickstart index
    • Added Message Router Workflow alongside LLM- and Agent-based patterns

Check the new quickstart quickstarts/04-agent-based-workflows/README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant