Skip to content

feat: add workflow schedules - #1908

Merged
javier-aliaga merged 3 commits into
dapr:masterfrom
JoshVanL:workflow-schedules
Nov 17, 2026
Merged

javier-aliaga merged 3 commits into
dapr:masterfrom
JoshVanL:workflow-schedules

Conversation

@JoshVanL

Copy link
Copy Markdown
Member

Add the workflow schedule API (dapr/dapr#11095) to DaprWorkflowClient: createWorkflowSchedule (by workflow name or class), getWorkflowSchedule, listWorkflowSchedules (paged), deleteWorkflowSchedule and triggerWorkflowSchedule. WorkflowScheduleOptions covers input, due and expiration times, repeats, target app ID and namespace, overwrite and skip missed. Results are WorkflowSchedule, WorkflowScheduleStatus, WorkflowScheduleRun, WorkflowScheduleState and WorkflowSchedulePage. listInstanceIds takes an instance ID prefix, which lists a schedule's runs. DurableTaskClient and DurableTaskGrpcClient get the same calls.

Pin durabletask-protobuf to v0.7.0 and download workflow_schedule.proto.

Tests: unit tests for both clients, and WorkflowSchedulesIT (dapr-head) on the daprd, placement and scheduler edge images. Add a workflows/schedule example, validated with mechanical-markdown in a new validate.yml leg built from dapr master (continue-on-error). That leg needs Go 1.26.

Requires Dapr 1.20 or later.

@JoshVanL
JoshVanL requested review from a team as code owners November 13, 2026 14:22
Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:22

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

New abstract client methods break compatibility with existing subclasses and can trigger AbstractMethodError, while stalled schedule runs throw instead of exposing their status.

2 open issues
What changed in this PR

Adds recurring workflow scheduling to the Java SDK through DaprWorkflowClient and the underlying Durable Task client, targeting Dapr 1.20 or later.

Changes:

  • Adds schedule creation, retrieval, pagination, deletion and manual triggering, with options, result models and instance-ID prefix filtering.
  • Pins Durable Task protobuf definitions to v0.7.0 and downloads the schedule schema.
  • Adds unit tests, edge-runtime integration tests and a runnable example validated in a non-blocking Dapr master CI leg.
File Description
sdk-workflows/​src/​test/​java/​io/​dapr/​workflows/​client/​DaprWorkflowClientTest.java Tests schedule APIs, result mapping and prefix filtering.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​WorkflowScheduleStatus.java Exposes schedule state, timing and run details.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​WorkflowScheduleState.java Defines schedule lifecycle states.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​WorkflowScheduleRun.java Exposes individual run metadata and failures.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​WorkflowSchedulePage.java Wraps paginated schedule results.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​WorkflowScheduleOptions.java Adds scheduling, routing and catch-up options.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​WorkflowSchedule.java Wraps schedule configuration and status.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​WorkflowClientConverter.java Converts schedule options to protobuf.
sdk-workflows/​src/​main/​java/​io/​dapr/​workflows/​client/​DaprWorkflowClient.java Adds public schedule operations and prefix filtering.
sdk-tests/​src/​test/​java/​io/​dapr/​it/​testcontainers/​workflows/​WorkflowSchedulesIT.java Tests schedules against Dapr edge images.
sdk-tests/​src/​test/​java/​io/​dapr/​it/​testcontainers/​workflows/​ScheduleTestWorkflow.java Provides an input-echoing test workflow.
pom.xml Pins Durable Task protobuf to v0.7.0.
examples/​src/​main/​java/​io/​dapr/​examples/​workflows/​schedule/​README.md Documents the example and automated validation steps.
examples/​src/​main/​java/​io/​dapr/​examples/​workflows/​schedule/​DemoScheduleWorkflow.java Implements the scheduled report workflow.
examples/​src/​main/​java/​io/​dapr/​examples/​workflows/​schedule/​DemoScheduleWorker.java Hosts the example workflow worker.
examples/​src/​main/​java/​io/​dapr/​examples/​workflows/​schedule/​DemoScheduleClient.java Demonstrates schedule creation, triggering and cleanup.
durabletask-client/​src/​test/​java/​io/​dapr/​durabletask/​DurableTaskGrpcClientWorkflowScheduleTest.java Tests schedule RPCs and request serialization.
durabletask-client/​src/​main/​java/​io/​dapr/​durabletask/​OrchestrationRuntimeStatus.java Makes protobuf status conversion public.
durabletask-client/​src/​main/​java/​io/​dapr/​durabletask/​FailureDetails.java Makes protobuf failure construction public.
durabletask-client/​src/​main/​java/​io/​dapr/​durabletask/​DurableTaskGrpcClient.java Implements schedule RPCs and prefix filtering.
durabletask-client/​src/​main/​java/​io/​dapr/​durabletask/​DurableTaskClient.java Extends the client contract with schedule operations.
durabletask-client/​pom.xml Downloads workflow_schedule.proto during initialization.
.github/​workflows/​validate.yml Adds Dapr master example validation and Go 1.26 setup.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:37

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.

🟢 Approval recommended

No active review issues block the recurring workflow scheduling changes.

2 open issues

Review effort: Balanced

Add the workflow schedule API (dapr/dapr#11095) to DaprWorkflowClient:
createWorkflowSchedule (by workflow name or class),
getWorkflowSchedule, listWorkflowSchedules (paged),
deleteWorkflowSchedule and triggerWorkflowSchedule.
WorkflowScheduleOptions covers input, due and expiration times,
repeats, target app ID and namespace, overwrite and skip missed.
Results are WorkflowSchedule, WorkflowScheduleStatus,
WorkflowScheduleRun, WorkflowScheduleState and WorkflowSchedulePage.
listInstanceIds takes an instance ID prefix, which lists a schedule's
runs. DurableTaskClient and DurableTaskGrpcClient get the same calls.

Pin durabletask-protobuf to v0.7.0 and download workflow_schedule.proto.

Tests: unit tests for both clients, and WorkflowSchedulesIT
(dapr-head) on the daprd, placement and scheduler edge images.
Add a workflows/schedule example, validated with mechanical-markdown
in a new validate.yml leg built from dapr master (continue-on-error).
That leg needs Go 1.26.

Requires Dapr 1.20 or later.

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:58

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.

🟢 Approval recommended

No active review issues remain for the workflow scheduling changes.

2 open issues

Review effort: Balanced

@javier-aliaga

Copy link
Copy Markdown
Contributor

@JoshVanL it seems there is a port conflict and the test are failing because the apps cannot start

Signed-off-by: joshvanl <me@joshvanl.dev>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 14:25
@JoshVanL

Copy link
Copy Markdown
Member Author

@javier-aliaga thanks- should be fixed

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.

🟢 Approval recommended

No active review issues are recorded for the recurring workflow scheduling changes.

1 open issue
1 resolved since last review

Review effort: Balanced

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.79882% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.01%. Comparing base (02c613f) to head (c1dcb7f).

Files with missing lines Patch % Lines
.../dapr/workflows/task/client/DurableTaskClient.java 0.00% 9 Missing ⚠️
...ava/io/dapr/workflows/client/WorkflowSchedule.java 53.33% 0 Missing and 7 partials ⚠️
.../dapr/workflows/client/WorkflowScheduleStatus.java 64.28% 2 Missing and 3 partials ⚠️
.../io/dapr/workflows/client/WorkflowScheduleRun.java 84.61% 0 Missing and 2 partials ⚠️
...r/workflows/task/client/DurableTaskGrpcClient.java 97.14% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1908      +/-   ##
============================================
+ Coverage     81.99%   82.01%   +0.02%     
- Complexity     3663     3754      +91     
============================================
  Files           331      337       +6     
  Lines         11367    11535     +168     
  Branches       1290     1303      +13     
============================================
+ Hits           9320     9461     +141     
- Misses         1553     1567      +14     
- Partials        494      507      +13     

☔ 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.

@javier-aliaga
javier-aliaga merged commit 9819808 into dapr:master Nov 17, 2026
17 checks passed
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.

3 participants