-
Notifications
You must be signed in to change notification settings - Fork 159
Document the difference between an event-driven schedule and a startup listen task #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ricardozanini
merged 10 commits into
serverlessworkflow:main
from
neuroglia-io:fix-schedule-on-documentation
Aug 21, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0a5b965
- Documented the difference between an event-driven schedule and a st…
cdavernas 974edfb
Merge branch 'main' into fix-schedule-on-documentation
cdavernas 7a8d53d
Added an event-driven subsection to scheduling to explain expected wo…
cdavernas cfa4b6f
Merge branch 'fix-schedule-on-documentation' of https://github.com/ne…
cdavernas 8f28707
Merge branch 'main' into fix-schedule-on-documentation
cdavernas 5d7a598
Update dsl.md
cdavernas eedfe91
Update dsl.md
cdavernas 856bbe9
Update dsl.md
cdavernas 504b0d0
Update dsl.md
cdavernas de12562
Update dsl.md
cdavernas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
document: | ||
dsl: 1.0.0-alpha1 | ||
namespace: examples | ||
name: cron-schedule | ||
version: 1.0.0-alpha1 | ||
schedule: | ||
cron: 0 0 * * * | ||
do: | ||
- backup: | ||
call: http | ||
with: | ||
method: post | ||
endpoint: https://example.com/api/v1/backup/start |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
document: | ||
dsl: 1.0.0-alpha1 | ||
namespace: examples | ||
name: event-driven-schedule | ||
version: 1.0.0-alpha1 | ||
schedule: | ||
on: | ||
one: | ||
with: | ||
type: com.example.hospital.events.patients.heartbeat.low | ||
do: | ||
- callNurse: | ||
call: http | ||
with: | ||
method: post | ||
endpoint: https://hospital.example.com/api/v1/notify | ||
body: | ||
patientId: ${ $workflow.input[0].data.patient.id } | ||
patientName: ${ $workflow.input[0].data.patient.name } | ||
roomNumber: ${ $workflow.input[0].data.patient.room.number } | ||
vitals: | ||
heartRate: ${ $workflow.input[0].data.patient.vitals.bpm } | ||
timestamp: ${ $workflow.input[0].data.timestamp } | ||
message: "Alert: Patient's heartbeat is critically low. Immediate attention required." |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have to use a listener task instead in this example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on what you want to achieve.
The objective here is to trigger a new workflow when and only when the event is received.
Using a listen task would mean you'd have started a workflow out of the blue, then wait potentially forever for an event to be consumed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on our private conversation, we agreed to follow up with an issue to review the
schedule.on
naming since it may confuse users. Some may expect thatschedule
enforces a timestamp definition.