Repository navigation
feat: add workflow schedules - #1908
Conversation
There was a problem hiding this comment.
🟡 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
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>
8d05f80 to
3f10f87
Compare
|
@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>
|
@javier-aliaga thanks- should be fixed |
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|


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.