@hotmeshio/hotmesh 0.0.54 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +0 -3
  2. package/build/modules/enums.js +1 -10
  3. package/build/modules/key.d.ts +0 -38
  4. package/build/modules/key.js +4 -46
  5. package/build/modules/utils.d.ts +0 -8
  6. package/build/modules/utils.js +0 -14
  7. package/build/package.json +11 -4
  8. package/build/services/activities/activity.d.ts +0 -28
  9. package/build/services/activities/activity.js +1 -46
  10. package/build/services/activities/await.js +0 -4
  11. package/build/services/activities/cycle.d.ts +0 -7
  12. package/build/services/activities/cycle.js +1 -16
  13. package/build/services/activities/hook.d.ts +0 -6
  14. package/build/services/activities/hook.js +2 -12
  15. package/build/services/activities/interrupt.js +0 -8
  16. package/build/services/activities/signal.d.ts +0 -6
  17. package/build/services/activities/signal.js +0 -15
  18. package/build/services/activities/trigger.d.ts +0 -4
  19. package/build/services/activities/trigger.js +1 -7
  20. package/build/services/activities/worker.js +0 -4
  21. package/build/services/collator/index.d.ts +0 -70
  22. package/build/services/collator/index.js +1 -91
  23. package/build/services/compiler/deployer.js +6 -38
  24. package/build/services/compiler/index.d.ts +0 -15
  25. package/build/services/compiler/index.js +0 -20
  26. package/build/services/compiler/validator.d.ts +0 -3
  27. package/build/services/compiler/validator.js +0 -25
  28. package/build/services/connector/clients/ioredis.d.ts +2 -2
  29. package/build/services/connector/clients/ioredis.js +0 -2
  30. package/build/services/connector/clients/redis.d.ts +4 -4
  31. package/build/services/connector/clients/redis.js +1 -3
  32. package/build/services/connector/index.d.ts +1 -1
  33. package/build/services/connector/index.js +0 -2
  34. package/build/services/durable/client.d.ts +1 -26
  35. package/build/services/durable/client.js +0 -56
  36. package/build/services/durable/exporter.d.ts +0 -22
  37. package/build/services/durable/exporter.js +1 -30
  38. package/build/services/durable/handle.d.ts +0 -36
  39. package/build/services/durable/handle.js +0 -46
  40. package/build/services/durable/index.d.ts +0 -4
  41. package/build/services/durable/index.js +0 -4
  42. package/build/services/durable/schemas/factory.d.ts +0 -29
  43. package/build/services/durable/schemas/factory.js +0 -29
  44. package/build/services/durable/search.d.ts +1 -36
  45. package/build/services/durable/search.js +57 -56
  46. package/build/services/durable/worker.js +2 -22
  47. package/build/services/durable/workflow.d.ts +0 -114
  48. package/build/services/durable/workflow.js +4 -144
  49. package/build/services/engine/index.d.ts +1 -6
  50. package/build/services/engine/index.js +1 -43
  51. package/build/services/exporter/index.d.ts +0 -27
  52. package/build/services/exporter/index.js +0 -33
  53. package/build/services/hotmesh/index.d.ts +2 -2
  54. package/build/services/hotmesh/index.js +1 -9
  55. package/build/services/logger/index.js +0 -2
  56. package/build/services/mapper/index.d.ts +0 -14
  57. package/build/services/mapper/index.js +0 -14
  58. package/build/services/pipe/functions/date.d.ts +0 -7
  59. package/build/services/pipe/functions/date.js +0 -7
  60. package/build/services/pipe/functions/math.js +0 -2
  61. package/build/services/pipe/index.d.ts +0 -15
  62. package/build/services/pipe/index.js +2 -23
  63. package/build/services/quorum/index.d.ts +0 -7
  64. package/build/services/quorum/index.js +0 -21
  65. package/build/services/reporter/index.d.ts +0 -5
  66. package/build/services/reporter/index.js +0 -9
  67. package/build/services/router/index.d.ts +0 -9
  68. package/build/services/router/index.js +2 -38
  69. package/build/services/serializer/index.js +7 -26
  70. package/build/services/store/cache.d.ts +0 -18
  71. package/build/services/store/cache.js +0 -18
  72. package/build/services/store/clients/ioredis.d.ts +1 -1
  73. package/build/services/store/clients/ioredis.js +0 -1
  74. package/build/services/store/clients/redis.d.ts +1 -1
  75. package/build/services/store/index.d.ts +0 -55
  76. package/build/services/store/index.js +5 -81
  77. package/build/services/stream/clients/ioredis.d.ts +1 -1
  78. package/build/services/stream/clients/ioredis.js +1 -4
  79. package/build/services/stream/clients/redis.d.ts +1 -1
  80. package/build/services/sub/clients/ioredis.d.ts +1 -1
  81. package/build/services/sub/clients/redis.d.ts +1 -1
  82. package/build/services/task/index.d.ts +0 -9
  83. package/build/services/task/index.js +0 -31
  84. package/build/services/telemetry/index.d.ts +0 -7
  85. package/build/services/telemetry/index.js +1 -13
  86. package/build/services/worker/index.d.ts +0 -4
  87. package/build/services/worker/index.js +2 -6
  88. package/build/types/activity.d.ts +0 -81
  89. package/build/types/durable.d.ts +25 -177
  90. package/build/types/exporter.d.ts +0 -13
  91. package/build/types/hotmesh.d.ts +4 -16
  92. package/build/types/hotmesh.js +0 -3
  93. package/build/types/index.d.ts +4 -6
  94. package/build/types/index.js +4 -3
  95. package/build/types/job.d.ts +1 -86
  96. package/build/types/pipe.d.ts +0 -65
  97. package/build/types/quorum.d.ts +15 -10
  98. package/build/types/redis.d.ts +225 -7
  99. package/build/types/redis.js +9 -0
  100. package/build/types/stream.d.ts +0 -58
  101. package/build/types/stream.js +0 -4
  102. package/package.json +11 -4
  103. package/types/durable.ts +121 -3
  104. package/types/hotmesh.ts +3 -6
  105. package/types/index.ts +23 -10
  106. package/types/job.ts +1 -1
  107. package/types/quorum.ts +22 -0
  108. package/types/redis.ts +267 -18
  109. package/build/types/ioredisclient.d.ts +0 -5
  110. package/build/types/ioredisclient.js +0 -5
  111. package/build/types/redisclient.d.ts +0 -26
  112. package/build/types/redisclient.js +0 -2
  113. package/modules/enums.ts +0 -62
  114. package/modules/errors.ts +0 -280
  115. package/modules/key.ts +0 -101
  116. package/modules/storage.ts +0 -3
  117. package/modules/utils.ts +0 -242
  118. package/services/activities/activity.ts +0 -589
  119. package/services/activities/await.ts +0 -113
  120. package/services/activities/cycle.ts +0 -115
  121. package/services/activities/hook.ts +0 -197
  122. package/services/activities/index.ts +0 -19
  123. package/services/activities/interrupt.ts +0 -172
  124. package/services/activities/signal.ts +0 -148
  125. package/services/activities/trigger.ts +0 -295
  126. package/services/activities/worker.ts +0 -107
  127. package/services/collator/README.md +0 -102
  128. package/services/collator/index.ts +0 -291
  129. package/services/compiler/deployer.ts +0 -504
  130. package/services/compiler/index.ts +0 -98
  131. package/services/compiler/validator.ts +0 -158
  132. package/services/connector/clients/ioredis.ts +0 -57
  133. package/services/connector/clients/redis.ts +0 -72
  134. package/services/connector/index.ts +0 -42
  135. package/services/durable/client.ts +0 -266
  136. package/services/durable/connection.ts +0 -10
  137. package/services/durable/exporter.ts +0 -232
  138. package/services/durable/handle.ts +0 -160
  139. package/services/durable/index.ts +0 -27
  140. package/services/durable/schemas/factory.ts +0 -2358
  141. package/services/durable/search.ts +0 -196
  142. package/services/durable/worker.ts +0 -401
  143. package/services/durable/workflow.ts +0 -557
  144. package/services/engine/index.ts +0 -761
  145. package/services/exporter/index.ts +0 -146
  146. package/services/hotmesh/index.ts +0 -237
  147. package/services/logger/index.ts +0 -79
  148. package/services/mapper/index.ts +0 -89
  149. package/services/pipe/functions/array.ts +0 -78
  150. package/services/pipe/functions/bitwise.ts +0 -27
  151. package/services/pipe/functions/conditional.ts +0 -35
  152. package/services/pipe/functions/date.ts +0 -220
  153. package/services/pipe/functions/index.ts +0 -27
  154. package/services/pipe/functions/json.ts +0 -11
  155. package/services/pipe/functions/logical.ts +0 -11
  156. package/services/pipe/functions/math.ts +0 -217
  157. package/services/pipe/functions/number.ts +0 -75
  158. package/services/pipe/functions/object.ts +0 -98
  159. package/services/pipe/functions/string.ts +0 -86
  160. package/services/pipe/functions/symbol.ts +0 -39
  161. package/services/pipe/functions/unary.ts +0 -19
  162. package/services/pipe/index.ts +0 -216
  163. package/services/quorum/index.ts +0 -319
  164. package/services/reporter/index.ts +0 -387
  165. package/services/router/index.ts +0 -426
  166. package/services/serializer/README.md +0 -10
  167. package/services/serializer/index.ts +0 -285
  168. package/services/store/cache.ts +0 -172
  169. package/services/store/clients/ioredis.ts +0 -145
  170. package/services/store/clients/redis.ts +0 -191
  171. package/services/store/index.ts +0 -1091
  172. package/services/stream/clients/ioredis.ts +0 -157
  173. package/services/stream/clients/redis.ts +0 -158
  174. package/services/stream/index.ts +0 -58
  175. package/services/sub/clients/ioredis.ts +0 -83
  176. package/services/sub/clients/redis.ts +0 -74
  177. package/services/sub/index.ts +0 -25
  178. package/services/task/index.ts +0 -250
  179. package/services/telemetry/index.ts +0 -273
  180. package/services/worker/index.ts +0 -248
  181. package/types/ioredisclient.ts +0 -10
  182. package/types/redisclient.ts +0 -30
@@ -1,2358 +0,0 @@
1
- /**
2
- *********** HOTMESH 'DURABLE' MODULE APPLICATION GRAPH **********
3
- *
4
- * This HotMesh application spec uses 50 activities and 25 transitions
5
- * to model and emulate the Temporal Application & Query servers using
6
- * Redis as the backend.
7
- *
8
- * It's particularly useful for organizations with high-speed, high-volume
9
- * use cases as it uses in-memory Redis Streams for transactional,
10
- * workflow processing, while adhering to Temporal's developer-friendly syntax.
11
- *
12
- * This YAML file can also serve as a useful starting point for building
13
- * Integration/BPM/Workflow servers in general (MuleSoft, etc) without the need
14
- * for a physical application server.
15
- *
16
- * Possible use cases include:
17
- * * Orchestration servers
18
- * * Integration servers
19
- * * BPMN engines
20
- * * Reentrant process servers
21
- * * Service Meshes
22
- * * Master Data Management systems
23
- */
24
-
25
- const APP_VERSION = '1';
26
- const APP_ID = 'durable';
27
-
28
- /**
29
- * returns a new durable workflow schema
30
- * @param {string} app - app name (e.g., 'durable')
31
- * @param {string} version - number as string (e.g., '1')
32
- * @returns {string} HotMesh App YAML
33
- */
34
- const getWorkflowYAML = (app: string, version: string) => {
35
- return `app:
36
- id: ${app}
37
- version: '${version}'
38
- graphs:
39
-
40
- ###################################################
41
- # THE DURABLE-REENTRANT-WORKFLOW #
42
- # #
43
- - subscribes: ${app}.execute
44
- publishes: ${app}.executed
45
-
46
- expire:
47
- '@pipe':
48
- - ['{trigger.output.data.originJobId}', 0, '{trigger.output.data.expire}']
49
- - ['{@conditional.ternary}']
50
-
51
- input:
52
- schema:
53
- type: object
54
- properties:
55
- originJobId:
56
- description: the entry point from the outside world; subflows will inherit this value
57
- type: string
58
- workflowId:
59
- description: the id for this workflow (see \`trigger.stats.id\`)
60
- type: string
61
- parentWorkflowId:
62
- type: string
63
- arguments:
64
- description: the arguments to pass to the flow
65
- type: array
66
- workflowTopic:
67
- description: the Redis stream topic the worker is listening on
68
- type: string
69
- backoffCoefficient:
70
- description: the time multiple in seconds to backoff before retrying
71
- type: number
72
- maximumAttempts:
73
- description: the maximum number of retries to attempt before failing the workflow
74
- type: number
75
- maximumInterval:
76
- description: the maximum time in seconds to wait between retries; provides a fixed limit to exponential backoff growth
77
- type: number
78
- expire:
79
- description: the time in seconds to expire the workflow in Redis once it completes
80
- type: number
81
-
82
- output:
83
- schema:
84
- type: object
85
- properties:
86
- response:
87
- description: the final response from the workflow if any
88
- type: any
89
- done:
90
- description: true if the workflow is complete (whether successful or not)
91
- type: boolean
92
- $error:
93
- description: only present if a structured error ocurred (598, 597, etc)
94
- type: object
95
- properties:
96
- code:
97
- type: number
98
- message:
99
- type: string
100
- stack:
101
- type: string
102
- workflowId:
103
- type: string
104
- jc:
105
- type: string
106
- ju:
107
- type: string
108
-
109
- activities:
110
-
111
- ######## MAIN ACTIVITIES (RESPONSIBLE FOR FLOW ENTRY/STARTUP) ########
112
- trigger:
113
- title: Main Flow Trigger
114
- type: trigger
115
- job:
116
- maps:
117
- done: false
118
- stats:
119
- id: '{$self.input.data.workflowId}'
120
- key: '{$self.input.data.parentWorkflowId}'
121
- parent: '{$self.input.data.originJobId}'
122
- adjacent: '{$self.input.data.parentWorkflowId}'
123
-
124
- cycle_hook:
125
- title: Main Cycle Pivot - Cycling Descendants send execution back to this point
126
- type: hook
127
- cycle: true
128
- output:
129
- schema:
130
- type: object
131
- properties:
132
- retryCount:
133
- type: number
134
- maps:
135
- retryCount: 0
136
- throttleSeconds: 0
137
-
138
- throttler:
139
- title: Pauses for an exponentially-throttled amount of time after a retryable error or passes through immediately
140
- type: hook
141
- sleep: '{cycle_hook.output.data.throttleSeconds}'
142
-
143
- worker:
144
- title: Main Worker - Calls linked Workflow functions
145
- type: worker
146
- topic: '{trigger.output.data.workflowTopic}'
147
- emit: '{$job.data.done}'
148
- input:
149
- schema:
150
- type: object
151
- properties:
152
- originJobId:
153
- type: string
154
- workflowId:
155
- type: string
156
- arguments:
157
- type: array
158
- workflowTopic:
159
- type: string
160
- canRetry:
161
- type: boolean
162
- maps:
163
- originJobId: '{trigger.output.data.originJobId}'
164
- workflowId: '{trigger.output.data.workflowId}'
165
- arguments: '{trigger.output.data.arguments}'
166
- workflowTopic: '{trigger.output.data.workflowTopic}'
167
- canRetry:
168
- '@pipe':
169
- - '@pipe':
170
- - ['{cycle_hook.output.data.retryCount}']
171
- - '@pipe':
172
- - ['{trigger.output.data.maximumAttempts}', 5]
173
- - ['{@conditional.nullish}']
174
- - ['{@conditional.less_than}']
175
- output:
176
- schema:
177
- type: object
178
- properties:
179
- response:
180
- type: any
181
- 589:
182
- schema:
183
- type: object
184
- properties:
185
- workflowId:
186
- type: string
187
- parentWorkflowId:
188
- type: string
189
- originJobId:
190
- type: string
191
- index:
192
- type: number
193
- workflowDimension:
194
- type: string
195
- description: empty string or dimensionsal path (,0,0,1)
196
- items:
197
- type: array
198
- description: the items to pass
199
- items:
200
- type: object
201
- size:
202
- type: number
203
- description: the number of items to pass
204
- 590:
205
- schema:
206
- type: object
207
- properties:
208
- workflowId:
209
- type: string
210
- parentWorkflowId:
211
- type: string
212
- originJobId:
213
- type: string
214
- workflowName:
215
- type: string
216
- index:
217
- type: number
218
- workflowDimension:
219
- type: string
220
- description: empty string or dimensionsal path (,0,0,1)
221
- arguments:
222
- type: array
223
- description: the arguments to pass to the flow (recursive)
224
- items:
225
- type: any
226
- backoffCoefficient:
227
- type: number
228
- maximumAttempts:
229
- type: number
230
- maximumInterval:
231
- type: number
232
- await:
233
- type: string
234
- description: when set to false, do not await the child flow's completion
235
- 591:
236
- schema:
237
- type: object
238
- properties:
239
- activityName:
240
- type: string
241
- index:
242
- type: number
243
- workflowDimension:
244
- type: string
245
- description: empty string or dimensionsal path (,0,0,1)
246
- arguments:
247
- type: array
248
- description: the arguments to pass to the activity
249
- items:
250
- type: any
251
- workflowId:
252
- type: string
253
- workflowTopic:
254
- type: string
255
- parentWorkflowId:
256
- type: string
257
- originJobId:
258
- type: string
259
- backoffCoefficient:
260
- type: number
261
- maximumAttempts:
262
- type: number
263
- maximumInterval:
264
- type: number
265
- 588:
266
- schema:
267
- type: object
268
- properties:
269
- duration:
270
- type: number
271
- description: sleepFor duration in seconds
272
- index:
273
- type: number
274
- description: the replay index (COUNTER++)
275
- 595:
276
- schema:
277
- type: object
278
- properties:
279
- index:
280
- type: number
281
- description: the index of the first signal in the array
282
- signal:
283
- type: object
284
- properties:
285
- signal:
286
- type: string
287
- job:
288
- maps:
289
- response: '{$self.output.data.response}'
290
-
291
- sleeper:
292
- title: Pauses the main thread for a set amount of time; all other subprocess threads remain active, and new ones may be started
293
- type: hook
294
- sleep: '{worker.output.data.duration}'
295
- job:
296
- maps:
297
- idempotentcy-marker[-]:
298
- '@pipe':
299
- - '@pipe':
300
- - ['-sleep', '{worker.output.data.workflowDimension}', '-', '{worker.output.data.index}', '-']
301
- - ['{@string.concat}']
302
- - '@pipe':
303
- - [duration, '{worker.output.data.duration}', ac, '{$self.output.metadata.ac}', au, '{$self.output.metadata.au}']
304
- - ['{@object.create}']
305
- - ['{@object.create}']
306
-
307
- sleep_cycler:
308
- title: Cycles back to the cycle_hook pivot
309
- type: cycle
310
- ancestor: cycle_hook
311
- input:
312
- maps:
313
- retryCount: 0
314
- throttleSeconds: 0
315
-
316
- childer:
317
- title: Awaits a child flow to be executed/started
318
- type: await
319
- topic: ${app}.execute
320
- await: '{worker.output.data.await}'
321
- input:
322
- schema:
323
- type: object
324
- properties:
325
- workflowTopic:
326
- type: string
327
- backoffCoefficient:
328
- type: number
329
- maximumAttempts:
330
- type: number
331
- maximumInterval:
332
- type: number
333
- expire:
334
- type: number
335
- parentWorkflowId:
336
- type: string
337
- description: used to forge the cleanup key
338
- originJobId:
339
- type: string
340
- description: used for dependency cleanup
341
- workflowId:
342
- type: string
343
- description: the baseId + index
344
- arguments:
345
- type: array
346
- description: the arguments to pass to the activity
347
- items:
348
- type: string
349
- maps:
350
- arguments: '{worker.output.data.arguments}'
351
- workflowDimension: '{worker.output.data.workflowDimension}'
352
- index: '{worker.output.data.index}'
353
- originJobId: '{worker.output.data.originJobId}'
354
- parentWorkflowId: '{worker.output.data.parentWorkflowId}'
355
- workflowId: '{worker.output.data.workflowId}'
356
- workflowName: '{worker.output.data.workflowName}'
357
- workflowTopic: '{worker.output.data.workflowTopic}'
358
- backoffCoefficient:
359
- '@pipe':
360
- - ['{worker.output.data.backoffCoefficient}','{trigger.output.data.backoffCoefficient}']
361
- - ['{@conditional.nullish}', 10]
362
- - ['{@conditional.nullish}']
363
- maximumAttempts:
364
- '@pipe':
365
- - ['{worker.output.data.maximumAttempts}','{trigger.output.data.maximumAttempts}']
366
- - ['{@conditional.nullish}', 5]
367
- - ['{@conditional.nullish}']
368
- maximumInterval:
369
- '@pipe':
370
- - ['{worker.output.data.maximumInterval}','{trigger.output.data.maximumInterval}']
371
- - ['{@conditional.nullish}', 120]
372
- - ['{@conditional.nullish}']
373
- job:
374
- maps:
375
- idempotentcy-marker[-]:
376
- '@pipe':
377
- - '@pipe':
378
- - ['{worker.output.data.await}', true]
379
- - ['{@conditional.nullish}', '-child', '-start']
380
- - ['{@conditional.ternary}', '{worker.output.data.workflowDimension}', '-', '{worker.output.data.index}', '-']
381
- - ['{@string.concat}']
382
- - '@pipe':
383
- - '@pipe':
384
- - ['{$self.output.data.$error}', '{$self.output.metadata.$error}']
385
- - ['{@logical.or}']
386
- - '@pipe':
387
- - '@pipe':
388
- - [$error]
389
- - '@pipe':
390
- - ['{$self.output.data.$error}', '{$self.output.metadata.$error}']
391
- - ['{@logical.or}']
392
- - '@pipe':
393
- - [ac]
394
- - '@pipe':
395
- - ['{$self.output.data.jc}', '{$self.output.metadata.ac}']
396
- - ['{@logical.or}']
397
- - '@pipe':
398
- - [au]
399
- - '@pipe':
400
- - ['{$self.output.data.ju}', '{$self.output.metadata.au}']
401
- - ['{@logical.or}']
402
- - '@pipe':
403
- - [job_id]
404
- - '@pipe':
405
- - ['{$self.output.data.workflowId}']
406
- - ['{@object.create}']
407
- - '@pipe':
408
- - '@pipe':
409
- - ['{$self.output.data.done}']
410
- - '@pipe':
411
- - '@pipe':
412
- - [data]
413
- - '@pipe':
414
- - ['{$self.output.data.response}']
415
- - '@pipe':
416
- - [ac]
417
- - '@pipe':
418
- - ['{$self.output.data.jc}']
419
- - '@pipe':
420
- - [au]
421
- - '@pipe':
422
- - ['{$self.output.data.ju}']
423
- - '@pipe':
424
- - [job_id]
425
- - '@pipe':
426
- - ['{$self.output.data.workflowId}']
427
- - ['{@object.create}']
428
- - '@pipe':
429
- - '@pipe':
430
- - [data]
431
- - '@pipe':
432
- - ['{$self.output.data.job_id}']
433
- - '@pipe':
434
- - [ac]
435
- - '@pipe':
436
- - ['{$self.output.data.jc}']
437
- - '@pipe':
438
- - [au]
439
- - '@pipe':
440
- - ['{$self.output.data.ju}']
441
- - '@pipe':
442
- - [job_id]
443
- - '@pipe':
444
- - ['{$self.output.data.job_id}']
445
- - ['{@object.create}']
446
- - ['{@conditional.ternary}']
447
- - ['{@conditional.ternary}']
448
- - ['{@object.create}']
449
-
450
- child_cycler:
451
- title: Cycles back to the cycle_hook
452
- type: cycle
453
- ancestor: cycle_hook
454
- input:
455
- maps:
456
- retryCount:
457
- '@pipe':
458
- - '@pipe':
459
- - ['{childer.output.metadata.err}']
460
- - '@pipe':
461
- - ['{cycle_hook.output.data.retryCount}', 0]
462
- - ['{@logical.or}', 1]
463
- - ['{@math.add}']
464
- - '@pipe':
465
- - [0]
466
- - ['{@conditional.ternary}']
467
- throttleSeconds:
468
- '@pipe':
469
- - '@pipe':
470
- - ['{childer.output.metadata.err}']
471
- - '@pipe':
472
- - '@pipe':
473
- - '@pipe':
474
- - ['{trigger.output.data.backoffCoefficient}', 10]
475
- - ['{@conditional.nullish}']
476
- - '@pipe':
477
- - ['{cycle_hook.output.data.retryCount}', 0]
478
- - ['{@conditional.nullish}']
479
- - ['{@math.pow}']
480
- - '@pipe':
481
- - ['{trigger.output.data.maximumInterval}', 120]
482
- - ['{@logical.or}']
483
- - ['{@math.min}']
484
- - '@pipe':
485
- - [0]
486
- - ['{@conditional.ternary}']
487
-
488
- proxyer:
489
- title: Invokes the activity flow and awaits the response
490
- type: await
491
- topic: ${app}.activity.execute
492
- input:
493
- schema:
494
- type: object
495
- properties:
496
- activityName:
497
- type: string
498
- parentWorkflowId:
499
- type: string
500
- description: used to forge the cleanup key
501
- originJobId:
502
- type: string
503
- description: used for dependency cleanup
504
- workflowId:
505
- type: string
506
- description: the baseId + index
507
- arguments:
508
- type: array
509
- description: the arguments to pass to the activity
510
- items:
511
- type: string
512
- backoffCoefficient:
513
- type: number
514
- maximumAttempts:
515
- type: number
516
- maximumInterval:
517
- type: number
518
- maps:
519
- activityName: '{worker.output.data.activityName}'
520
- arguments: '{worker.output.data.arguments}'
521
- workflowDimension: '{worker.output.data.workflowDimension}'
522
- index: '{worker.output.data.index}'
523
- originJobId: '{worker.output.data.originJobId}'
524
- parentWorkflowId: '{worker.output.data.workflowId}'
525
- workflowId: '{worker.output.data.workflowId}'
526
- workflowTopic: '{worker.output.data.workflowTopic}'
527
- backoffCoefficient:
528
- '@pipe':
529
- - ['{worker.output.data.backoffCoefficient}','{trigger.output.data.backoffCoefficient}']
530
- - ['{@conditional.nullish}', 10]
531
- - ['{@conditional.nullish}']
532
- maximumAttempts:
533
- '@pipe':
534
- - ['{worker.output.data.maximumAttempts}','{trigger.output.data.maximumAttempts}']
535
- - ['{@conditional.nullish}', 5]
536
- - ['{@conditional.nullish}']
537
- maximumInterval:
538
- '@pipe':
539
- - ['{worker.output.data.maximumInterval}','{trigger.output.data.maximumInterval}']
540
- - ['{@conditional.nullish}', 120]
541
- - ['{@conditional.nullish}']
542
- job:
543
- maps:
544
- idempotentcy-marker[-]:
545
- '@pipe':
546
- - '@pipe':
547
- - ['-proxy', '{worker.output.data.workflowDimension}', '-', '{worker.output.data.index}', '-']
548
- - ['{@string.concat}']
549
- - '@pipe':
550
- - '@pipe':
551
- - ['{$self.output.data.$error}']
552
- - '@pipe':
553
- - '@pipe':
554
- - [$error]
555
- - '@pipe':
556
- - ['{$self.output.data.$error}']
557
- - '@pipe':
558
- - [ac]
559
- - '@pipe':
560
- - ['{$self.output.data.jc}']
561
- - '@pipe':
562
- - [au]
563
- - '@pipe':
564
- - ['{$self.output.data.ju}']
565
- - '@pipe':
566
- - ['job_id']
567
- - '@pipe':
568
- - ['{$self.output.data.workflowId}']
569
- - ['{@object.create}']
570
- - '@pipe':
571
- - '@pipe':
572
- - [data]
573
- - '@pipe':
574
- - ['{$self.output.data.response}']
575
- - '@pipe':
576
- - [ac]
577
- - '@pipe':
578
- - ['{$self.output.data.jc}']
579
- - '@pipe':
580
- - [au]
581
- - '@pipe':
582
- - ['{$self.output.data.ju}']
583
- - '@pipe':
584
- - ['job_id']
585
- - '@pipe':
586
- - ['{$self.output.data.workflowId}']
587
- - ['{@object.create}']
588
- - ['{@conditional.ternary}']
589
- - ['{@object.create}']
590
-
591
- proxy_cycler:
592
- title: Cycles back to the cycle_hook
593
- type: cycle
594
- ancestor: cycle_hook
595
- input:
596
- maps:
597
- retryCount:
598
- '@pipe':
599
- - '@pipe':
600
- - ['{proxyer.output.metadata.err}']
601
- - '@pipe':
602
- - ['{cycle_hook.output.data.retryCount}', 0]
603
- - ['{@logical.or}', 1]
604
- - ['{@math.add}']
605
- - '@pipe':
606
- - [0]
607
- - ['{@conditional.ternary}']
608
- throttleSeconds:
609
- '@pipe':
610
- - '@pipe':
611
- - ['{proxyer.output.metadata.err}']
612
- - '@pipe':
613
- - '@pipe':
614
- - '@pipe':
615
- - ['{trigger.output.data.backoffCoefficient}', 10]
616
- - ['{@conditional.nullish}']
617
- - '@pipe':
618
- - ['{cycle_hook.output.data.retryCount}', 0]
619
- - ['{@conditional.nullish}']
620
- - ['{@math.pow}']
621
- - '@pipe':
622
- - ['{trigger.output.data.maximumInterval}', 120]
623
- - ['{@logical.or}']
624
- - ['{@math.min}']
625
- - '@pipe':
626
- - [0]
627
- - ['{@conditional.ternary}']
628
-
629
- collator:
630
- title: Awaits the collator flow to simultaneously resolve the idempotent items and return as a sequential set
631
- type: await
632
- topic: ${app}.collator.execute
633
- input:
634
- schema:
635
- type: object
636
- properties:
637
- parentWorkflowId:
638
- type: string
639
- description: used to forge the cleanup key
640
- originJobId:
641
- type: string
642
- description: used for dependency cleanup
643
- workflowId:
644
- type: string
645
- size:
646
- type: number
647
- description: the number of idempotent items to resolve
648
- items:
649
- type: array
650
- description: the idempotent items to resolve
651
- items:
652
- type: object
653
- properties:
654
- index:
655
- type: number
656
- data:
657
- type: object
658
- maps:
659
- items: '{worker.output.data.items}'
660
- size: '{worker.output.data.size}'
661
- workflowDimension: '{worker.output.data.workflowDimension}'
662
- index: '{worker.output.data.index}'
663
- originJobId: '{worker.output.data.originJobId}'
664
- parentWorkflowId: '{worker.output.data.workflowId}'
665
- workflowId: '{worker.output.data.workflowId}'
666
- workflowTopic: '{worker.output.data.workflowTopic}'
667
- output:
668
- schema:
669
- type: object
670
- properties:
671
- size:
672
- type: number
673
- data:
674
- type: object
675
- properties:
676
- response:
677
- description: the collated response, returned as a object with numeric keys, representing the order in the Promise.all array
678
- type: object
679
- patternProperties:
680
- '^[0-9]+$':
681
- type: object
682
- properties:
683
- type:
684
- type: string
685
- enum: [wait, proxy, child, start, sleep]
686
- data:
687
- type: unknown
688
- job:
689
- maps:
690
- idempotentcy-marker[-]:
691
- '@pipe':
692
- - ['{$self.output.data.response}', {}]
693
- - '@reduce':
694
- - '@pipe':
695
- - - '{$output}'
696
- - '@pipe':
697
- - '@pipe':
698
- - - '-'
699
- - '@pipe':
700
- - - '{$item}'
701
- - type
702
- - - '{@object.get}'
703
- - '@pipe':
704
- - - '{worker.output.data.workflowDimension}'
705
- - '@pipe':
706
- - - '-'
707
- - '@pipe':
708
- - '@pipe':
709
- - - '{worker.output.data.index}'
710
- - '@pipe':
711
- - - '{$index}'
712
- - - '{@math.add}'
713
- - '@pipe':
714
- - - '-'
715
- - - '{@string.concat}'
716
- - '@pipe':
717
- - - '{$item}'
718
- - - '{@object.set}'
719
-
720
- collate_cycler:
721
- title: Cycles back to the cycle_hook after collating the results
722
- type: cycle
723
- ancestor: cycle_hook
724
- input:
725
- maps:
726
- retryCount: 0
727
- throttleSeconds: 0
728
-
729
- retryer:
730
- title: Cycles back to the cycle_hook pivot, increasing the retryCount (the exponential)
731
- type: cycle
732
- ancestor: cycle_hook
733
- input:
734
- maps:
735
- retryCount:
736
- '@pipe':
737
- - ['{cycle_hook.output.data.retryCount}', 0]
738
- - ['{@logical.or}', 1]
739
- - ['{@math.add}']
740
- throttleSeconds:
741
- '@pipe':
742
- - '@pipe':
743
- - '@pipe':
744
- - ['{trigger.output.data.backoffCoefficient}', 10]
745
- - ['{@conditional.nullish}']
746
- - '@pipe':
747
- - ['{cycle_hook.output.data.retryCount}', 0]
748
- - ['{@conditional.nullish}']
749
- - ['{@math.pow}']
750
- - '@pipe':
751
- - ['{trigger.output.data.maximumInterval}', 120]
752
- - ['{@logical.or}']
753
- - ['{@math.min}']
754
-
755
- closer:
756
- title: Closes the \`Signal In\` Hook Channel, so the workflow can exit
757
- type: signal
758
- subtype: one
759
- topic: ${app}.flow.signal
760
- signal:
761
- schema:
762
- type: object
763
- properties:
764
- id:
765
- type: string
766
- maps:
767
- id: '{$job.metadata.jid}'
768
- job:
769
- maps:
770
- done: true
771
- $error: '{worker.output.data.$error}'
772
- jc: '{$job.metadata.jc}'
773
- ju:
774
- '@pipe':
775
- - ['{@date.toISOXString}']
776
-
777
- stopper:
778
- title: Stops 'Signal In' when retryCount is exceeded (and as a result ends the job)
779
- type: signal
780
- subtype: one
781
- topic: ${app}.flow.signal
782
- signal:
783
- schema:
784
- type: object
785
- properties:
786
- id:
787
- type: string
788
- maps:
789
- id: '{$job.metadata.jid}'
790
- job:
791
- maps:
792
- done: true
793
- $error:
794
- '@pipe':
795
- - ['{worker.output.data.$error}', 'code', 597]
796
- - ['{@object.set}']
797
- jc: '{$job.metadata.jc}'
798
- ju:
799
- '@pipe':
800
- - ['{@date.toISOXString}']
801
-
802
- ######## SIGNAL-IN ACTIVITIES (RESPONSIBLE FOR FLOW REENTRY) ########
803
- signaler:
804
- title: Signal-In Reentry point for subordinated hook flows
805
- type: hook
806
- hook:
807
- type: object
808
- properties:
809
- id:
810
- type: string
811
- arguments:
812
- type: array
813
- workflowTopic:
814
- type: string
815
- job:
816
- maps:
817
- workflowId: '{trigger.output.data.workflowId}'
818
-
819
- signaler_cycle_hook:
820
- title: Signal In Cycle Pivot - Cycling Descendants Send Execution Back Here
821
- type: hook
822
- cycle: true
823
- output:
824
- schema:
825
- type: object
826
- properties:
827
- retryCount:
828
- type: number
829
- maps:
830
- retryCount: 0
831
- throttleSeconds: 0
832
-
833
- signaler_throttler:
834
- title: Pauses between failed hook executions for an exponentially-throttled amount of time after a retryable error
835
- type: hook
836
- sleep: '{signaler_cycle_hook.output.data.throttleSeconds}'
837
-
838
- signaler_worker:
839
- title: Signal In - Worker
840
- type: worker
841
- topic: '{signaler.hook.data.workflowTopic}'
842
- input:
843
- schema:
844
- type: object
845
- properties:
846
- workflowId:
847
- type: string
848
- originJobId:
849
- type: string
850
- workflowDimension:
851
- type: string
852
- arguments:
853
- type: array
854
- canRetry:
855
- type: boolean
856
- maps:
857
- workflowId: '{trigger.output.data.workflowId}'
858
- originJobId: '{trigger.output.data.originJobId}'
859
- workflowDimension: '{signaler.output.metadata.dad}'
860
- arguments: '{signaler.hook.data.arguments}'
861
- canRetry:
862
- '@pipe':
863
- - '@pipe':
864
- - ['{signaler_cycle_hook.output.data.retryCount}']
865
- - '@pipe':
866
- - ['{trigger.output.data.maximumAttempts}', 5]
867
- - ['{@conditional.nullish}']
868
- - ['{@conditional.less_than}']
869
-
870
- output:
871
- schema:
872
- type: object
873
- 589:
874
- schema:
875
- description: the worker function output when Promise.all is used
876
- type: object
877
- properties:
878
- workflowId:
879
- type: string
880
- description: the id for the new child workflow to spawn
881
- parentWorkflowId:
882
- type: string
883
- description: parent workflow id (this workflow's id)
884
- originJobId:
885
- type: string
886
- description: entry flow id (where outside world met the mesh)
887
- index:
888
- type: number
889
- description: the replay index (COUNTER++)
890
- workflowDimension:
891
- type: string
892
- description: empty string or dimensionsal path (,0,0,1)
893
- items:
894
- type: array
895
- description: the items to collate
896
- items:
897
- type: object
898
- size:
899
- type: number
900
- description: the number of items to collate
901
- 590:
902
- schema:
903
- description: the worker function output when execChild or startChild are called
904
- type: object
905
- properties:
906
- workflowId:
907
- type: string
908
- description: the id for the new child workflow to spawn
909
- parentWorkflowId:
910
- type: string
911
- description: parent workflow id (this workflow's id)
912
- originJobId:
913
- type: string
914
- description: entry flow id (where outside world met the mesh)
915
- workflowName:
916
- type: string
917
- description: the linked function name
918
- index:
919
- type: number
920
- description: the replay index (COUNTER++)
921
- workflowDimension:
922
- type: string
923
- description: empty string or dimensionsal path (,0,0,1)
924
- arguments:
925
- type: array
926
- description: the arguments to pass to the flow (recursive)
927
- items:
928
- type: any
929
- backoffCoefficient:
930
- type: number
931
- description: the time multiple in seconds to backoff before retrying
932
- maximumAttempts:
933
- type: number
934
- description: the maximum number of retries to attempt before failing the workflow
935
- maximumInterval:
936
- type: number
937
- description: the maximum time in seconds to wait between retries; provides a fixed limit to exponential backoff growth
938
- await:
939
- type: string
940
- description: when set to false, do not await the child flow's completion
941
- 591:
942
- schema:
943
- type: object
944
- properties:
945
- activityName:
946
- type: string
947
- index:
948
- type: number
949
- workflowDimension:
950
- type: string
951
- description: empty string or dimensionsal path (,0,0,1)
952
- arguments:
953
- type: array
954
- description: the arguments to pass to the activity
955
- items:
956
- type: any
957
- workflowId:
958
- type: string
959
- workflowTopic:
960
- type: string
961
- parentWorkflowId:
962
- type: string
963
- originJobId:
964
- type: string
965
- backoffCoefficient:
966
- type: number
967
- maximumAttempts:
968
- type: number
969
- maximumInterval:
970
- type: number
971
- 588:
972
- schema:
973
- type: object
974
- properties:
975
- duration:
976
- type: number
977
- description: sleepFor duration in seconds
978
- index:
979
- type: number
980
- description: the replay index (COUNTER++)
981
- 595:
982
- schema:
983
- type: object
984
- properties:
985
- index:
986
- type: number
987
- description: the index of the first signal in the array
988
- signal:
989
- type: object
990
- properties:
991
- signal:
992
- type: string
993
-
994
- signaler_sleeper:
995
- title: Pauses a single thread within the worker for a set amount of seconds while the main flow thread and all other subthreads remain active
996
- type: hook
997
- sleep: '{signaler_worker.output.data.duration}'
998
- job:
999
- maps:
1000
- idempotentcy-marker[-]:
1001
- '@pipe':
1002
- - '@pipe':
1003
- - ['-sleep', '{signaler_worker.output.data.workflowDimension}', '-', '{signaler_worker.output.data.index}', '-']
1004
- - ['{@string.concat}']
1005
- - '@pipe':
1006
- - [duration, '{signaler_worker.output.data.duration}', ac, '{$self.output.metadata.ac}', au, '{$self.output.metadata.au}']
1007
- - ['{@object.create}']
1008
- - ['{@object.create}']
1009
-
1010
- signaler_sleep_cycler:
1011
- title: Cycles back to the signaler_cycle_hook pivot
1012
- type: cycle
1013
- ancestor: signaler_cycle_hook
1014
- input:
1015
- maps:
1016
- retryCount: 0
1017
- throttleSeconds: 0
1018
-
1019
- signaler_childer:
1020
- title: Awaits a child flow to be executed/started
1021
- type: await
1022
- topic: ${app}.execute
1023
- await: '{signaler_worker.output.data.await}'
1024
- input:
1025
- schema:
1026
- type: object
1027
- properties:
1028
- workflowTopic:
1029
- type: string
1030
- backoffCoefficient:
1031
- type: number
1032
- maximumAttempts:
1033
- type: number
1034
- maximumInterval:
1035
- type: number
1036
- expire:
1037
- type: number
1038
- parentWorkflowId:
1039
- type: string
1040
- description: used to forge the cleanup key
1041
- originJobId:
1042
- type: string
1043
- description: used for dependency cleanup
1044
- workflowId:
1045
- type: string
1046
- description: the baseId + index
1047
- arguments:
1048
- type: array
1049
- description: the arguments to pass to the activity
1050
- items:
1051
- type: string
1052
- maps:
1053
- arguments: '{signaler_worker.output.data.arguments}'
1054
- workflowDimension: '{signaler_worker.output.data.workflowDimension}'
1055
- index: '{signaler_worker.output.data.index}'
1056
- originJobId: '{signaler_worker.output.data.originJobId}'
1057
- parentWorkflowId: '{signaler_worker.output.data.parentWorkflowId}'
1058
- workflowId: '{signaler_worker.output.data.workflowId}'
1059
- workflowName: '{signaler_worker.output.data.workflowName}'
1060
- workflowTopic: '{signaler_worker.output.data.workflowTopic}'
1061
- backoffCoefficient:
1062
- '@pipe':
1063
- - ['{signaler_worker.output.data.backoffCoefficient}','{trigger.output.data.backoffCoefficient}']
1064
- - ['{@conditional.nullish}', 10]
1065
- - ['{@conditional.nullish}']
1066
- maximumAttempts:
1067
- '@pipe':
1068
- - ['{signaler_worker.output.data.maximumAttempts}','{trigger.output.data.maximumAttempts}']
1069
- - ['{@conditional.nullish}', 5]
1070
- - ['{@conditional.nullish}']
1071
- maximumInterval:
1072
- '@pipe':
1073
- - ['{signaler_worker.output.data.maximumInterval}','{trigger.output.data.maximumInterval}']
1074
- - ['{@conditional.nullish}', 120]
1075
- - ['{@conditional.nullish}']
1076
- job:
1077
- maps:
1078
- idempotentcy-marker[-]:
1079
- '@pipe':
1080
- - '@pipe':
1081
- - ['{signaler_worker.output.data.await}', true]
1082
- - ['{@conditional.nullish}', '-child', '-start']
1083
- - ['{@conditional.ternary}', '{signaler_worker.output.data.workflowDimension}', '-', '{signaler_worker.output.data.index}', '-']
1084
- - ['{@string.concat}']
1085
- - '@pipe':
1086
- - '@pipe':
1087
- - ['{$self.output.data.$error}', '{$self.output.metadata.$error}']
1088
- - ['{@logical.or}']
1089
- - '@pipe':
1090
- - '@pipe':
1091
- - [$error]
1092
- - '@pipe':
1093
- - ['{$self.output.data.$error}', '{$self.output.metadata.$error}']
1094
- - ['{@logical.or}']
1095
- - '@pipe':
1096
- - [ac]
1097
- - '@pipe':
1098
- - ['{$self.output.data.jc}', '{$self.output.metadata.ac}']
1099
- - ['{@logical.or}']
1100
- - '@pipe':
1101
- - [au]
1102
- - '@pipe':
1103
- - ['{$self.output.data.ju}', '{$self.output.metadata.au}']
1104
- - ['{@logical.or}']
1105
- - '@pipe':
1106
- - ['job_id']
1107
- - '@pipe':
1108
- - ['{$self.output.data.workflowId}']
1109
- - ['{@object.create}']
1110
- - '@pipe':
1111
- - '@pipe':
1112
- - ['{$self.output.data.done}']
1113
- - '@pipe':
1114
- - '@pipe':
1115
- - [data]
1116
- - '@pipe':
1117
- - ['{$self.output.data.response}']
1118
- - '@pipe':
1119
- - [ac]
1120
- - '@pipe':
1121
- - ['{$self.output.data.jc}']
1122
- - '@pipe':
1123
- - [au]
1124
- - '@pipe':
1125
- - ['{$self.output.data.ju}']
1126
- - '@pipe':
1127
- - [job_id]
1128
- - '@pipe':
1129
- - ['{$self.output.data.workflowId}']
1130
- - ['{@object.create}']
1131
- - '@pipe':
1132
- - '@pipe':
1133
- - [data]
1134
- - '@pipe':
1135
- - ['{$self.output.data.job_id}']
1136
- - '@pipe':
1137
- - [ac]
1138
- - '@pipe':
1139
- - ['{$self.output.data.jc}']
1140
- - '@pipe':
1141
- - [au]
1142
- - '@pipe':
1143
- - ['{$self.output.data.ju}']
1144
- - '@pipe':
1145
- - ['job_id']
1146
- - '@pipe':
1147
- - ['{$self.output.data.job_id}']
1148
- - ['{@object.create}']
1149
- - ['{@conditional.ternary}']
1150
- - ['{@conditional.ternary}']
1151
- - ['{@object.create}']
1152
-
1153
- signaler_child_cycler:
1154
- title: Cycles back to the signaler_cycle_hook
1155
- type: cycle
1156
- ancestor: signaler_cycle_hook
1157
- input:
1158
- maps:
1159
- retryCount:
1160
- '@pipe':
1161
- - '@pipe':
1162
- - ['{signaler_childer.output.metadata.err}']
1163
- - '@pipe':
1164
- - ['{signaler_cycle_hook.output.data.retryCount}', 0]
1165
- - ['{@logical.or}', 1]
1166
- - ['{@math.add}']
1167
- - '@pipe':
1168
- - [0]
1169
- - ['{@conditional.ternary}']
1170
- throttleSeconds:
1171
- '@pipe':
1172
- - '@pipe':
1173
- - ['{signaler_childer.output.metadata.err}']
1174
- - '@pipe':
1175
- - '@pipe':
1176
- - '@pipe':
1177
- - ['{trigger.output.data.backoffCoefficient}', 10]
1178
- - ['{@conditional.nullish}']
1179
- - '@pipe':
1180
- - ['{signaler_cycle_hook.output.data.retryCount}', 0]
1181
- - ['{@conditional.nullish}']
1182
- - ['{@math.pow}']
1183
- - '@pipe':
1184
- - ['{trigger.output.data.maximumInterval}', 120]
1185
- - ['{@logical.or}']
1186
- - ['{@math.min}']
1187
- - '@pipe':
1188
- - [0]
1189
- - ['{@conditional.ternary}']
1190
-
1191
- signaler_proxyer:
1192
- title: Invokes the activity flow and awaits the response
1193
- type: await
1194
- topic: ${app}.activity.execute
1195
- input:
1196
- schema:
1197
- type: object
1198
- properties:
1199
- activityName:
1200
- type: string
1201
- parentWorkflowId:
1202
- type: string
1203
- description: used to forge the cleanup key
1204
- originJobId:
1205
- type: string
1206
- description: used for dependency cleanup
1207
- workflowId:
1208
- type: string
1209
- description: the baseId + index
1210
- arguments:
1211
- type: array
1212
- description: the arguments to pass to the activity
1213
- items:
1214
- type: string
1215
- backoffCoefficient:
1216
- type: number
1217
- maximumAttempts:
1218
- type: number
1219
- maximumInterval:
1220
- type: number
1221
- maps:
1222
- activityName: '{signaler_worker.output.data.activityName}'
1223
- arguments: '{signaler_worker.output.data.arguments}'
1224
- workflowDimension: '{signaler_worker.output.data.workflowDimension}'
1225
- index: '{signaler_worker.output.data.index}'
1226
- originJobId: '{signaler_worker.output.data.originJobId}'
1227
- parentWorkflowId: '{signaler_worker.output.data.workflowId}'
1228
- workflowId: '{signaler_worker.output.data.workflowId}'
1229
- workflowTopic: '{signaler_worker.output.data.workflowTopic}'
1230
- backoffCoefficient:
1231
- '@pipe':
1232
- - ['{signaler_worker.output.data.backoffCoefficient}','{trigger.output.data.backoffCoefficient}']
1233
- - ['{@conditional.nullish}', 10]
1234
- - ['{@conditional.nullish}']
1235
- maximumAttempts:
1236
- '@pipe':
1237
- - ['{signaler_worker.output.data.maximumAttempts}','{trigger.output.data.maximumAttempts}']
1238
- - ['{@conditional.nullish}', 5]
1239
- - ['{@conditional.nullish}']
1240
- maximumInterval:
1241
- '@pipe':
1242
- - ['{signaler_worker.output.data.maximumInterval}','{trigger.output.data.maximumInterval}']
1243
- - ['{@conditional.nullish}', 120]
1244
- - ['{@conditional.nullish}']
1245
- job:
1246
- maps:
1247
- idempotentcy-marker[-]:
1248
- '@pipe':
1249
- - '@pipe':
1250
- - ['-proxy', '{signaler_worker.output.data.workflowDimension}', '-', '{signaler_worker.output.data.index}', '-']
1251
- - ['{@string.concat}']
1252
- - '@pipe':
1253
- - '@pipe':
1254
- - ['{$self.output.data.$error}']
1255
- - '@pipe':
1256
- - '@pipe':
1257
- - [$error]
1258
- - '@pipe':
1259
- - ['{$self.output.data.$error}']
1260
- - '@pipe':
1261
- - [ac]
1262
- - '@pipe':
1263
- - ['{$self.output.data.jc}']
1264
- - '@pipe':
1265
- - [au]
1266
- - '@pipe':
1267
- - ['{$self.output.data.ju}']
1268
- - '@pipe':
1269
- - ['job_id']
1270
- - '@pipe':
1271
- - ['{$self.output.data.workflowId}']
1272
- - ['{@object.create}']
1273
- - '@pipe':
1274
- - '@pipe':
1275
- - [data]
1276
- - '@pipe':
1277
- - ['{$self.output.data.response}']
1278
- - '@pipe':
1279
- - [ac]
1280
- - '@pipe':
1281
- - ['{$self.output.data.jc}']
1282
- - '@pipe':
1283
- - [au]
1284
- - '@pipe':
1285
- - ['{$self.output.data.ju}']
1286
- - '@pipe':
1287
- - ['job_id']
1288
- - '@pipe':
1289
- - ['{$self.output.data.workflowId}']
1290
- - ['{@object.create}']
1291
- - ['{@conditional.ternary}']
1292
- - ['{@object.create}']
1293
-
1294
- signaler_proxy_cycler:
1295
- title: Cycles back to the signaler_cycle_hook
1296
- type: cycle
1297
- ancestor: signaler_cycle_hook
1298
- input:
1299
- maps:
1300
- retryCount:
1301
- '@pipe':
1302
- - '@pipe':
1303
- - ['{signaler_proxyer.output.metadata.err}']
1304
- - '@pipe':
1305
- - ['{signaler_cycle_hook.output.data.retryCount}', 0]
1306
- - ['{@logical.or}', 1]
1307
- - ['{@math.add}']
1308
- - '@pipe':
1309
- - [0]
1310
- - ['{@conditional.ternary}']
1311
- throttleSeconds:
1312
- '@pipe':
1313
- - '@pipe':
1314
- - ['{signaler_proxyer.output.metadata.err}']
1315
- - '@pipe':
1316
- - '@pipe':
1317
- - '@pipe':
1318
- - ['{trigger.output.data.backoffCoefficient}', 10]
1319
- - ['{@conditional.nullish}']
1320
- - '@pipe':
1321
- - ['{signaler_cycle_hook.output.data.retryCount}', 0]
1322
- - ['{@conditional.nullish}']
1323
- - ['{@math.pow}']
1324
- - '@pipe':
1325
- - ['{trigger.output.data.maximumInterval}', 120]
1326
- - ['{@logical.or}']
1327
- - ['{@math.min}']
1328
- - '@pipe':
1329
- - [0]
1330
- - ['{@conditional.ternary}']
1331
-
1332
- signaler_collator:
1333
- title: Awaits the collator to resolve the idempotent items as a sequential set
1334
- type: await
1335
- topic: ${app}.collator.execute
1336
- input:
1337
- schema:
1338
- type: object
1339
- properties:
1340
- parentWorkflowId:
1341
- type: string
1342
- description: used to forge the cleanup key
1343
- originJobId:
1344
- type: string
1345
- description: used for dependency cleanup
1346
- workflowId:
1347
- type: string
1348
- size:
1349
- type: number
1350
- description: the number of idempotent items to collate
1351
- items:
1352
- type: array
1353
- description: the idempotent items to collate
1354
- items:
1355
- type: object
1356
- properties:
1357
- index:
1358
- type: number
1359
- data:
1360
- type: object
1361
- maps:
1362
- items: '{signaler_worker.output.data.items}'
1363
- size: '{signaler_worker.output.data.size}'
1364
- workflowDimension: '{signaler_worker.output.data.workflowDimension}'
1365
- index: '{signaler_worker.output.data.index}'
1366
- originJobId: '{signaler_worker.output.data.originJobId}'
1367
- parentWorkflowId: '{signaler_worker.output.data.workflowId}'
1368
- workflowId: '{signaler_worker.output.data.workflowId}'
1369
- workflowTopic: '{signaler_worker.output.data.workflowTopic}'
1370
- output:
1371
- schema:
1372
- type: object
1373
- properties:
1374
- size:
1375
- type: number
1376
- data:
1377
- type: object
1378
- properties:
1379
- response:
1380
- description: the collated response, returned as a object with numeric keys, representing the order in the Promise.all array
1381
- type: object
1382
- patternProperties:
1383
- '^[0-9]+$':
1384
- type: object
1385
- properties:
1386
- type:
1387
- type: string
1388
- enum: [wait, proxy, child, start, sleep]
1389
- data:
1390
- type: unknown
1391
- job:
1392
- maps:
1393
- idempotentcy-marker[-]:
1394
- '@pipe':
1395
- - ['{$self.output.data.response}', {}]
1396
- - '@reduce':
1397
- - '@pipe':
1398
- - - '{$output}'
1399
- - '@pipe':
1400
- - '@pipe':
1401
- - - '-'
1402
- - '@pipe':
1403
- - - '{$item}'
1404
- - type
1405
- - - '{@object.get}'
1406
- - '@pipe':
1407
- - - '{signaler_worker.output.data.workflowDimension}'
1408
- - '@pipe':
1409
- - - '-'
1410
- - '@pipe':
1411
- - '@pipe':
1412
- - - '{signaler_worker.output.data.index}'
1413
- - '@pipe':
1414
- - - '{$index}'
1415
- - - '{@math.add}'
1416
- - '@pipe':
1417
- - - '-'
1418
- - - '{@string.concat}'
1419
- - '@pipe':
1420
- - - '{$item}'
1421
- - - '{@object.set}'
1422
-
1423
- signaler_collate_cycler:
1424
- title: Cycles back to the signaler_cycle_hook after collating the results
1425
- type: cycle
1426
- ancestor: signaler_cycle_hook
1427
- input:
1428
- maps:
1429
- retryCount: 0
1430
- throttleSeconds: 0
1431
-
1432
- signaler_retryer:
1433
- title: Cycles back to the signaler_cycle_hook pivot, increasing the retryCount (the exponential)
1434
- type: cycle
1435
- ancestor: signaler_cycle_hook
1436
- input:
1437
- maps:
1438
- retryCount:
1439
- '@pipe':
1440
- - ['{signaler_cycle_hook.output.data.retryCount}', 0]
1441
- - ['{@logical.or}', 1]
1442
- - ['{@math.add}']
1443
- throttleSeconds:
1444
- '@pipe':
1445
- - '@pipe':
1446
- - '@pipe':
1447
- - ['{trigger.output.data.backoffCoefficient}', 10]
1448
- - ['{@conditional.nullish}']
1449
- - '@pipe':
1450
- - ['{signaler_cycle_hook.output.data.retryCount}', 0]
1451
- - ['{@conditional.nullish}']
1452
- - ['{@math.pow}']
1453
- - '@pipe':
1454
- - ['{trigger.output.data.maximumInterval}', 120]
1455
- - ['{@logical.or}']
1456
- - ['{@math.min}']
1457
-
1458
- transitions:
1459
- trigger:
1460
- - to: cycle_hook
1461
- - to: signaler
1462
- ## MAIN PROCESS TRANSITIONS ##
1463
- cycle_hook:
1464
- - to: throttler
1465
- throttler:
1466
- - to: worker
1467
- worker:
1468
- - to: closer
1469
- conditions:
1470
- code: [200, 596, 597, 598]
1471
- - to: sleeper
1472
- conditions:
1473
- code: 588
1474
- - to: collator
1475
- conditions:
1476
- code: 589
1477
- - to: childer
1478
- conditions:
1479
- code: 590
1480
- match:
1481
- - expected: true
1482
- actual:
1483
- '@pipe':
1484
- - '@pipe':
1485
- - ['{cycle_hook.output.data.retryCount}']
1486
- - '@pipe':
1487
- - ['{trigger.output.data.maximumAttempts}', 5]
1488
- - ['{@conditional.nullish}']
1489
- - ['{@conditional.less_than}']
1490
- - to: proxyer
1491
- conditions:
1492
- code: 591
1493
- - to: retryer
1494
- conditions:
1495
- code: 599
1496
- match:
1497
- - expected: true
1498
- actual:
1499
- '@pipe':
1500
- - '@pipe':
1501
- - ['{cycle_hook.output.data.retryCount}']
1502
- - '@pipe':
1503
- - ['{trigger.output.data.maximumAttempts}', 5]
1504
- - ['{@conditional.nullish}']
1505
- - ['{@conditional.less_than}']
1506
- - to: stopper
1507
- conditions:
1508
- code: [590, 591, 596, 597, 598, 599]
1509
- match:
1510
- - expected: true
1511
- actual:
1512
- '@pipe':
1513
- - '@pipe':
1514
- - ['{cycle_hook.output.data.retryCount}']
1515
- - '@pipe':
1516
- - ['{trigger.output.data.maximumAttempts}', 5]
1517
- - ['{@conditional.nullish}']
1518
- - ['{@conditional.greater_than_or_equal}']
1519
- collator:
1520
- - to: collate_cycler
1521
- childer:
1522
- - to: child_cycler
1523
- proxyer:
1524
- - to: proxy_cycler
1525
- sleeper:
1526
- - to: sleep_cycler
1527
- ### SUBPROCESS TRANSITIONS (REENTRY) ###
1528
- signaler:
1529
- - to: signaler_cycle_hook
1530
- conditions:
1531
- code: 202
1532
- signaler_cycle_hook:
1533
- - to: signaler_throttler
1534
- signaler_throttler:
1535
- - to: signaler_worker
1536
- signaler_worker:
1537
- - to: signaler_sleeper
1538
- conditions:
1539
- code: 588
1540
- - to: signaler_collator
1541
- conditions:
1542
- code: 589
1543
- - to: signaler_childer
1544
- conditions:
1545
- code: 590
1546
- match:
1547
- - expected: true
1548
- actual:
1549
- '@pipe':
1550
- - '@pipe':
1551
- - ['{signaler_cycle_hook.output.data.retryCount}']
1552
- - '@pipe':
1553
- - ['{trigger.output.data.maximumAttempts}', 5]
1554
- - ['{@conditional.nullish}']
1555
- - ['{@conditional.less_than}']
1556
- - to: signaler_proxyer
1557
- conditions:
1558
- code: 591
1559
- - to: signaler_retryer
1560
- conditions:
1561
- code: 599
1562
- match:
1563
- - expected: true
1564
- actual:
1565
- '@pipe':
1566
- - '@pipe':
1567
- - ['{signaler_cycle_hook.output.data.retryCount}']
1568
- - '@pipe':
1569
- - ['{trigger.output.data.maximumAttempts}', 5]
1570
- - ['{@conditional.nullish}']
1571
- - ['{@conditional.less_than}']
1572
- signaler_collator:
1573
- - to: signaler_collate_cycler
1574
- signaler_childer:
1575
- - to: signaler_child_cycler
1576
- signaler_proxyer:
1577
- - to: signaler_proxy_cycler
1578
- signaler_sleeper:
1579
- - to: signaler_sleep_cycler
1580
-
1581
- hooks:
1582
- ${app}.flow.signal:
1583
- - to: signaler
1584
- conditions:
1585
- match:
1586
- - expected: '{trigger.output.data.workflowId}'
1587
- actual: '{$self.hook.data.id}'
1588
-
1589
-
1590
-
1591
- ###################################################
1592
- # THE REENTRANT COLLATOR FLOW #
1593
- # #
1594
- - subscribes: ${app}.collator.execute
1595
- publishes: ${app}.collator.executed
1596
-
1597
- expire: 0
1598
-
1599
- input:
1600
- schema:
1601
- type: object
1602
- properties:
1603
- parentWorkflowId:
1604
- type: string
1605
- originJobId:
1606
- type: string
1607
- workflowId:
1608
- type: string
1609
- workflowTopic:
1610
- type: string
1611
- size:
1612
- title: The number of idempotent items to resolve
1613
- type: number
1614
- items:
1615
- title: Idempotent items to resolve
1616
- type: array
1617
- items:
1618
- type: object
1619
- properties:
1620
- index:
1621
- type: index
1622
- data:
1623
- type: object
1624
- output:
1625
- schema:
1626
- type: object
1627
- properties:
1628
- responses:
1629
- type: array
1630
- items:
1631
- type: object
1632
- properties:
1633
- index:
1634
- type: number
1635
- response:
1636
- type: any
1637
- $error:
1638
- type: object
1639
- properties:
1640
- code:
1641
- type: number
1642
- message:
1643
- type: string
1644
- stack:
1645
- type: string
1646
-
1647
- activities:
1648
- collator_trigger:
1649
- title: Collator Flow Trigger
1650
- type: trigger
1651
- stats:
1652
- id: '{$self.input.data.workflowId}'
1653
- key: '{$self.input.data.parentWorkflowId}'
1654
- parent: '{$self.input.data.originJobId}'
1655
- adjacent: '{$self.input.data.parentWorkflowId}'
1656
- job:
1657
- maps:
1658
- cur_index: 0
1659
-
1660
- collator_cycle_hook:
1661
- title: Pivot - Cycling Descendant Points Here
1662
- type: hook
1663
- cycle: true
1664
- job:
1665
- maps:
1666
- size:
1667
- '@pipe':
1668
- - ['{collator_trigger.output.data.items}']
1669
- - ['{@array.length}']
1670
- cur_index:
1671
- '@pipe':
1672
- - ['{$job.data.cur_index}', 1]
1673
- - ['{@math.add}']
1674
- output:
1675
- maps:
1676
- cur_index: '{$job.data.cur_index}'
1677
-
1678
- collator_cycler:
1679
- title: Cycles back to the collator_cycle_hook pivot
1680
- type: cycle
1681
- ancestor: collator_cycle_hook
1682
- input:
1683
- maps:
1684
- cur_index: '{$job.data.cur_index}'
1685
-
1686
- collator_sleeper:
1687
- title: Pauses a single thread within the collator for a set amount of time while all other threads remain active
1688
- type: hook
1689
- sleep:
1690
- '@pipe':
1691
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1692
- - ['{@array.get}', duration]
1693
- - ['{@object.get}']
1694
- job:
1695
- maps:
1696
- response[25]:
1697
- '@pipe':
1698
- - '@pipe':
1699
- - ['{collator_cycle_hook.output.data.cur_index}']
1700
- - '@pipe':
1701
- - '@pipe':
1702
- - [type]
1703
- - '@pipe':
1704
- - [sleep]
1705
- - '@pipe':
1706
- - [duration]
1707
- - '@pipe':
1708
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1709
- - ['{@array.get}', duration]
1710
- - ['{@object.get}']
1711
- - '@pipe':
1712
- - [ac]
1713
- - '@pipe':
1714
- - ['{$self.output.metadata.ac}']
1715
- - '@pipe':
1716
- - [au]
1717
- - '@pipe':
1718
- - ['{$self.output.metadata.au}']
1719
- - ['{@object.create}']
1720
- - ['{@object.create}']
1721
-
1722
- collator_waiter:
1723
- title: Waits for a matching signal to be sent to the collator workflow
1724
- type: hook
1725
- hook:
1726
- type: object
1727
- properties:
1728
- signalData:
1729
- type: object
1730
- job:
1731
- maps:
1732
- response[25]:
1733
- '@pipe':
1734
- - ['{collator_trigger.output.data.items}']
1735
- - '@pipe':
1736
- - ['{collator_cycle_hook.output.data.cur_index}']
1737
- - '@pipe':
1738
- - [type, wait, data, '{$self.hook.data}', ac, '{$job.metadata.jc}', au, '{$self.output.metadata.au}']
1739
- - ['{@object.create}']
1740
- - ['{@object.create}']
1741
-
1742
- collator_childer:
1743
- title: Awaits a call for a child flow to be executed/started
1744
- type: await
1745
- topic: ${app}.execute
1746
- await:
1747
- '@pipe':
1748
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1749
- - ['{@array.get}', await]
1750
- - ['{@object.get}']
1751
- input:
1752
- schema:
1753
- type: object
1754
- properties:
1755
- workflowTopic:
1756
- type: string
1757
- backoffCoefficient:
1758
- type: number
1759
- maximumAttempts:
1760
- type: number
1761
- maximumInterval:
1762
- type: number
1763
- expire:
1764
- type: number
1765
- parentWorkflowId:
1766
- type: string
1767
- description: used to forge the cleanup key
1768
- originJobId:
1769
- type: string
1770
- description: used for dependency cleanup
1771
- workflowId:
1772
- type: string
1773
- arguments:
1774
- type: array
1775
- description: the arguments to pass to the activity
1776
- items:
1777
- type: string
1778
- maps:
1779
- arguments:
1780
- '@pipe':
1781
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1782
- - ['{@array.get}', arguments]
1783
- - ['{@object.get}']
1784
- workflowDimension:
1785
- '@pipe':
1786
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1787
- - ['{@array.get}', workflowDimension]
1788
- - ['{@object.get}']
1789
- index:
1790
- '@pipe':
1791
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1792
- - ['{@array.get}', index]
1793
- - ['{@object.get}']
1794
- originJobId:
1795
- '@pipe':
1796
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1797
- - ['{@array.get}', originJobId]
1798
- - ['{@object.get}']
1799
- parentWorkflowId:
1800
- '@pipe':
1801
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1802
- - ['{@array.get}', parentWorkflowId]
1803
- - ['{@object.get}']
1804
- workflowId:
1805
- '@pipe':
1806
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1807
- - ['{@array.get}', workflowId]
1808
- - ['{@object.get}']
1809
- workflowName:
1810
- '@pipe':
1811
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1812
- - ['{@array.get}', workflowName]
1813
- - ['{@object.get}']
1814
- workflowTopic:
1815
- '@pipe':
1816
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1817
- - ['{@array.get}', workflowTopic]
1818
- - ['{@object.get}']
1819
- backoffCoefficient:
1820
- '@pipe':
1821
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1822
- - ['{@array.get}', backoffCoefficient]
1823
- - ['{@object.get}']
1824
- maximumAttempts:
1825
- '@pipe':
1826
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1827
- - ['{@array.get}', maximumAttempts]
1828
- - ['{@object.get}']
1829
- maximumInterval:
1830
- '@pipe':
1831
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1832
- - ['{@array.get}', maximumInterval]
1833
- - ['{@object.get}']
1834
- output:
1835
- schema:
1836
- type: object
1837
- properties:
1838
- response:
1839
- type: any
1840
- $error:
1841
- type: object
1842
- properties:
1843
- code:
1844
- type: number
1845
- message:
1846
- type: string
1847
- stack:
1848
- type: string
1849
- done:
1850
- type: boolean
1851
- workflowId:
1852
- type: string
1853
- jc:
1854
- type: string
1855
- ju:
1856
- type: string
1857
- job:
1858
- maps:
1859
- response[25]:
1860
- '@pipe':
1861
- - '@pipe':
1862
- - ['{collator_cycle_hook.output.data.cur_index}']
1863
- - '@pipe':
1864
- - '@pipe':
1865
- - ['{$self.output.data.$error}']
1866
- - '@pipe':
1867
- - '@pipe':
1868
- - [type]
1869
- - '@pipe':
1870
- - [child]
1871
- - '@pipe':
1872
- - [$error]
1873
- - '@pipe':
1874
- - ['{$self.output.data.$error}']
1875
- - '@pipe':
1876
- - [ac]
1877
- - '@pipe':
1878
- - ['{$job.metadata.jc}']
1879
- - '@pipe':
1880
- - [au]
1881
- - '@pipe':
1882
- - ['{@date.toISOXString}']
1883
- - '@pipe':
1884
- - [job_id]
1885
- - '@pipe':
1886
- - ['{$self.output.data.workflowId}']
1887
- - ['{@object.create}']
1888
- - '@pipe':
1889
- - '@pipe':
1890
- - ['{$self.output.data.done}']
1891
- - '@pipe':
1892
- - '@pipe':
1893
- - [type]
1894
- - '@pipe':
1895
- - [child]
1896
- - '@pipe':
1897
- - [data]
1898
- - '@pipe':
1899
- - ['{$self.output.data.response}']
1900
- - '@pipe':
1901
- - [ac]
1902
- - '@pipe':
1903
- - ['{$job.metadata.jc}']
1904
- - '@pipe':
1905
- - [au]
1906
- - '@pipe':
1907
- - ['{@date.toISOXString}']
1908
- - '@pipe':
1909
- - [job_id]
1910
- - '@pipe':
1911
- - ['{$self.output.data.workflowId}']
1912
- - ['{@object.create}']
1913
- - '@pipe':
1914
- - '@pipe':
1915
- - [type]
1916
- - '@pipe':
1917
- - [start]
1918
- - '@pipe':
1919
- - [data]
1920
- - '@pipe':
1921
- - ['{$self.output.data.job_id}']
1922
- - '@pipe':
1923
- - [ac]
1924
- - '@pipe':
1925
- - ['{$job.metadata.jc}']
1926
- - '@pipe':
1927
- - [au]
1928
- - '@pipe':
1929
- - ['{@date.toISOXString}']
1930
- - '@pipe':
1931
- - [job_id]
1932
- - '@pipe':
1933
- - ['{$self.output.data.job_id}']
1934
- - ['{@object.create}']
1935
- - ['{@conditional.ternary}']
1936
- - ['{@conditional.ternary}']
1937
- - ['{@object.create}']
1938
-
1939
- collator_proxyer:
1940
- title: Invokes the activity flow and awaits the response
1941
- type: await
1942
- topic: ${app}.activity.execute
1943
- input:
1944
- schema:
1945
- type: object
1946
- properties:
1947
- activityName:
1948
- type: string
1949
- parentWorkflowId:
1950
- type: string
1951
- description: used to forge the cleanup key
1952
- originJobId:
1953
- type: string
1954
- description: used for dependency cleanup
1955
- workflowId:
1956
- type: string
1957
- arguments:
1958
- type: array
1959
- description: the arguments to pass to the activity
1960
- items:
1961
- type: string
1962
- backoffCoefficient:
1963
- type: number
1964
- maximumAttempts:
1965
- type: number
1966
- maximumInterval:
1967
- type: number
1968
- maps:
1969
- activityName:
1970
- '@pipe':
1971
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1972
- - ['{@array.get}', activityName]
1973
- - ['{@object.get}']
1974
- arguments:
1975
- '@pipe':
1976
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1977
- - ['{@array.get}', arguments]
1978
- - ['{@object.get}']
1979
- workflowDimension:
1980
- '@pipe':
1981
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1982
- - ['{@array.get}', workflowDimension]
1983
- - ['{@object.get}']
1984
- index:
1985
- '@pipe':
1986
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1987
- - ['{@array.get}', index]
1988
- - ['{@object.get}']
1989
- originJobId:
1990
- '@pipe':
1991
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1992
- - ['{@array.get}', originJobId]
1993
- - ['{@object.get}']
1994
- parentWorkflowId:
1995
- '@pipe':
1996
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
1997
- - ['{@array.get}', parentWorkflowId]
1998
- - ['{@object.get}']
1999
- workflowId:
2000
- '@pipe':
2001
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
2002
- - ['{@array.get}', workflowId]
2003
- - ['{@object.get}']
2004
- workflowTopic:
2005
- '@pipe':
2006
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
2007
- - ['{@array.get}', workflowTopic]
2008
- - ['{@object.get}']
2009
- backoffCoefficient: '{collator_trigger.output.data.backoffCoefficient}'
2010
- maximumAttempts: '{collator_trigger.output.data.maximumAttempts}'
2011
- maximumInterval: '{collator_trigger.output.data.maximumInterval}'
2012
- output:
2013
- schema:
2014
- type: object
2015
- properties:
2016
- response:
2017
- type: any
2018
- $error:
2019
- type: object
2020
- properties:
2021
- code:
2022
- type: number
2023
- message:
2024
- type: string
2025
- stack:
2026
- type: string
2027
- done:
2028
- type: boolean
2029
- workflowId:
2030
- type: string
2031
- jc:
2032
- type: string
2033
- ju:
2034
- type: string
2035
- job:
2036
- maps:
2037
- response[25]:
2038
- '@pipe':
2039
- - '@pipe':
2040
- - ['{collator_cycle_hook.output.data.cur_index}']
2041
- - '@pipe':
2042
- - '@pipe':
2043
- - ['{$self.output.data.response}']
2044
- - '@pipe':
2045
- - '@pipe':
2046
- - [type]
2047
- - '@pipe':
2048
- - ['proxy']
2049
- - '@pipe':
2050
- - [data]
2051
- - '@pipe':
2052
- - ['{$self.output.data.response}']
2053
- - '@pipe':
2054
- - [ac]
2055
- - '@pipe':
2056
- - ['{$job.metadata.jc}']
2057
- - '@pipe':
2058
- - [au]
2059
- - '@pipe':
2060
- - ['{@date.toISOXString}']
2061
- - '@pipe':
2062
- - [job_id]
2063
- - '@pipe':
2064
- - ['{$self.output.data.workflowId}']
2065
- - ['{@object.create}']
2066
- - '@pipe':
2067
- - '@pipe':
2068
- - [$error]
2069
- - '@pipe':
2070
- - ['{$self.output.data}']
2071
- - '@pipe':
2072
- - [ac]
2073
- - '@pipe':
2074
- - ['{$job.metadata.jc}']
2075
- - '@pipe':
2076
- - [au]
2077
- - '@pipe':
2078
- - ['{@date.toISOXString}']
2079
- - '@pipe':
2080
- - [job_id]
2081
- - '@pipe':
2082
- - ['{$self.output.data.workflowId}']
2083
- - ['{@object.create}']
2084
- - ['{@conditional.ternary}']
2085
- - ['{@object.create}']
2086
-
2087
- transitions:
2088
- collator_trigger:
2089
- - to: collator_cycle_hook
2090
- collator_cycle_hook:
2091
- - to: collator_cycler
2092
- conditions:
2093
- code: 200
2094
- match:
2095
- - expected: true
2096
- actual:
2097
- '@pipe':
2098
- - '@pipe':
2099
- - ['{$job.data.cur_index}']
2100
- - '@pipe':
2101
- - ['{collator_trigger.output.data.items}']
2102
- - ['{@array.length}']
2103
- - ['{@conditional.less_than}']
2104
- - to: collator_childer
2105
- conditions:
2106
- code: 200
2107
- match:
2108
- - expected: 590
2109
- actual:
2110
- '@pipe':
2111
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
2112
- - ['{@array.get}', code]
2113
- - ['{@object.get}']
2114
- - to: collator_proxyer
2115
- conditions:
2116
- code: 200
2117
- match:
2118
- - expected: 591
2119
- actual:
2120
- '@pipe':
2121
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
2122
- - ['{@array.get}', code]
2123
- - ['{@object.get}']
2124
- - to: collator_sleeper
2125
- conditions:
2126
- code: 200
2127
- match:
2128
- - expected: 588
2129
- actual:
2130
- '@pipe':
2131
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
2132
- - ['{@array.get}', code]
2133
- - ['{@object.get}']
2134
- - to: collator_waiter
2135
- conditions:
2136
- code: 200
2137
- match:
2138
- - expected: 595
2139
- actual:
2140
- '@pipe':
2141
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
2142
- - ['{@array.get}', code]
2143
- - ['{@object.get}']
2144
-
2145
- hooks:
2146
- ${app}.wfs.signal:
2147
- - to: collator_waiter
2148
- conditions:
2149
- match:
2150
- - expected:
2151
- '@pipe':
2152
- - ['{collator_trigger.output.data.items}', '{collator_cycle_hook.output.data.cur_index}']
2153
- - ['{@array.get}', signalId]
2154
- - ['{@object.get}']
2155
- actual: '{$self.hook.data.id}'
2156
-
2157
-
2158
-
2159
- ###################################################
2160
- # THE REENTRANT ACTIVITY FLOW #
2161
- # #
2162
- - subscribes: ${app}.activity.execute
2163
- publishes: ${app}.activity.executed
2164
-
2165
- expire: 0
2166
-
2167
- input:
2168
- schema:
2169
- type: object
2170
- properties:
2171
- parentWorkflowId:
2172
- type: string
2173
- originJobId:
2174
- type: string
2175
- workflowId:
2176
- type: string
2177
- workflowTopic:
2178
- type: string
2179
- activityName:
2180
- type: string
2181
- arguments:
2182
- type: array
2183
- backoffCoefficient:
2184
- type: number
2185
- maximumAttempts:
2186
- type: number
2187
- maximumInterval:
2188
- type: number
2189
- output:
2190
- schema:
2191
- type: object
2192
- properties:
2193
- response:
2194
- type: any
2195
- done:
2196
- type: boolean
2197
- workflowId:
2198
- type: string
2199
- jc:
2200
- type: string
2201
- ju:
2202
- type: string
2203
-
2204
- activities:
2205
- activity_trigger:
2206
- title: Activity Flow Trigger
2207
- type: trigger
2208
- stats:
2209
- id: '{$self.input.data.workflowId}'
2210
- key: '{$self.input.data.parentWorkflowId}'
2211
- parent: '{$self.input.data.originJobId}'
2212
- adjacent: '{$self.input.data.parentWorkflowId}'
2213
- job:
2214
- maps:
2215
- workflowId: '{$self.input.data.workflowId}'
2216
-
2217
- activity_cycle_hook:
2218
- title: Activity Flow Pivot - Cycling Descendants Point Here
2219
- type: hook
2220
- cycle: true
2221
- output:
2222
- schema:
2223
- type: object
2224
- properties:
2225
- retryCount:
2226
- type: number
2227
- maps:
2228
- retryCount: 0
2229
-
2230
- activity_worker:
2231
- title: Activity Worker - Calls Activity Functions
2232
- type: worker
2233
- topic: '{activity_trigger.output.data.workflowTopic}'
2234
- input:
2235
- schema:
2236
- type: object
2237
- properties:
2238
- parentWorkflowId:
2239
- type: string
2240
- workflowId:
2241
- type: string
2242
- workflowTopic:
2243
- type: string
2244
- activityName:
2245
- type: string
2246
- arguments:
2247
- type: array
2248
- maps:
2249
- parentWorkflowId: '{activity_trigger.output.data.parentWorkflowId}'
2250
- workflowId: '{activity_trigger.output.data.workflowId}'
2251
- workflowTopic: '{activity_trigger.output.data.workflowTopic}'
2252
- activityName: '{activity_trigger.output.data.activityName}'
2253
- arguments: '{activity_trigger.output.data.arguments}'
2254
- output:
2255
- schema:
2256
- type: object
2257
- properties:
2258
- response:
2259
- type: any
2260
- job:
2261
- maps:
2262
- response: '{$self.output.data.response}'
2263
-
2264
- activity_retryer:
2265
- title: Pauses for an exponentially-throttled amount of time after a 599 (retryable) error
2266
- type: hook
2267
- sleep:
2268
- '@pipe':
2269
- - '@pipe':
2270
- - ['{activity_trigger.output.data.backoffCoefficient}', 10]
2271
- - ['{@logical.or}', '{activity_cycle_hook.output.data.retryCount}']
2272
- - ['{@math.pow}']
2273
- - '@pipe':
2274
- - ['{activity_trigger.output.data.maximumInterval}', 120]
2275
- - ['{@math.min}']
2276
- - ['{@math.min}']
2277
-
2278
- activity_retry_cycler:
2279
- title: Cycles back to the activity_cycle_hook pivot, incrementing the \`retryCount\` (the exponential)
2280
- type: cycle
2281
- ancestor: activity_cycle_hook
2282
- input:
2283
- maps:
2284
- retryCount:
2285
- '@pipe':
2286
- - ['{activity_cycle_hook.output.data.retryCount}', 1]
2287
- - ['{@math.add}']
2288
-
2289
- activity_closer:
2290
- title: Marks the activity workflow as done
2291
- type: hook
2292
- job:
2293
- maps:
2294
- done: true
2295
- $error: '{activity_worker.output.data.$error}'
2296
- jc: '{$job.metadata.jc}'
2297
- ju:
2298
- '@pipe':
2299
- - ['{@date.toISOXString}']
2300
-
2301
- activity_stopper:
2302
- title: Stops the activity after retry count has been maxed
2303
- type: hook
2304
- job:
2305
- maps:
2306
- done: true
2307
- $error: '{activity_worker.output.data.$error}'
2308
- jc: '{$job.metadata.jc}'
2309
- ju:
2310
- '@pipe':
2311
- - ['{@date.toISOXString}']
2312
-
2313
- transitions:
2314
- activity_trigger:
2315
- - to: activity_cycle_hook
2316
- activity_cycle_hook:
2317
- - to: activity_worker
2318
- activity_worker:
2319
- - to: activity_closer
2320
- conditions:
2321
- code: [200, 598, 597, 596]
2322
- - to: activity_stopper
2323
- conditions:
2324
- code: 599
2325
- match:
2326
- - expected: true
2327
- actual:
2328
- '@pipe':
2329
- - '@pipe':
2330
- - ['{activity_cycle_hook.output.data.retryCount}']
2331
- - '@pipe':
2332
- - ['{activity_trigger.output.data.maximumAttempts}', 5]
2333
- - ['{@conditional.nullish}']
2334
- - ['{@conditional.greater_than_or_equal}']
2335
-
2336
- - to: activity_retryer
2337
- conditions:
2338
- code: 599
2339
- match:
2340
- - expected: true
2341
- actual:
2342
- '@pipe':
2343
- - '@pipe':
2344
- - ['{activity_cycle_hook.output.data.retryCount}']
2345
- - '@pipe':
2346
- - ['{activity_trigger.output.data.maximumAttempts}', 5]
2347
- - ['{@conditional.nullish}']
2348
- - ['{@conditional.less_than}']
2349
- activity_retryer:
2350
- - to: activity_retry_cycler
2351
- `;
2352
- };
2353
-
2354
- export {
2355
- getWorkflowYAML,
2356
- APP_VERSION,
2357
- APP_ID,
2358
- };