@@ -30,6 +30,7 @@ For this reason, the event, function, retry, and data mapping defined in the ass
3030- [ Error Handling with Retries] ( #Error-Handling-With-Retries )
3131- [ Process Execution Timeout] ( #Process-Execution-Timeout )
3232- [ Multiple Instance Subprocess] ( #Multiple-Instance-Subprocess )
33+ - [ Loop Subprocess] ( #Loop-Subprocess )
3334- [ Approve Report (User Task)] ( #Approve-Report )
3435- [ Event Based Decision] ( #Event-Based-Decision )
3536
@@ -305,26 +306,63 @@ functions:
305306</td>
306307<td valign="top">
307308
309+ ` ` ` yaml
310+ id : foreachWorkflow
311+ name : ForEach State Workflow
312+ version : ' 1.0'
313+ start : ForEachItem
314+ states :
315+ - name : ForEachItem
316+ type : foreach
317+ inputCollection : " ${ .inputsArray }"
318+ iterationParam : " ${ .inputItem }"
319+ outputCollection : " ${ .outputsArray }"
320+ workflowId : doSomethingAndWaitForMessage
321+ end : true
322+ ` ` `
323+
324+ </td>
325+ </tr>
326+ </table>
327+
328+ * Note: We did not include the ` dosomethingandwaitformessage` workflow in this example, which would just include
329+ a starting "operation" state transitioning to an "event" state which waits for the needed event.
330+
331+ # ## Loop Subprocess
332+
333+ <table>
334+ <tr>
335+ <th>BPMN2 Diagram</th>
336+ <th>Serverless Workflow</th>
337+ </tr>
338+ <tr>
339+ <td valign="top">
340+ <p align="center">
341+ <img src="../media/comparisons/bpmn/loop-subprocess.png" width="500px" alt="BPMN2 Loop Subprocess Workflow"/>
342+ </p>
343+ </td>
344+ <td valign="top">
345+
308346` ` ` yaml
309347id: subflowloop
310- name : SubFlow Repeat workflow
348+ name: SubFlow Loop Workflow
311349version: '1.0'
312- start : SubflowRepeat
350+ start: SubflowLoop
313351states:
314- - name : SubflowRepeat
352+ - name: SubflowLoop
315353 type: subflow
316- workflowId : dosomethingandwaitformessage
354+ workflowId: checkAndReplyToEmail
317355 repeat:
318- max : 10
356+ max: 100
319357 end: true
320358` ` `
321359
322360</td>
323361</tr>
324362</table>
325363
326- * Note: We did not include the ` dosomethingandwaitformessage ` workflow in this example, which would just include
327- a starting "operation" state transitioning to an "event" state that waits for the needed event .
364+ * Note: We did not include the `checkAndReplyToEmail ` workflow in this example, which would include the
365+ control-flow logic to check email and make a decision to reply to it or wait an hour .
328366
329367# ## Approve Report
330368
0 commit comments