Skip to content

Commit 7a8d53d

Browse files
committed
Added an event-driven subsection to scheduling to explain expected workflow input
Signed-off-by: Charles d'Avernas <[email protected]>
1 parent 0a5b965 commit 7a8d53d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dsl.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [Components](#components)
1313
+ [Task](#task)
1414
- [Scheduling](#scheduling)
15+
+ [Event-Driven Scheduling](#event-driven-scheduling)
1516
+ [Task Flow](#task-flow)
1617
+ [Data Flow](#data-flow)
1718
+ [Runtime Expressions](#runtime-expressions)
@@ -150,7 +151,15 @@ Workflow scheduling in ServerlessWorkflow allows developers to specify when and
150151

151152
See the [DSL reference](dsl-reference.md#schedule) for more details about workflow scheduling.
152153

153-
##### Distinguishing event-driven Scheduling from start `listen` Tasks
154+
##### Event-driven scheduling
155+
156+
###### Input of event-driven scheduled workflows
157+
158+
In event-driven scheduled workflows, the input is structured as an array containing the events that trigger the execution of the workflow. This array serves as a vital resource, providing workflow authors with access to all relevant data associated with each triggering event. When an event activates the workflow, it populates this array with one or more occurrences, allowing authors to process multiple events simultaneously as needed.
159+
160+
Authors can reference individual events within the array using syntax such as $workflow.input[index], where index indicates the position of the event, starting from 0. For instance, $workflow.input[0] refers to the first event, while $workflow.input[1] refers to the second. This structure allows for easy access to specific event details, and if multiple events are received at once, authors can iterate through the array to handle each one appropriately. This flexibility ensures that workflows can respond effectively to various conditions and triggers, enhancing their overall responsiveness and functionality.
161+
162+
###### Distinguishing event-driven scheduling from start `listen` Tasks
154163

155164
While both `schedule.on` and a start listener task enable event-driven execution of workflows, they serve distinct purposes and have different implications:
156165

0 commit comments

Comments
 (0)