Skip to content

Workflow: cross-app client operations - #1201

Open
JoshVanL wants to merge 2 commits into
dapr:mainfrom
JoshVanL:workflow-cross-app-operations
Open

Workflow: cross-app client operations#1201
JoshVanL wants to merge 2 commits into
dapr:mainfrom
JoshVanL:workflow-cross-app-operations

Conversation

@JoshVanL

@JoshVanL JoshVanL commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Adds an optional app_id argument to every client-level workflow operation on DaprWorkflowClient and its async counterpart: schedule_new_workflow, get_workflow_state, wait_for_workflow_start, wait_for_workflow_completion, raise_workflow_event, terminate_workflow, pause_workflow, resume_workflow and purge_workflow. When set, the operation targets a workflow instance owned by another app in the same namespace, and the target app's WorkflowAccessPolicy decides whether it is permitted. When unset or equal to the local app, the behaviour is unchanged.

The vendored durabletask client carries the value as a TaskRouter with targetAppID on each request, built by the new new_task_router helper. An older runtime ignores the field and applies the operation locally.

Adds an optional app_id argument to every client-level workflow
operation on DaprWorkflowClient and its async counterpart:
schedule_new_workflow, get_workflow_state, wait_for_workflow_start,
wait_for_workflow_completion, raise_workflow_event, terminate_workflow,
pause_workflow, resume_workflow and purge_workflow. When set, the
operation targets a workflow instance owned by another app in the same
namespace, and the target app's WorkflowAccessPolicy decides whether it
is permitted. When unset or equal to the local app, the behaviour is
unchanged.

The vendored durabletask client carries the value as a TaskRouter with
targetAppID on each request, built by the new new_task_router helper. An older
runtime ignores the field and applies the operation locally.

Signed-off-by: joshvanl <me@joshvanl.dev>
@JoshVanL
JoshVanL requested review from a team as code owners September 9, 2026 16:06
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 24.85207% with 127 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.77%. Comparing base (e4ad181) to head (6732be7).

Files with missing lines Patch % Lines
.../_durabletask/internal/orchestrator_service_pb2.py 1.85% 53 Missing ⚠️
...rkflow/_durabletask/internal/history_events_pb2.py 2.38% 41 Missing ⚠️
.../_durabletask/internal/orchestrator_actions_pb2.py 5.00% 19 Missing ⚠️
...orkflow/_durabletask/internal/orchestration_pb2.py 6.66% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1201      +/-   ##
==========================================
+ Coverage   83.15%   83.77%   +0.61%     
==========================================
  Files         123      123              
  Lines       10260    10266       +6     
==========================================
+ Hits         8532     8600      +68     
+ Misses       1728     1666      -62     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Proto provenance is inconsistent with generated output, and cross-app purge semantics are documented incorrectly.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds cross-app routing to synchronous and asynchronous workflow client operations using TaskRouter.

Changes:

  • Adds optional app_id forwarding across workflow lifecycle operations.
  • Regenerates durabletask protocol bindings and improves regeneration provenance.
  • Adds unit and integration coverage for cross-app routing.
File summaries
File Description
tools/regen_durabletask_protos.sh Supports local proto sources and records provenance.
tests/integration/test_workflow_cross_app.py Tests cross-app workflow operations end to end.
tests/integration/conftest.py Refines app-channel readiness checks.
tests/integration/apps/workflow_host.py Provides the remote workflow host.
tests/ext/workflow/test_workflow_client.py Tests sync app_id forwarding.
tests/ext/workflow/test_workflow_client_aio.py Tests async app_id forwarding.
tests/ext/workflow/durabletask/test_orchestration_executor.py Updates action-router assertions.
tests/ext/workflow/durabletask/test_client_routing.py Verifies routing on generated requests.
dapr/ext/workflow/dapr_workflow_client.py Exposes cross-app sync operations.
dapr/ext/workflow/aio/dapr_workflow_client.py Exposes cross-app async operations.
dapr/ext/workflow/_durabletask/internal/PROTO_SOURCE_COMMIT_HASH Updates recorded proto source revision.
dapr/ext/workflow/_durabletask/internal/orchestrator_service_pb2.pyi Adds typed operation-router fields.
dapr/ext/workflow/_durabletask/internal/orchestrator_service_pb2.py Updates generated operation protocol descriptors.
dapr/ext/workflow/_durabletask/internal/orchestrator_actions_pb2.pyi Updates generated action types.
dapr/ext/workflow/_durabletask/internal/orchestrator_actions_pb2.py Updates generated action descriptors.
dapr/ext/workflow/_durabletask/internal/orchestration_pb2.pyi Adds generated workflow metadata types.
dapr/ext/workflow/_durabletask/internal/orchestration_pb2.py Updates orchestration descriptors.
dapr/ext/workflow/_durabletask/internal/history_events_pb2.pyi Adds child-retry metadata typing.
dapr/ext/workflow/_durabletask/internal/history_events_pb2.py Updates history event descriptors.
dapr/ext/workflow/_durabletask/internal/helpers.py Keeps routing on enclosing workflow actions.
dapr/ext/workflow/_durabletask/internal/backend_service_pb2.pyi Adds unique-instance request typing.
dapr/ext/workflow/_durabletask/internal/backend_service_pb2.py Updates backend protocol descriptors.
dapr/ext/workflow/_durabletask/client.py Builds and attaches sync task routers.
dapr/ext/workflow/_durabletask/aio/client.py Builds and attaches async task routers.
Review details

Files not reviewed (5)

  • dapr/ext/workflow/_durabletask/internal/backend_service_pb2.py: Generated file
  • dapr/ext/workflow/_durabletask/internal/history_events_pb2.py: Generated file
  • dapr/ext/workflow/_durabletask/internal/orchestration_pb2.py: Generated file
  • dapr/ext/workflow/_durabletask/internal/orchestrator_actions_pb2.py: Generated file
  • dapr/ext/workflow/_durabletask/internal/orchestrator_service_pb2.py: Generated file

Suppressed comments (1)

tests/ext/workflow/durabletask/test_orchestration_executor.py:770

  • This is the without_app_id case, so the docstring still describes the opposite scenario.
    """Tests that the workflow action carries correct router fields when app_id is specified"""
  • Files reviewed: 19/24 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/regen_durabletask_protos.sh
Comment thread dapr/ext/workflow/aio/dapr_workflow_client.py
Comment thread dapr/ext/workflow/dapr_workflow_client.py
Comment thread tests/ext/workflow/durabletask/test_orchestration_executor.py Outdated
Signed-off-by: joshvanl <me@joshvanl.dev>
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.

2 participants