Skip to content

Dapr Agents: document pub/sub routes that signal running workflows - #5340

Open
CasperGN wants to merge 4 commits into
dapr:v1.18from
CasperGN:dapr-agents-workflow-event-routes
Open

CasperGN wants to merge 4 commits into
dapr:v1.18from
CasperGN:dapr-agents-workflow-event-routes

Conversation

@CasperGN

@CasperGN CasperGN commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Documents pub/sub routes that deliver messages to workflows that are already running, added in dapr/dapr-agents#817 (closes dapr/dapr-agents#740).

Adds a "Signaling Running Workflows from Pub/Sub" section to the Dapr Agents core concepts page, next to "Message Router Workflows":

  • When to use WorkflowEventRouteSpec instead of @message_router, with an example.
  • Resolvers for the target instance, event name and payload (callable or dotted path), and their defaults.
  • What happens when the workflow has finished, hasn't started yet, or a sidecar call fails or times out, and how dead-letter topics and pub/sub inbound resiliency policies interact with the not-found retry.
  • Deduplication, and why event names must be unique per wait.
  • Limits on identifiers and payload size, and the reserved approval_response_ / user_input_response: event names.
  • Security: anyone who can publish to the topic can signal any instance, so use pub/sub topic scoping. The optional authorize(message, ctx, target) hook and the filters have three outcomes: exactly True allows; False, a non-bool or an exception drops; a timeout or saturated hook pool retries within a budget and is then dead-lettered (or dropped with a rate-limited warning). Nothing is raised without an explicit True. CloudEvent source is publisher-supplied.
  • When an event can still be raised twice (restart, dedupe=False, crash before the ack, another replica without a shared deduper), how timed-out raises are tracked, and how deduplication keys on the id plus the resolved target and data.
  • Permanent sidecar errors (INVALID_ARGUMENT, PERMISSION_DENIED, …) are handled like a finished workflow, and the outcomes table follows evaluation order.
  • Throughput and scaling: one message at a time per event-route topic, two sidecar calls per message, and running the subscriber in the app that hosts the workflow.

The external-events link points to workflow-features-concepts.md#external-events-1, the second of the two "External events" headings on that page (the one about buffering), since both headings produce the same base anchor.

🤖 Generated with Claude Code

Add a section on WorkflowEventRouteSpec: when to use it instead of a
message router, registration through AgentRunner, WorkflowRunner and
register_message_routes, resolver semantics for instance id, event name
and data, delivery outcomes (terminal, not found, transient, call
timeout), how the Dapr runtime dead-letters DROP and RETRY responses,
limits on identifiers and payload size, reserved event names, unique
event names per wait, deduplication and its capacity, throughput and
scaling, the requirement to subscribe in the app that hosts the
workflow, and a security note on topic scoping.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
CasperGN and others added 3 commits September 26, 2026 19:16
Document the authorize hook and hook_timeout_seconds, strict filters on
event routes, permanent sidecar errors, how timed-out raises are handled
on redelivery, when an event can still be raised twice, case-folded
reserved names, and the cost of resolvers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
… order

Document that authorize receives the resolved WorkflowEventTarget, that
CloudEvent attributes are publisher-supplied, and that hooks fail closed.
List delivery outcomes in evaluation order, explain exact-message matching
for timed-out raises, the separate hook and sidecar pools, the per-hook
cost, unique CloudEvent ids, and the canonical-JSON dedupe key shared by
every deduplicating route.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
…oped dedupe

Describe the ALLOW / DENY / UNDECIDED hook outcomes (bounded retry, then
dead-letter or a rate-limited drop), the event route dedupe key that
covers the resolved target and data so reused CloudEvent ids no longer
hide messages, and the pool behavior for calls that time out while
queued.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
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.

Should Dapr Agents provide a Pub/Sub route for signaling workflow external-event waits?

1 participant