@@ -59,17 +59,19 @@ graph LR
59
59
```
60
60
61
61
<!-- STEP
62
- name: Start Customer Workflow
62
+ name: Start Chain Activities Workflow
63
63
match_order: none
64
64
output_match_mode: substring
65
65
expected_stdout_lines:
66
- - 'New Workflow Instance created for Customer '
66
+ - 'TOKYO, LONDON, SEATTLE '
67
67
background: true
68
68
sleep: 1
69
69
timeout_seconds: 2
70
70
-->
71
71
<!-- Timeout for above service must be more than sleep + timeout for the client-->
72
72
73
+ To start the workflow with the three chained activities you can run:
74
+
73
75
``` sh
74
76
curl -X POST localhost:8080/wfp/chain -H ' Content-Type: application/json'
75
77
```
@@ -102,6 +104,9 @@ In the application output you should see the workflow activities being executed.
102
104
103
105
### Parent / Child Workflows example
104
106
107
+ In this example we start a Parent workflow that calls a child workflow that execute one activity that reverse the .
108
+
109
+ The Parent workflow looks like this:
105
110
106
111
``` mermaid
107
112
graph LR
@@ -110,15 +115,79 @@ graph LR
110
115
subgraph for each word in the input
111
116
GWL[Call child workflow]
112
117
end
113
- ALL[Wait until all tasks
114
- are completed]
115
118
EW((End
116
119
Workflow))
117
120
SW --> GWL
118
- GWL --> ALL
119
- ALL --> EW
121
+ GWL --> EW
120
122
```
121
123
124
+ The Child workflow looks like this:
125
+
126
+ ``` mermaid
127
+ graph LR
128
+ SW((Start
129
+ Workflow))
130
+ A1[Activity1]
131
+ EW((End
132
+ Workflow))
133
+ SW --> A1
134
+ A1 --> EW
135
+ ```
136
+
137
+ To start the parent workflow you can run:
138
+
139
+
140
+ <!-- STEP
141
+ name: Start Parent/Child Workflow
142
+ match_order: none
143
+ output_match_mode: substring
144
+ expected_stdout_lines:
145
+ - '!wolfkroW rpaD olleH'
146
+ background: true
147
+ sleep: 1
148
+ timeout_seconds: 2
149
+ -->
150
+ <!-- Timeout for above service must be more than sleep + timeout for the client-->
151
+
152
+ To start the workflow with the three chained activities you can run:
153
+
154
+ ``` sh
155
+ curl -X POST localhost:8080/wfp/child -H ' Content-Type: application/json'
156
+ ```
157
+
158
+ <!-- END_STEP -->
159
+
160
+
161
+ As result from executing the request you should see:
162
+
163
+ ``` bash
164
+ ! wolfkroW rpaD olleH
165
+ ```
166
+
167
+ In the application output you should see the workflow activities being executed.
168
+
169
+ ``` bash
170
+ 2025-05-16T10:27:01.845+01:00 INFO 9855 --- [pool-3-thread-1] io.dapr.workflows.WorkflowContext : Starting Workflow: io.dapr.springboot.examples.wfp.child.ParentWorkflow
171
+ 2025-05-16T10:27:01.845+01:00 INFO 9855 --- [pool-3-thread-1] io.dapr.workflows.WorkflowContext : calling childworkflow with input: Hello Dapr Workflow!
172
+ 2025-05-16T10:27:01.865+01:00 INFO 9855 --- [nio-8080-exec-1] i.d.s.e.w.WorkflowPatternsRestController : Workflow instance f3ec9566-a0fc-4d28-8912-3f3ded3cd8a9 started
173
+ 2025-05-16T10:27:01.866+01:00 INFO 9855 --- [pool-3-thread-2] io.dapr.workflows.WorkflowContext : Starting ChildWorkflow: io.dapr.springboot.examples.wfp.child.ChildWorkflow
174
+ 2025-05-16T10:27:01.868+01:00 INFO 9855 --- [pool-3-thread-2] io.dapr.workflows.WorkflowContext : ChildWorkflow received input: Hello Dapr Workflow!
175
+ 2025-05-16T10:27:01.868+01:00 INFO 9855 --- [pool-3-thread-2] io.dapr.workflows.WorkflowContext : ChildWorkflow is calling Activity: io.dapr.springboot.examples.wfp.child.ReverseActivity
176
+ 2025-05-16T10:27:01.874+01:00 INFO 9855 --- [pool-3-thread-3] i.d.s.e.wfp.child.ReverseActivity : Starting Activity: io.dapr.springboot.examples.wfp.child.ReverseActivity
177
+ 2025-05-16T10:27:01.874+01:00 INFO 9855 --- [pool-3-thread-3] i.d.s.e.wfp.child.ReverseActivity : Message Received from input: Hello Dapr Workflow!
178
+ 2025-05-16T10:27:01.874+01:00 INFO 9855 --- [pool-3-thread-3] i.d.s.e.wfp.child.ReverseActivity : Sending message to output: ! wolfkroW rpaD olleH
179
+ 2025-05-16T10:27:01.882+01:00 INFO 9855 --- [pool-3-thread-1] io.dapr.workflows.WorkflowContext : ChildWorkflow finished with: ! wolfkroW rpaD olleH
180
+ 2025-05-16T10:27:01.892+01:00 INFO 9855 --- [pool-3-thread-2] io.dapr.workflows.WorkflowContext : childworkflow finished with: ! wolfkroW rpaD olleH
181
+ ```
182
+
183
+ ### ContinueAsNew Workflows example
184
+
185
+
186
+ ### External Event Workflow example
187
+
188
+
189
+ ### Fan Out/In Workflow example
190
+
122
191
123
192
## Testing workflow executions
124
193
0 commit comments