You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/README.md
+162Lines changed: 162 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,8 @@ Provides Serverless Workflow language examples
28
28
-[Book Lending Workflow](#Book-Lending)
29
29
-[Filling a glass of water (Expression functions)](#Filling-a-glass-of-water)
30
30
-[Online Food Ordering](#Online-Food-Ordering)
31
+
-[Online Food Ordering](#Online-Food-Ordering)
32
+
-[Continuing as a new Execution](#Continuing-as-a-new-Execution)
31
33
32
34
### Hello World Example
33
35
@@ -4234,3 +4236,163 @@ For the example order event, the workflow output for a successful completion wou
4234
4236
]
4235
4237
}
4236
4238
```
4239
+
4240
+
### Continuing as a new Execution
4241
+
4242
+
#### Description
4243
+
4244
+
Some runtime implementations on which we run our workflows can have different quotas, such as maximum execution durations, maximum consumed events, etc. We can use the Serverless workflow "continueAs" functionality that can be used to stop the current workflow execution and start another one (of the same or a different type). This is very useful in cases where we have to ensure we don't reach the imposed quotas of single workflow execution.
4245
+
4246
+
This example assumes that the runtime we are using has a quota set to a maximum of one thousand consumed events per single workflow execution.
4247
+
Our sample workflow consumes a single customer event at a time and invokes the `emailCustomer` function.
4248
+
Note that we do not set a workflow `workflowExecTimeout`, so we intend to have a long-running workflow. However, because of the runtime restriction, in this case, we would run into the event consume limit, and our workflow would have to terminate. We can fix this problem by using [`continueAs`](../specification.md#Continuing-as-a-new-Execution), which will allow us to make sure that we reach the given limit and then continue our workflow execution as a new run.
4249
+
4250
+
We assume that our workflow input has the runtime-imposed quota:
Copy file name to clipboardExpand all lines: roadmap/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ _Status description:_
28
28
| ✔️| ForEach state "iterationParam" no longer a required property |[spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md)|
29
29
| ✔️| Added "useData" for eventDataFilter, and "useResults" for actionDataFilter |[spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md)|
30
30
| ✔️| Added "resultEventTimeout" for action eventref |[spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md)|
31
+
| ✔️| Added example for "continueAs" |[examples doc](https://github.com/serverlessworkflow/specification/blob/main/examples/README.md)|
0 commit comments