fix #1251 - Add timers and scheduler to the DSL#1274
Merged
fjtirado merged 2 commits intoserverlessworkflow:mainfrom Mar 27, 2026
Merged
fix #1251 - Add timers and scheduler to the DSL#1274fjtirado merged 2 commits intoserverlessworkflow:mainfrom
fjtirado merged 2 commits intoserverlessworkflow:mainfrom
Conversation
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds spec-compliant timeout + schedule configuration to the fluent DSL (spec + experimental func), including new builders and facade methods, plus tests covering builder guardrails and workflow integration.
Changes:
- Introduces
TimeoutBuilderandScheduleBuilderand exposes fluent shortcuts viafluent.spec.dsl.DSL. - Adds workflow/task-level
.timeout(...)and workflow-level.schedule(...)support in the fluent builders. - Adds unit/integration tests for timeouts/schedules and wires equivalent facades into
FuncDSL, plus a small Maven module name tweak.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/persistence/pom.xml | Renames Maven module display name for consistency. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/dsl/DSL.java | Adds DSL shortcut methods for timeouts, schedules, and schedule event strategies. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TimeoutBuilder.java | New builder for timeout duration (inline vs string). |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/ScheduleBuilder.java | New builder enforcing mutually-exclusive schedule triggers and duration configuration. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/BaseWorkflowBuilder.java | Adds workflow-level timeout(...) and schedule(...). |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TaskBaseBuilder.java | Adds task-level timeout(...). |
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/dsl/DSLTimeoutTest.java | Adds tests for workflow/task timeout configuration + validation. |
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/dsl/DSLScheduleTest.java | Adds tests for workflow schedule configuration via DSL shortcuts. |
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/ScheduleBuilderTest.java | Adds tests for ScheduleBuilder validation and mapping. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncDSL.java | Adds facade delegates to base DSL (timeouts/schedules/strategies + auth/use). |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java | Adds task-level timeout hooks to func DSL steps. |
| experimental/fluent/func/src/test/java/io/serverlessworkflow/fluent/func/FuncDSLScheduleTest.java | Adds tests validating schedule chaining via func workflow builder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TimeoutBuilder.java
Show resolved
Hide resolved
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TimeoutBuilder.java
Show resolved
Hide resolved
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/ScheduleBuilder.java
Show resolved
Hide resolved
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/ScheduleBuilder.java
Show resolved
Hide resolved
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/ScheduleBuilder.java
Show resolved
Hide resolved
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/BaseWorkflowBuilder.java
Show resolved
Hide resolved
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TaskBaseBuilder.java
Show resolved
Hide resolved
fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/dsl/DSLTimeoutTest.java
Show resolved
Hide resolved
Member
Author
|
Comments from co-pilot are not relevant. |
fjtirado
reviewed
Mar 26, 2026
fjtirado
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1251
Implements spec-compliant Timeouts and Schedules, and refactors FuncDSL using a Facade pattern to delegate shared configurations to the base DSL, providing a unified developer experience.
Key Changes
Timeouts & Schedules: Added TimeoutBuilder and ScheduleBuilder with fluent shortcuts (timeoutMinutes, every, cron, after, on). Includes strict spec validation to prevent inline/expression collisions and enforce mutually exclusive schedule triggers.
DSL Unification: Extracted duplicated methods (Timeouts, Schedules, Auth, Event Strategies) from FuncDSL and replaced them with Facade delegates to spec.dsl.DSL. Users can now rely exclusively on import static FuncDSL.* without IDE import conflicts.
Testing: Added DSLTimeoutTest, ScheduleBuilderTest, DSLScheduleTest, and FuncDSLScheduleTest to validate low-level builder guardrails and high-level workflow integrations.