@webda/workflow 0.0.0-stage → 4.0.0-beta.13
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.
- package/LICENSE +166 -0
- package/README.md +54 -2
- package/lib/authoring.d.ts +112 -0
- package/lib/authoring.d.ts.map +1 -0
- package/lib/authoring.js +107 -0
- package/lib/authoring.js.map +1 -0
- package/lib/expression.d.ts +21 -0
- package/lib/expression.d.ts.map +1 -0
- package/lib/expression.js +196 -0
- package/lib/expression.js.map +1 -0
- package/lib/graph.d.ts +291 -0
- package/lib/graph.d.ts.map +1 -0
- package/lib/graph.js +72 -0
- package/lib/graph.js.map +1 -0
- package/lib/hooks.d.ts +38 -0
- package/lib/hooks.d.ts.map +1 -0
- package/lib/hooks.js +23 -0
- package/lib/hooks.js.map +1 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -0
- package/lib/interpreter.d.ts +63 -0
- package/lib/interpreter.d.ts.map +1 -0
- package/lib/interpreter.js +330 -0
- package/lib/interpreter.js.map +1 -0
- package/lib/models/workflow.model.d.ts +71 -0
- package/lib/models/workflow.model.d.ts.map +1 -0
- package/lib/models/workflow.model.js +70 -0
- package/lib/models/workflow.model.js.map +1 -0
- package/lib/models/workflowinstance.model.d.ts +132 -0
- package/lib/models/workflowinstance.model.d.ts.map +1 -0
- package/lib/models/workflowinstance.model.js +168 -0
- package/lib/models/workflowinstance.model.js.map +1 -0
- package/lib/models/workflowsignal.model.d.ts +51 -0
- package/lib/models/workflowsignal.model.d.ts.map +1 -0
- package/lib/models/workflowsignal.model.js +53 -0
- package/lib/models/workflowsignal.model.js.map +1 -0
- package/lib/models/workflowtask.model.d.ts +103 -0
- package/lib/models/workflowtask.model.d.ts.map +1 -0
- package/lib/models/workflowtask.model.js +104 -0
- package/lib/models/workflowtask.model.js.map +1 -0
- package/lib/workflow.service.d.ts +670 -0
- package/lib/workflow.service.d.ts.map +1 -0
- package/lib/workflow.service.js +1950 -0
- package/lib/workflow.service.js.map +1 -0
- package/package.json +68 -3
- package/webda.module.json +2670 -0
|
@@ -0,0 +1,2670 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://webda.io/schemas/webda.module.v4.json",
|
|
3
|
+
"beans": {},
|
|
4
|
+
"deployers": {},
|
|
5
|
+
"moddas": {
|
|
6
|
+
"Webda/WorkflowService": {
|
|
7
|
+
"Import": "lib/workflow.service:WorkflowService",
|
|
8
|
+
"Schema": {
|
|
9
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"definitions": {
|
|
12
|
+
"FlowDefinitionData": {
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"description": "A {@link FlowDefinition} as models and configuration hold it\n\nThe statements are recursive: describing them in a JSON schema makes the schema generator explode, so they are\nplain JSON there. {@link validateExpr } checks untrusted expressions.",
|
|
15
|
+
"properties": {
|
|
16
|
+
"body": {
|
|
17
|
+
"description": "The statements ({@link Stmt}[])",
|
|
18
|
+
"items": {},
|
|
19
|
+
"type": "array"
|
|
20
|
+
},
|
|
21
|
+
"id": {
|
|
22
|
+
"description": "Operation id `<Class>.<Method>`",
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"input": {
|
|
26
|
+
"description": "JSON schema of the input",
|
|
27
|
+
"type": "object"
|
|
28
|
+
},
|
|
29
|
+
"options": {
|
|
30
|
+
"$ref": "#/definitions/TaskOptions",
|
|
31
|
+
"description": "Default options of every task"
|
|
32
|
+
},
|
|
33
|
+
"output": {
|
|
34
|
+
"description": "JSON schema of the output",
|
|
35
|
+
"type": "object"
|
|
36
|
+
},
|
|
37
|
+
"params": {
|
|
38
|
+
"description": "Names of the flow parameters, in order",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
},
|
|
42
|
+
"type": "array"
|
|
43
|
+
},
|
|
44
|
+
"source": {
|
|
45
|
+
"default": "code",
|
|
46
|
+
"description": "Where the flow comes from",
|
|
47
|
+
"enum": [
|
|
48
|
+
"code",
|
|
49
|
+
"stored"
|
|
50
|
+
],
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"version": {
|
|
54
|
+
"description": "{@link flowVersion} of the definition, computed when missing",
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": [
|
|
59
|
+
"body",
|
|
60
|
+
"id",
|
|
61
|
+
"input",
|
|
62
|
+
"params"
|
|
63
|
+
],
|
|
64
|
+
"type": "object"
|
|
65
|
+
},
|
|
66
|
+
"TaskOptions": {
|
|
67
|
+
"additionalProperties": false,
|
|
68
|
+
"description": "Options of a task, and defaults of a flow",
|
|
69
|
+
"properties": {
|
|
70
|
+
"backoff": {
|
|
71
|
+
"default": "exponential",
|
|
72
|
+
"description": "Delay growth between attempts",
|
|
73
|
+
"enum": [
|
|
74
|
+
"fixed",
|
|
75
|
+
"exponential"
|
|
76
|
+
],
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"delay": {
|
|
80
|
+
"default": "1s",
|
|
81
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"retries": {
|
|
85
|
+
"default": 0,
|
|
86
|
+
"description": "Retries after the first attempt",
|
|
87
|
+
"type": "number"
|
|
88
|
+
},
|
|
89
|
+
"timeout": {
|
|
90
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
91
|
+
"type": "string"
|
|
92
|
+
},
|
|
93
|
+
"useSystem": {
|
|
94
|
+
"default": false,
|
|
95
|
+
"description": "Run the task as the system instead of the launcher",
|
|
96
|
+
"type": "boolean"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"type": "object"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"description": "Parameters of the {@link WorkflowService}",
|
|
103
|
+
"properties": {
|
|
104
|
+
"allowStoredSystem": {
|
|
105
|
+
"default": false,
|
|
106
|
+
"description": "Allow `useSystem` tasks in stored workflows",
|
|
107
|
+
"type": "boolean"
|
|
108
|
+
},
|
|
109
|
+
"concurrency": {
|
|
110
|
+
"default": 10,
|
|
111
|
+
"description": "Maximum number of tasks running at once on this replica",
|
|
112
|
+
"type": "number"
|
|
113
|
+
},
|
|
114
|
+
"flows": {
|
|
115
|
+
"description": "Flows to register",
|
|
116
|
+
"items": {
|
|
117
|
+
"$ref": "#/definitions/FlowDefinitionData"
|
|
118
|
+
},
|
|
119
|
+
"type": "array"
|
|
120
|
+
},
|
|
121
|
+
"leaseDuration": {
|
|
122
|
+
"default": 60000,
|
|
123
|
+
"description": "Lease of a claimed task (ms), renewed while it runs",
|
|
124
|
+
"type": "number"
|
|
125
|
+
},
|
|
126
|
+
"maxBufferedSignals": {
|
|
127
|
+
"default": 100,
|
|
128
|
+
"description": "Maximum number of unexpired buffered signals per `(event, key)`: a new one past it is refused",
|
|
129
|
+
"type": "number"
|
|
130
|
+
},
|
|
131
|
+
"maxContextSize": {
|
|
132
|
+
"default": 262144,
|
|
133
|
+
"description": "Maximum size of the journal and input of an instance (bytes of JSON)",
|
|
134
|
+
"type": "number"
|
|
135
|
+
},
|
|
136
|
+
"maxSignalPayload": {
|
|
137
|
+
"default": 65536,
|
|
138
|
+
"description": "Maximum size of a signal payload (bytes of JSON)",
|
|
139
|
+
"type": "number"
|
|
140
|
+
},
|
|
141
|
+
"pollInterval": {
|
|
142
|
+
"default": 1000,
|
|
143
|
+
"description": "Interval between two polls of the worker (ms)",
|
|
144
|
+
"type": "number"
|
|
145
|
+
},
|
|
146
|
+
"signalTtl": {
|
|
147
|
+
"default": "1d",
|
|
148
|
+
"description": "How long a signal sent before any wait is kept (Duration syntax)",
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
"stopTimeout": {
|
|
152
|
+
"default": 30000,
|
|
153
|
+
"description": "Grace period of stop() for the running attempts (ms), then they are aborted and their outcome dropped",
|
|
154
|
+
"type": "number"
|
|
155
|
+
},
|
|
156
|
+
"storedWorkflowRole": {
|
|
157
|
+
"default": "workflow-admin",
|
|
158
|
+
"description": "Role needed to create, update or delete a stored workflow",
|
|
159
|
+
"type": "string"
|
|
160
|
+
},
|
|
161
|
+
"sweepInterval": {
|
|
162
|
+
"default": 60000,
|
|
163
|
+
"description": "Interval of the recovery sweep (ms): an active instance not updated for this long and without a live task is\nreplayed",
|
|
164
|
+
"type": "number"
|
|
165
|
+
},
|
|
166
|
+
"syncInterval": {
|
|
167
|
+
"default": 60000,
|
|
168
|
+
"description": "Without `syncPubSub`, interval between two reloads of the stored workflows (ms)",
|
|
169
|
+
"type": "number"
|
|
170
|
+
},
|
|
171
|
+
"syncPubSub": {
|
|
172
|
+
"description": "PubSub service announcing the stored workflow changes to the other replicas",
|
|
173
|
+
"type": "string"
|
|
174
|
+
},
|
|
175
|
+
"type": {
|
|
176
|
+
"description": "Type of the service",
|
|
177
|
+
"type": "string"
|
|
178
|
+
},
|
|
179
|
+
"worker": {
|
|
180
|
+
"default": true,
|
|
181
|
+
"description": "Run the worker loop on this replica",
|
|
182
|
+
"type": "boolean"
|
|
183
|
+
},
|
|
184
|
+
"openapi": {
|
|
185
|
+
"type": "object",
|
|
186
|
+
"additionalProperties": true
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"required": [
|
|
190
|
+
"type"
|
|
191
|
+
],
|
|
192
|
+
"type": "object",
|
|
193
|
+
"title": "WorkflowService"
|
|
194
|
+
},
|
|
195
|
+
"Configuration": "lib/workflow.service:WorkflowServiceParameters"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"models": {
|
|
199
|
+
"Webda/Workflow": {
|
|
200
|
+
"Plural": "Workflows",
|
|
201
|
+
"Import": "lib/models/workflow.model:default",
|
|
202
|
+
"Relations": {},
|
|
203
|
+
"Ancestors": [],
|
|
204
|
+
"Subclasses": [],
|
|
205
|
+
"Reflection": {
|
|
206
|
+
"name": {
|
|
207
|
+
"type": "string"
|
|
208
|
+
},
|
|
209
|
+
"params": {
|
|
210
|
+
"type": "Array",
|
|
211
|
+
"typeParameters": [
|
|
212
|
+
"string"
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
"input": {
|
|
216
|
+
"type": "object"
|
|
217
|
+
},
|
|
218
|
+
"body": {
|
|
219
|
+
"type": "Array",
|
|
220
|
+
"typeParameters": [
|
|
221
|
+
"any"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"options": {
|
|
225
|
+
"type": "TaskOptions"
|
|
226
|
+
},
|
|
227
|
+
"crons": {
|
|
228
|
+
"type": "Array",
|
|
229
|
+
"typeParameters": [
|
|
230
|
+
"StoredWorkflowCron"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"version": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
},
|
|
236
|
+
"updatedBy": {
|
|
237
|
+
"type": "string"
|
|
238
|
+
},
|
|
239
|
+
"uuid": {
|
|
240
|
+
"type": "string"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"Schemas": {
|
|
244
|
+
"Output": {
|
|
245
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
246
|
+
"WebdaModel": true,
|
|
247
|
+
"WebdaPlural": "Workflows",
|
|
248
|
+
"additionalProperties": false,
|
|
249
|
+
"definitions": {
|
|
250
|
+
"Record<string, any>": {
|
|
251
|
+
"additionalProperties": {},
|
|
252
|
+
"description": "Construct a type with a set of properties K of type T",
|
|
253
|
+
"type": "object"
|
|
254
|
+
},
|
|
255
|
+
"StoredWorkflowCron": {
|
|
256
|
+
"additionalProperties": false,
|
|
257
|
+
"description": "A cron launching a stored workflow",
|
|
258
|
+
"properties": {
|
|
259
|
+
"cron": {
|
|
260
|
+
"description": "Cron expression",
|
|
261
|
+
"type": "string"
|
|
262
|
+
},
|
|
263
|
+
"description": {
|
|
264
|
+
"description": "Description",
|
|
265
|
+
"type": "string"
|
|
266
|
+
},
|
|
267
|
+
"input": {
|
|
268
|
+
"$ref": "#/definitions/Record%3Cstring%2C%20any%3E",
|
|
269
|
+
"description": "Flow input, by parameter name"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"required": [
|
|
273
|
+
"cron"
|
|
274
|
+
],
|
|
275
|
+
"type": "object"
|
|
276
|
+
},
|
|
277
|
+
"TaskOptions": {
|
|
278
|
+
"additionalProperties": false,
|
|
279
|
+
"description": "Options of a task, and defaults of a flow",
|
|
280
|
+
"properties": {
|
|
281
|
+
"backoff": {
|
|
282
|
+
"default": "exponential",
|
|
283
|
+
"description": "Delay growth between attempts",
|
|
284
|
+
"enum": [
|
|
285
|
+
"fixed",
|
|
286
|
+
"exponential"
|
|
287
|
+
],
|
|
288
|
+
"type": "string"
|
|
289
|
+
},
|
|
290
|
+
"delay": {
|
|
291
|
+
"default": "1s",
|
|
292
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
293
|
+
"type": "string"
|
|
294
|
+
},
|
|
295
|
+
"retries": {
|
|
296
|
+
"default": 0,
|
|
297
|
+
"description": "Retries after the first attempt",
|
|
298
|
+
"type": "number"
|
|
299
|
+
},
|
|
300
|
+
"timeout": {
|
|
301
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
302
|
+
"type": "string"
|
|
303
|
+
},
|
|
304
|
+
"useSystem": {
|
|
305
|
+
"default": false,
|
|
306
|
+
"description": "Run the task as the system instead of the launcher",
|
|
307
|
+
"type": "boolean"
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
"type": "object"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"description": "A workflow defined at runtime: the same graph as a `.flow.ts` flow, stored as data\n\nSaving validates the graph (expressions, statement kinds, operations, `useSystem`); the WorkflowService registers\nit as the operation `name` and its crons, which run as the user who saved it last.",
|
|
314
|
+
"properties": {
|
|
315
|
+
"body": {
|
|
316
|
+
"description": "The statements ({@link Stmt }[])",
|
|
317
|
+
"items": {},
|
|
318
|
+
"type": "array"
|
|
319
|
+
},
|
|
320
|
+
"crons": {
|
|
321
|
+
"description": "Crons launching the flow",
|
|
322
|
+
"items": {
|
|
323
|
+
"$ref": "#/definitions/StoredWorkflowCron"
|
|
324
|
+
},
|
|
325
|
+
"type": "array"
|
|
326
|
+
},
|
|
327
|
+
"input": {
|
|
328
|
+
"description": "JSON schema of the input",
|
|
329
|
+
"type": "object"
|
|
330
|
+
},
|
|
331
|
+
"name": {
|
|
332
|
+
"description": "Flow id: the operation launching it",
|
|
333
|
+
"type": "string"
|
|
334
|
+
},
|
|
335
|
+
"options": {
|
|
336
|
+
"$ref": "#/definitions/TaskOptions",
|
|
337
|
+
"description": "Default options of every task"
|
|
338
|
+
},
|
|
339
|
+
"params": {
|
|
340
|
+
"description": "Names of the flow parameters, in order",
|
|
341
|
+
"items": {
|
|
342
|
+
"type": "string"
|
|
343
|
+
},
|
|
344
|
+
"type": "array"
|
|
345
|
+
},
|
|
346
|
+
"updatedBy": {
|
|
347
|
+
"description": "User id of the last save: the identity of its crons",
|
|
348
|
+
"type": "string"
|
|
349
|
+
},
|
|
350
|
+
"uuid": {
|
|
351
|
+
"description": "UUID of the model",
|
|
352
|
+
"format": "uuid",
|
|
353
|
+
"type": "string"
|
|
354
|
+
},
|
|
355
|
+
"version": {
|
|
356
|
+
"description": "{@link flowVersion } of the graph, computed on save",
|
|
357
|
+
"type": "string"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"required": [
|
|
361
|
+
"body",
|
|
362
|
+
"input",
|
|
363
|
+
"name",
|
|
364
|
+
"params",
|
|
365
|
+
"uuid",
|
|
366
|
+
"version"
|
|
367
|
+
],
|
|
368
|
+
"type": "object",
|
|
369
|
+
"$webda": "toDto$auto"
|
|
370
|
+
},
|
|
371
|
+
"Input": {
|
|
372
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
373
|
+
"WebdaModel": true,
|
|
374
|
+
"WebdaPlural": "Workflows",
|
|
375
|
+
"additionalProperties": false,
|
|
376
|
+
"definitions": {
|
|
377
|
+
"Record<string, any>": {
|
|
378
|
+
"additionalProperties": {},
|
|
379
|
+
"description": "Construct a type with a set of properties K of type T",
|
|
380
|
+
"type": "object"
|
|
381
|
+
},
|
|
382
|
+
"StoredWorkflowCron": {
|
|
383
|
+
"additionalProperties": false,
|
|
384
|
+
"description": "A cron launching a stored workflow",
|
|
385
|
+
"properties": {
|
|
386
|
+
"cron": {
|
|
387
|
+
"description": "Cron expression",
|
|
388
|
+
"type": "string"
|
|
389
|
+
},
|
|
390
|
+
"description": {
|
|
391
|
+
"description": "Description",
|
|
392
|
+
"type": "string"
|
|
393
|
+
},
|
|
394
|
+
"input": {
|
|
395
|
+
"$ref": "#/definitions/Record%3Cstring%2C%20any%3E",
|
|
396
|
+
"description": "Flow input, by parameter name"
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
"required": [
|
|
400
|
+
"cron"
|
|
401
|
+
],
|
|
402
|
+
"type": "object"
|
|
403
|
+
},
|
|
404
|
+
"TaskOptions": {
|
|
405
|
+
"additionalProperties": false,
|
|
406
|
+
"description": "Options of a task, and defaults of a flow",
|
|
407
|
+
"properties": {
|
|
408
|
+
"backoff": {
|
|
409
|
+
"default": "exponential",
|
|
410
|
+
"description": "Delay growth between attempts",
|
|
411
|
+
"enum": [
|
|
412
|
+
"fixed",
|
|
413
|
+
"exponential"
|
|
414
|
+
],
|
|
415
|
+
"type": "string"
|
|
416
|
+
},
|
|
417
|
+
"delay": {
|
|
418
|
+
"default": "1s",
|
|
419
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
420
|
+
"type": "string"
|
|
421
|
+
},
|
|
422
|
+
"retries": {
|
|
423
|
+
"default": 0,
|
|
424
|
+
"description": "Retries after the first attempt",
|
|
425
|
+
"type": "number"
|
|
426
|
+
},
|
|
427
|
+
"timeout": {
|
|
428
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
429
|
+
"type": "string"
|
|
430
|
+
},
|
|
431
|
+
"useSystem": {
|
|
432
|
+
"default": false,
|
|
433
|
+
"description": "Run the task as the system instead of the launcher",
|
|
434
|
+
"type": "boolean"
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"type": "object"
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"description": "A workflow defined at runtime: the same graph as a `.flow.ts` flow, stored as data\n\nSaving validates the graph (expressions, statement kinds, operations, `useSystem`); the WorkflowService registers\nit as the operation `name` and its crons, which run as the user who saved it last.",
|
|
441
|
+
"properties": {
|
|
442
|
+
"body": {
|
|
443
|
+
"description": "The statements ({@link Stmt }[])",
|
|
444
|
+
"items": {},
|
|
445
|
+
"type": "array"
|
|
446
|
+
},
|
|
447
|
+
"crons": {
|
|
448
|
+
"description": "Crons launching the flow",
|
|
449
|
+
"items": {
|
|
450
|
+
"$ref": "#/definitions/StoredWorkflowCron"
|
|
451
|
+
},
|
|
452
|
+
"type": "array"
|
|
453
|
+
},
|
|
454
|
+
"input": {
|
|
455
|
+
"description": "JSON schema of the input",
|
|
456
|
+
"type": "object"
|
|
457
|
+
},
|
|
458
|
+
"name": {
|
|
459
|
+
"description": "Flow id: the operation launching it",
|
|
460
|
+
"type": "string"
|
|
461
|
+
},
|
|
462
|
+
"options": {
|
|
463
|
+
"$ref": "#/definitions/TaskOptions",
|
|
464
|
+
"description": "Default options of every task"
|
|
465
|
+
},
|
|
466
|
+
"params": {
|
|
467
|
+
"description": "Names of the flow parameters, in order",
|
|
468
|
+
"items": {
|
|
469
|
+
"type": "string"
|
|
470
|
+
},
|
|
471
|
+
"type": "array"
|
|
472
|
+
},
|
|
473
|
+
"updatedBy": {
|
|
474
|
+
"description": "User id of the last save: the identity of its crons",
|
|
475
|
+
"type": "string"
|
|
476
|
+
},
|
|
477
|
+
"uuid": {
|
|
478
|
+
"description": "UUID of the model",
|
|
479
|
+
"format": "uuid",
|
|
480
|
+
"type": "string"
|
|
481
|
+
},
|
|
482
|
+
"version": {
|
|
483
|
+
"description": "{@link flowVersion } of the graph, computed on save",
|
|
484
|
+
"type": "string"
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"required": [
|
|
488
|
+
"body",
|
|
489
|
+
"input",
|
|
490
|
+
"name",
|
|
491
|
+
"params",
|
|
492
|
+
"uuid",
|
|
493
|
+
"version"
|
|
494
|
+
],
|
|
495
|
+
"type": "object",
|
|
496
|
+
"$webda": "fromDto$auto"
|
|
497
|
+
},
|
|
498
|
+
"Stored": {
|
|
499
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
500
|
+
"WebdaModel": true,
|
|
501
|
+
"WebdaPlural": "Workflows",
|
|
502
|
+
"additionalProperties": false,
|
|
503
|
+
"definitions": {
|
|
504
|
+
"Record<string, any>": {
|
|
505
|
+
"additionalProperties": {},
|
|
506
|
+
"description": "Construct a type with a set of properties K of type T",
|
|
507
|
+
"type": "object"
|
|
508
|
+
},
|
|
509
|
+
"StoredWorkflowCron": {
|
|
510
|
+
"additionalProperties": false,
|
|
511
|
+
"description": "A cron launching a stored workflow",
|
|
512
|
+
"properties": {
|
|
513
|
+
"cron": {
|
|
514
|
+
"description": "Cron expression",
|
|
515
|
+
"type": "string"
|
|
516
|
+
},
|
|
517
|
+
"description": {
|
|
518
|
+
"description": "Description",
|
|
519
|
+
"type": "string"
|
|
520
|
+
},
|
|
521
|
+
"input": {
|
|
522
|
+
"$ref": "#/definitions/Record%3Cstring%2C%20any%3E",
|
|
523
|
+
"description": "Flow input, by parameter name"
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
"required": [
|
|
527
|
+
"cron"
|
|
528
|
+
],
|
|
529
|
+
"type": "object"
|
|
530
|
+
},
|
|
531
|
+
"TaskOptions": {
|
|
532
|
+
"additionalProperties": false,
|
|
533
|
+
"description": "Options of a task, and defaults of a flow",
|
|
534
|
+
"properties": {
|
|
535
|
+
"backoff": {
|
|
536
|
+
"default": "exponential",
|
|
537
|
+
"description": "Delay growth between attempts",
|
|
538
|
+
"enum": [
|
|
539
|
+
"fixed",
|
|
540
|
+
"exponential"
|
|
541
|
+
],
|
|
542
|
+
"type": "string"
|
|
543
|
+
},
|
|
544
|
+
"delay": {
|
|
545
|
+
"default": "1s",
|
|
546
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
547
|
+
"type": "string"
|
|
548
|
+
},
|
|
549
|
+
"retries": {
|
|
550
|
+
"default": 0,
|
|
551
|
+
"description": "Retries after the first attempt",
|
|
552
|
+
"type": "number"
|
|
553
|
+
},
|
|
554
|
+
"timeout": {
|
|
555
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
556
|
+
"type": "string"
|
|
557
|
+
},
|
|
558
|
+
"useSystem": {
|
|
559
|
+
"default": false,
|
|
560
|
+
"description": "Run the task as the system instead of the launcher",
|
|
561
|
+
"type": "boolean"
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
"type": "object"
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
"description": "A workflow defined at runtime: the same graph as a `.flow.ts` flow, stored as data\n\nSaving validates the graph (expressions, statement kinds, operations, `useSystem`); the WorkflowService registers\nit as the operation `name` and its crons, which run as the user who saved it last.",
|
|
568
|
+
"properties": {
|
|
569
|
+
"body": {
|
|
570
|
+
"description": "The statements ({@link Stmt }[])",
|
|
571
|
+
"items": {},
|
|
572
|
+
"type": "array"
|
|
573
|
+
},
|
|
574
|
+
"crons": {
|
|
575
|
+
"description": "Crons launching the flow",
|
|
576
|
+
"items": {
|
|
577
|
+
"$ref": "#/definitions/StoredWorkflowCron"
|
|
578
|
+
},
|
|
579
|
+
"type": "array"
|
|
580
|
+
},
|
|
581
|
+
"input": {
|
|
582
|
+
"description": "JSON schema of the input",
|
|
583
|
+
"type": "object"
|
|
584
|
+
},
|
|
585
|
+
"name": {
|
|
586
|
+
"description": "Flow id: the operation launching it",
|
|
587
|
+
"type": "string"
|
|
588
|
+
},
|
|
589
|
+
"options": {
|
|
590
|
+
"$ref": "#/definitions/TaskOptions",
|
|
591
|
+
"description": "Default options of every task"
|
|
592
|
+
},
|
|
593
|
+
"params": {
|
|
594
|
+
"description": "Names of the flow parameters, in order",
|
|
595
|
+
"items": {
|
|
596
|
+
"type": "string"
|
|
597
|
+
},
|
|
598
|
+
"type": "array"
|
|
599
|
+
},
|
|
600
|
+
"updatedBy": {
|
|
601
|
+
"description": "User id of the last save: the identity of its crons",
|
|
602
|
+
"type": "string"
|
|
603
|
+
},
|
|
604
|
+
"uuid": {
|
|
605
|
+
"description": "UUID of the model",
|
|
606
|
+
"format": "uuid",
|
|
607
|
+
"type": "string"
|
|
608
|
+
},
|
|
609
|
+
"version": {
|
|
610
|
+
"description": "{@link flowVersion } of the graph, computed on save",
|
|
611
|
+
"type": "string"
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
"required": [
|
|
615
|
+
"body",
|
|
616
|
+
"input",
|
|
617
|
+
"name",
|
|
618
|
+
"params",
|
|
619
|
+
"uuid",
|
|
620
|
+
"version"
|
|
621
|
+
],
|
|
622
|
+
"type": "object",
|
|
623
|
+
"$webda": "toJSON$return"
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
"Actions": {},
|
|
627
|
+
"Events": [
|
|
628
|
+
"Create",
|
|
629
|
+
"PartialUpdate",
|
|
630
|
+
"Delete",
|
|
631
|
+
"Update",
|
|
632
|
+
"Patch",
|
|
633
|
+
"Query",
|
|
634
|
+
"Aggregate",
|
|
635
|
+
"Created",
|
|
636
|
+
"PartialUpdated",
|
|
637
|
+
"Deleted",
|
|
638
|
+
"Patched",
|
|
639
|
+
"Updated",
|
|
640
|
+
"Queried",
|
|
641
|
+
"Aggregated"
|
|
642
|
+
],
|
|
643
|
+
"PrimaryKey": [
|
|
644
|
+
"uuid"
|
|
645
|
+
],
|
|
646
|
+
"Identifier": "Webda/Workflow"
|
|
647
|
+
},
|
|
648
|
+
"Webda/WorkflowInstance": {
|
|
649
|
+
"Plural": "WorkflowInstances",
|
|
650
|
+
"Import": "lib/models/workflowinstance.model:default",
|
|
651
|
+
"Relations": {},
|
|
652
|
+
"Ancestors": [],
|
|
653
|
+
"Subclasses": [],
|
|
654
|
+
"Reflection": {
|
|
655
|
+
"flowId": {
|
|
656
|
+
"type": "string"
|
|
657
|
+
},
|
|
658
|
+
"version": {
|
|
659
|
+
"type": "string"
|
|
660
|
+
},
|
|
661
|
+
"definition": {
|
|
662
|
+
"type": "FlowDefinitionData"
|
|
663
|
+
},
|
|
664
|
+
"input": {
|
|
665
|
+
"type": "Record",
|
|
666
|
+
"typeParameters": [
|
|
667
|
+
"string",
|
|
668
|
+
"any"
|
|
669
|
+
]
|
|
670
|
+
},
|
|
671
|
+
"journal": {
|
|
672
|
+
"type": "Journal"
|
|
673
|
+
},
|
|
674
|
+
"status": {
|
|
675
|
+
"type": "WorkflowInstanceStatus"
|
|
676
|
+
},
|
|
677
|
+
"launcher": {
|
|
678
|
+
"type": "WorkflowLauncher"
|
|
679
|
+
},
|
|
680
|
+
"output": {
|
|
681
|
+
"type": "any"
|
|
682
|
+
},
|
|
683
|
+
"error": {
|
|
684
|
+
"type": "FlowError"
|
|
685
|
+
},
|
|
686
|
+
"revision": {
|
|
687
|
+
"type": "number"
|
|
688
|
+
},
|
|
689
|
+
"parent": {
|
|
690
|
+
"type": "{ instance: string; key: string }"
|
|
691
|
+
},
|
|
692
|
+
"createdAt": {
|
|
693
|
+
"type": "number"
|
|
694
|
+
},
|
|
695
|
+
"updatedAt": {
|
|
696
|
+
"type": "number"
|
|
697
|
+
},
|
|
698
|
+
"uuid": {
|
|
699
|
+
"type": "string"
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
"Schemas": {
|
|
703
|
+
"Output": {
|
|
704
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
705
|
+
"WebdaModel": true,
|
|
706
|
+
"WebdaPlural": "WorkflowInstances",
|
|
707
|
+
"additionalProperties": false,
|
|
708
|
+
"definitions": {
|
|
709
|
+
"FlowDefinitionData": {
|
|
710
|
+
"additionalProperties": false,
|
|
711
|
+
"description": "A {@link FlowDefinition} as models and configuration hold it\n\nThe statements are recursive: describing them in a JSON schema makes the schema generator explode, so they are\nplain JSON there. {@link validateExpr } checks untrusted expressions.",
|
|
712
|
+
"properties": {
|
|
713
|
+
"body": {
|
|
714
|
+
"description": "The statements ({@link Stmt}[])",
|
|
715
|
+
"items": {},
|
|
716
|
+
"type": "array"
|
|
717
|
+
},
|
|
718
|
+
"id": {
|
|
719
|
+
"description": "Operation id `<Class>.<Method>`",
|
|
720
|
+
"type": "string"
|
|
721
|
+
},
|
|
722
|
+
"input": {
|
|
723
|
+
"description": "JSON schema of the input",
|
|
724
|
+
"type": "object"
|
|
725
|
+
},
|
|
726
|
+
"options": {
|
|
727
|
+
"$ref": "#/definitions/TaskOptions",
|
|
728
|
+
"description": "Default options of every task"
|
|
729
|
+
},
|
|
730
|
+
"output": {
|
|
731
|
+
"description": "JSON schema of the output",
|
|
732
|
+
"type": "object"
|
|
733
|
+
},
|
|
734
|
+
"params": {
|
|
735
|
+
"description": "Names of the flow parameters, in order",
|
|
736
|
+
"items": {
|
|
737
|
+
"type": "string"
|
|
738
|
+
},
|
|
739
|
+
"type": "array"
|
|
740
|
+
},
|
|
741
|
+
"source": {
|
|
742
|
+
"default": "code",
|
|
743
|
+
"description": "Where the flow comes from",
|
|
744
|
+
"enum": [
|
|
745
|
+
"code",
|
|
746
|
+
"stored"
|
|
747
|
+
],
|
|
748
|
+
"type": "string"
|
|
749
|
+
},
|
|
750
|
+
"version": {
|
|
751
|
+
"description": "{@link flowVersion} of the definition, computed when missing",
|
|
752
|
+
"type": "string"
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
"required": [
|
|
756
|
+
"body",
|
|
757
|
+
"id",
|
|
758
|
+
"input",
|
|
759
|
+
"params"
|
|
760
|
+
],
|
|
761
|
+
"type": "object"
|
|
762
|
+
},
|
|
763
|
+
"FlowError": {
|
|
764
|
+
"additionalProperties": false,
|
|
765
|
+
"description": "An error, as seen by the flow: plain data",
|
|
766
|
+
"properties": {
|
|
767
|
+
"code": {
|
|
768
|
+
"type": "string"
|
|
769
|
+
},
|
|
770
|
+
"message": {
|
|
771
|
+
"type": "string"
|
|
772
|
+
},
|
|
773
|
+
"operation": {
|
|
774
|
+
"type": "string"
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
"required": [
|
|
778
|
+
"code",
|
|
779
|
+
"message",
|
|
780
|
+
"operation"
|
|
781
|
+
],
|
|
782
|
+
"type": "object"
|
|
783
|
+
},
|
|
784
|
+
"Journal": {
|
|
785
|
+
"additionalProperties": {
|
|
786
|
+
"anyOf": [
|
|
787
|
+
{
|
|
788
|
+
"additionalProperties": false,
|
|
789
|
+
"properties": {
|
|
790
|
+
"at": {
|
|
791
|
+
"description": "When the outcome was journaled (ms)",
|
|
792
|
+
"type": "number"
|
|
793
|
+
},
|
|
794
|
+
"result": {},
|
|
795
|
+
"seq": {
|
|
796
|
+
"description": "Instance revision that journaled it: the order of the outcomes",
|
|
797
|
+
"type": "number"
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
"required": [
|
|
801
|
+
"result"
|
|
802
|
+
],
|
|
803
|
+
"type": "object"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"additionalProperties": false,
|
|
807
|
+
"properties": {
|
|
808
|
+
"at": {
|
|
809
|
+
"description": "When the outcome was journaled (ms)",
|
|
810
|
+
"type": "number"
|
|
811
|
+
},
|
|
812
|
+
"error": {
|
|
813
|
+
"$ref": "#/definitions/FlowError"
|
|
814
|
+
},
|
|
815
|
+
"seq": {
|
|
816
|
+
"description": "Instance revision that journaled it: the order of the outcomes",
|
|
817
|
+
"type": "number"
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
"required": [
|
|
821
|
+
"error"
|
|
822
|
+
],
|
|
823
|
+
"type": "object"
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
"description": "Outcome of a task"
|
|
827
|
+
},
|
|
828
|
+
"description": "Outcome of each finished task, keyed by task key (`<statement id>@<iteration path>`)",
|
|
829
|
+
"type": "object"
|
|
830
|
+
},
|
|
831
|
+
"Record<string, any>": {
|
|
832
|
+
"additionalProperties": {},
|
|
833
|
+
"description": "Construct a type with a set of properties K of type T",
|
|
834
|
+
"type": "object"
|
|
835
|
+
},
|
|
836
|
+
"TaskOptions": {
|
|
837
|
+
"additionalProperties": false,
|
|
838
|
+
"description": "Options of a task, and defaults of a flow",
|
|
839
|
+
"properties": {
|
|
840
|
+
"backoff": {
|
|
841
|
+
"default": "exponential",
|
|
842
|
+
"description": "Delay growth between attempts",
|
|
843
|
+
"enum": [
|
|
844
|
+
"fixed",
|
|
845
|
+
"exponential"
|
|
846
|
+
],
|
|
847
|
+
"type": "string"
|
|
848
|
+
},
|
|
849
|
+
"delay": {
|
|
850
|
+
"default": "1s",
|
|
851
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
852
|
+
"type": "string"
|
|
853
|
+
},
|
|
854
|
+
"retries": {
|
|
855
|
+
"default": 0,
|
|
856
|
+
"description": "Retries after the first attempt",
|
|
857
|
+
"type": "number"
|
|
858
|
+
},
|
|
859
|
+
"timeout": {
|
|
860
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
861
|
+
"type": "string"
|
|
862
|
+
},
|
|
863
|
+
"useSystem": {
|
|
864
|
+
"default": false,
|
|
865
|
+
"description": "Run the task as the system instead of the launcher",
|
|
866
|
+
"type": "boolean"
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
"type": "object"
|
|
870
|
+
},
|
|
871
|
+
"WorkflowLauncher": {
|
|
872
|
+
"additionalProperties": false,
|
|
873
|
+
"description": "Who launched a workflow: the steps run as this identity",
|
|
874
|
+
"properties": {
|
|
875
|
+
"clientId": {
|
|
876
|
+
"description": "OAuth client id of the launcher session, when applicable",
|
|
877
|
+
"type": "string"
|
|
878
|
+
},
|
|
879
|
+
"identId": {
|
|
880
|
+
"description": "Ident used by the launcher to log in",
|
|
881
|
+
"type": "string"
|
|
882
|
+
},
|
|
883
|
+
"mfa": {
|
|
884
|
+
"description": "MFA state of the launcher session",
|
|
885
|
+
"enum": [
|
|
886
|
+
"none",
|
|
887
|
+
"pending",
|
|
888
|
+
"verified"
|
|
889
|
+
],
|
|
890
|
+
"type": "string"
|
|
891
|
+
},
|
|
892
|
+
"mfaAt": {
|
|
893
|
+
"description": "MFA verification timestamp of the launcher session",
|
|
894
|
+
"type": "number"
|
|
895
|
+
},
|
|
896
|
+
"scopes": {
|
|
897
|
+
"description": "Granted scopes of the launcher session, when restricted",
|
|
898
|
+
"items": {
|
|
899
|
+
"type": "string"
|
|
900
|
+
},
|
|
901
|
+
"type": "array"
|
|
902
|
+
},
|
|
903
|
+
"system": {
|
|
904
|
+
"default": false,
|
|
905
|
+
"description": "Launched by the system",
|
|
906
|
+
"type": "boolean"
|
|
907
|
+
},
|
|
908
|
+
"userId": {
|
|
909
|
+
"description": "User id of the launcher",
|
|
910
|
+
"type": "string"
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
"type": "object"
|
|
914
|
+
},
|
|
915
|
+
"parent#2": {
|
|
916
|
+
"additionalProperties": false,
|
|
917
|
+
"description": "Parent instance and task key of a child flow",
|
|
918
|
+
"properties": {
|
|
919
|
+
"instance": {
|
|
920
|
+
"type": "string"
|
|
921
|
+
},
|
|
922
|
+
"key": {
|
|
923
|
+
"type": "string"
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
"required": [
|
|
927
|
+
"instance",
|
|
928
|
+
"key"
|
|
929
|
+
],
|
|
930
|
+
"type": "object"
|
|
931
|
+
}
|
|
932
|
+
},
|
|
933
|
+
"description": "A running (or finished) flow: its pinned definition, input and journal of task outcomes",
|
|
934
|
+
"properties": {
|
|
935
|
+
"createdAt": {
|
|
936
|
+
"description": "Creation time (ms)",
|
|
937
|
+
"type": "number"
|
|
938
|
+
},
|
|
939
|
+
"definition": {
|
|
940
|
+
"$ref": "#/definitions/FlowDefinitionData",
|
|
941
|
+
"description": "The definition the instance runs, pinned at launch"
|
|
942
|
+
},
|
|
943
|
+
"error": {
|
|
944
|
+
"$ref": "#/definitions/FlowError",
|
|
945
|
+
"description": "Uncaught error, once ERROR"
|
|
946
|
+
},
|
|
947
|
+
"flowId": {
|
|
948
|
+
"description": "Flow id: the operation id launching the flow",
|
|
949
|
+
"type": "string"
|
|
950
|
+
},
|
|
951
|
+
"input": {
|
|
952
|
+
"$ref": "#/definitions/Record%3Cstring%2C%20any%3E",
|
|
953
|
+
"description": "Flow input, by parameter name"
|
|
954
|
+
},
|
|
955
|
+
"journal": {
|
|
956
|
+
"$ref": "#/definitions/Journal",
|
|
957
|
+
"description": "Outcomes of the finished tasks, by task key"
|
|
958
|
+
},
|
|
959
|
+
"launcher": {
|
|
960
|
+
"$ref": "#/definitions/WorkflowLauncher",
|
|
961
|
+
"description": "Identity the steps run as"
|
|
962
|
+
},
|
|
963
|
+
"output": {
|
|
964
|
+
"description": "Flow output, once SUCCESS"
|
|
965
|
+
},
|
|
966
|
+
"parent": {
|
|
967
|
+
"$ref": "#/definitions/parent%232",
|
|
968
|
+
"description": "Parent instance and task key of a child flow"
|
|
969
|
+
},
|
|
970
|
+
"revision": {
|
|
971
|
+
"description": "Revision of the instance, incremented by every write (compare-and-set)",
|
|
972
|
+
"type": "number"
|
|
973
|
+
},
|
|
974
|
+
"status": {
|
|
975
|
+
"description": "Current status",
|
|
976
|
+
"enum": [
|
|
977
|
+
"RUNNING",
|
|
978
|
+
"WAITING",
|
|
979
|
+
"SUCCESS",
|
|
980
|
+
"ERROR",
|
|
981
|
+
"CANCELLED"
|
|
982
|
+
],
|
|
983
|
+
"type": "string"
|
|
984
|
+
},
|
|
985
|
+
"updatedAt": {
|
|
986
|
+
"description": "Last update time (ms)",
|
|
987
|
+
"type": "number"
|
|
988
|
+
},
|
|
989
|
+
"uuid": {
|
|
990
|
+
"description": "UUID of the model",
|
|
991
|
+
"format": "uuid",
|
|
992
|
+
"type": "string"
|
|
993
|
+
},
|
|
994
|
+
"version": {
|
|
995
|
+
"description": "Version of the pinned definition",
|
|
996
|
+
"type": "string"
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
"required": [
|
|
1000
|
+
"createdAt",
|
|
1001
|
+
"definition",
|
|
1002
|
+
"flowId",
|
|
1003
|
+
"input",
|
|
1004
|
+
"journal",
|
|
1005
|
+
"launcher",
|
|
1006
|
+
"revision",
|
|
1007
|
+
"status",
|
|
1008
|
+
"updatedAt",
|
|
1009
|
+
"uuid",
|
|
1010
|
+
"version"
|
|
1011
|
+
],
|
|
1012
|
+
"type": "object",
|
|
1013
|
+
"$webda": "toDto$auto"
|
|
1014
|
+
},
|
|
1015
|
+
"Input": {
|
|
1016
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1017
|
+
"WebdaModel": true,
|
|
1018
|
+
"WebdaPlural": "WorkflowInstances",
|
|
1019
|
+
"additionalProperties": false,
|
|
1020
|
+
"definitions": {
|
|
1021
|
+
"FlowDefinitionData": {
|
|
1022
|
+
"additionalProperties": false,
|
|
1023
|
+
"description": "A {@link FlowDefinition} as models and configuration hold it\n\nThe statements are recursive: describing them in a JSON schema makes the schema generator explode, so they are\nplain JSON there. {@link validateExpr } checks untrusted expressions.",
|
|
1024
|
+
"properties": {
|
|
1025
|
+
"body": {
|
|
1026
|
+
"description": "The statements ({@link Stmt}[])",
|
|
1027
|
+
"items": {},
|
|
1028
|
+
"type": "array"
|
|
1029
|
+
},
|
|
1030
|
+
"id": {
|
|
1031
|
+
"description": "Operation id `<Class>.<Method>`",
|
|
1032
|
+
"type": "string"
|
|
1033
|
+
},
|
|
1034
|
+
"input": {
|
|
1035
|
+
"description": "JSON schema of the input",
|
|
1036
|
+
"type": "object"
|
|
1037
|
+
},
|
|
1038
|
+
"options": {
|
|
1039
|
+
"$ref": "#/definitions/TaskOptions",
|
|
1040
|
+
"description": "Default options of every task"
|
|
1041
|
+
},
|
|
1042
|
+
"output": {
|
|
1043
|
+
"description": "JSON schema of the output",
|
|
1044
|
+
"type": "object"
|
|
1045
|
+
},
|
|
1046
|
+
"params": {
|
|
1047
|
+
"description": "Names of the flow parameters, in order",
|
|
1048
|
+
"items": {
|
|
1049
|
+
"type": "string"
|
|
1050
|
+
},
|
|
1051
|
+
"type": "array"
|
|
1052
|
+
},
|
|
1053
|
+
"source": {
|
|
1054
|
+
"default": "code",
|
|
1055
|
+
"description": "Where the flow comes from",
|
|
1056
|
+
"enum": [
|
|
1057
|
+
"code",
|
|
1058
|
+
"stored"
|
|
1059
|
+
],
|
|
1060
|
+
"type": "string"
|
|
1061
|
+
},
|
|
1062
|
+
"version": {
|
|
1063
|
+
"description": "{@link flowVersion} of the definition, computed when missing",
|
|
1064
|
+
"type": "string"
|
|
1065
|
+
}
|
|
1066
|
+
},
|
|
1067
|
+
"required": [
|
|
1068
|
+
"body",
|
|
1069
|
+
"id",
|
|
1070
|
+
"input",
|
|
1071
|
+
"params"
|
|
1072
|
+
],
|
|
1073
|
+
"type": "object"
|
|
1074
|
+
},
|
|
1075
|
+
"FlowError": {
|
|
1076
|
+
"additionalProperties": false,
|
|
1077
|
+
"description": "An error, as seen by the flow: plain data",
|
|
1078
|
+
"properties": {
|
|
1079
|
+
"code": {
|
|
1080
|
+
"type": "string"
|
|
1081
|
+
},
|
|
1082
|
+
"message": {
|
|
1083
|
+
"type": "string"
|
|
1084
|
+
},
|
|
1085
|
+
"operation": {
|
|
1086
|
+
"type": "string"
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
"required": [
|
|
1090
|
+
"code",
|
|
1091
|
+
"message",
|
|
1092
|
+
"operation"
|
|
1093
|
+
],
|
|
1094
|
+
"type": "object"
|
|
1095
|
+
},
|
|
1096
|
+
"Journal": {
|
|
1097
|
+
"additionalProperties": {
|
|
1098
|
+
"anyOf": [
|
|
1099
|
+
{
|
|
1100
|
+
"additionalProperties": false,
|
|
1101
|
+
"properties": {
|
|
1102
|
+
"at": {
|
|
1103
|
+
"description": "When the outcome was journaled (ms)",
|
|
1104
|
+
"type": "number"
|
|
1105
|
+
},
|
|
1106
|
+
"result": {},
|
|
1107
|
+
"seq": {
|
|
1108
|
+
"description": "Instance revision that journaled it: the order of the outcomes",
|
|
1109
|
+
"type": "number"
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
"required": [
|
|
1113
|
+
"result"
|
|
1114
|
+
],
|
|
1115
|
+
"type": "object"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
"additionalProperties": false,
|
|
1119
|
+
"properties": {
|
|
1120
|
+
"at": {
|
|
1121
|
+
"description": "When the outcome was journaled (ms)",
|
|
1122
|
+
"type": "number"
|
|
1123
|
+
},
|
|
1124
|
+
"error": {
|
|
1125
|
+
"$ref": "#/definitions/FlowError"
|
|
1126
|
+
},
|
|
1127
|
+
"seq": {
|
|
1128
|
+
"description": "Instance revision that journaled it: the order of the outcomes",
|
|
1129
|
+
"type": "number"
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
"required": [
|
|
1133
|
+
"error"
|
|
1134
|
+
],
|
|
1135
|
+
"type": "object"
|
|
1136
|
+
}
|
|
1137
|
+
],
|
|
1138
|
+
"description": "Outcome of a task"
|
|
1139
|
+
},
|
|
1140
|
+
"description": "Outcome of each finished task, keyed by task key (`<statement id>@<iteration path>`)",
|
|
1141
|
+
"type": "object"
|
|
1142
|
+
},
|
|
1143
|
+
"Record<string, any>": {
|
|
1144
|
+
"additionalProperties": {},
|
|
1145
|
+
"description": "Construct a type with a set of properties K of type T",
|
|
1146
|
+
"type": "object"
|
|
1147
|
+
},
|
|
1148
|
+
"TaskOptions": {
|
|
1149
|
+
"additionalProperties": false,
|
|
1150
|
+
"description": "Options of a task, and defaults of a flow",
|
|
1151
|
+
"properties": {
|
|
1152
|
+
"backoff": {
|
|
1153
|
+
"default": "exponential",
|
|
1154
|
+
"description": "Delay growth between attempts",
|
|
1155
|
+
"enum": [
|
|
1156
|
+
"fixed",
|
|
1157
|
+
"exponential"
|
|
1158
|
+
],
|
|
1159
|
+
"type": "string"
|
|
1160
|
+
},
|
|
1161
|
+
"delay": {
|
|
1162
|
+
"default": "1s",
|
|
1163
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
1164
|
+
"type": "string"
|
|
1165
|
+
},
|
|
1166
|
+
"retries": {
|
|
1167
|
+
"default": 0,
|
|
1168
|
+
"description": "Retries after the first attempt",
|
|
1169
|
+
"type": "number"
|
|
1170
|
+
},
|
|
1171
|
+
"timeout": {
|
|
1172
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
1173
|
+
"type": "string"
|
|
1174
|
+
},
|
|
1175
|
+
"useSystem": {
|
|
1176
|
+
"default": false,
|
|
1177
|
+
"description": "Run the task as the system instead of the launcher",
|
|
1178
|
+
"type": "boolean"
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
"type": "object"
|
|
1182
|
+
},
|
|
1183
|
+
"WorkflowLauncher": {
|
|
1184
|
+
"additionalProperties": false,
|
|
1185
|
+
"description": "Who launched a workflow: the steps run as this identity",
|
|
1186
|
+
"properties": {
|
|
1187
|
+
"clientId": {
|
|
1188
|
+
"description": "OAuth client id of the launcher session, when applicable",
|
|
1189
|
+
"type": "string"
|
|
1190
|
+
},
|
|
1191
|
+
"identId": {
|
|
1192
|
+
"description": "Ident used by the launcher to log in",
|
|
1193
|
+
"type": "string"
|
|
1194
|
+
},
|
|
1195
|
+
"mfa": {
|
|
1196
|
+
"description": "MFA state of the launcher session",
|
|
1197
|
+
"enum": [
|
|
1198
|
+
"none",
|
|
1199
|
+
"pending",
|
|
1200
|
+
"verified"
|
|
1201
|
+
],
|
|
1202
|
+
"type": "string"
|
|
1203
|
+
},
|
|
1204
|
+
"mfaAt": {
|
|
1205
|
+
"description": "MFA verification timestamp of the launcher session",
|
|
1206
|
+
"type": "number"
|
|
1207
|
+
},
|
|
1208
|
+
"scopes": {
|
|
1209
|
+
"description": "Granted scopes of the launcher session, when restricted",
|
|
1210
|
+
"items": {
|
|
1211
|
+
"type": "string"
|
|
1212
|
+
},
|
|
1213
|
+
"type": "array"
|
|
1214
|
+
},
|
|
1215
|
+
"system": {
|
|
1216
|
+
"default": false,
|
|
1217
|
+
"description": "Launched by the system",
|
|
1218
|
+
"type": "boolean"
|
|
1219
|
+
},
|
|
1220
|
+
"userId": {
|
|
1221
|
+
"description": "User id of the launcher",
|
|
1222
|
+
"type": "string"
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
"type": "object"
|
|
1226
|
+
},
|
|
1227
|
+
"parent#2": {
|
|
1228
|
+
"additionalProperties": false,
|
|
1229
|
+
"description": "Parent instance and task key of a child flow",
|
|
1230
|
+
"properties": {
|
|
1231
|
+
"instance": {
|
|
1232
|
+
"type": "string"
|
|
1233
|
+
},
|
|
1234
|
+
"key": {
|
|
1235
|
+
"type": "string"
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
"required": [
|
|
1239
|
+
"instance",
|
|
1240
|
+
"key"
|
|
1241
|
+
],
|
|
1242
|
+
"type": "object"
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
"description": "A running (or finished) flow: its pinned definition, input and journal of task outcomes",
|
|
1246
|
+
"properties": {
|
|
1247
|
+
"createdAt": {
|
|
1248
|
+
"description": "Creation time (ms)",
|
|
1249
|
+
"type": "number"
|
|
1250
|
+
},
|
|
1251
|
+
"definition": {
|
|
1252
|
+
"$ref": "#/definitions/FlowDefinitionData",
|
|
1253
|
+
"description": "The definition the instance runs, pinned at launch"
|
|
1254
|
+
},
|
|
1255
|
+
"error": {
|
|
1256
|
+
"$ref": "#/definitions/FlowError",
|
|
1257
|
+
"description": "Uncaught error, once ERROR"
|
|
1258
|
+
},
|
|
1259
|
+
"flowId": {
|
|
1260
|
+
"description": "Flow id: the operation id launching the flow",
|
|
1261
|
+
"type": "string"
|
|
1262
|
+
},
|
|
1263
|
+
"input": {
|
|
1264
|
+
"$ref": "#/definitions/Record%3Cstring%2C%20any%3E",
|
|
1265
|
+
"description": "Flow input, by parameter name"
|
|
1266
|
+
},
|
|
1267
|
+
"journal": {
|
|
1268
|
+
"$ref": "#/definitions/Journal",
|
|
1269
|
+
"description": "Outcomes of the finished tasks, by task key"
|
|
1270
|
+
},
|
|
1271
|
+
"launcher": {
|
|
1272
|
+
"$ref": "#/definitions/WorkflowLauncher",
|
|
1273
|
+
"description": "Identity the steps run as"
|
|
1274
|
+
},
|
|
1275
|
+
"output": {
|
|
1276
|
+
"description": "Flow output, once SUCCESS"
|
|
1277
|
+
},
|
|
1278
|
+
"parent": {
|
|
1279
|
+
"$ref": "#/definitions/parent%232",
|
|
1280
|
+
"description": "Parent instance and task key of a child flow"
|
|
1281
|
+
},
|
|
1282
|
+
"revision": {
|
|
1283
|
+
"description": "Revision of the instance, incremented by every write (compare-and-set)",
|
|
1284
|
+
"type": "number"
|
|
1285
|
+
},
|
|
1286
|
+
"status": {
|
|
1287
|
+
"description": "Current status",
|
|
1288
|
+
"enum": [
|
|
1289
|
+
"RUNNING",
|
|
1290
|
+
"WAITING",
|
|
1291
|
+
"SUCCESS",
|
|
1292
|
+
"ERROR",
|
|
1293
|
+
"CANCELLED"
|
|
1294
|
+
],
|
|
1295
|
+
"type": "string"
|
|
1296
|
+
},
|
|
1297
|
+
"updatedAt": {
|
|
1298
|
+
"description": "Last update time (ms)",
|
|
1299
|
+
"type": "number"
|
|
1300
|
+
},
|
|
1301
|
+
"uuid": {
|
|
1302
|
+
"description": "UUID of the model",
|
|
1303
|
+
"format": "uuid",
|
|
1304
|
+
"type": "string"
|
|
1305
|
+
},
|
|
1306
|
+
"version": {
|
|
1307
|
+
"description": "Version of the pinned definition",
|
|
1308
|
+
"type": "string"
|
|
1309
|
+
}
|
|
1310
|
+
},
|
|
1311
|
+
"required": [
|
|
1312
|
+
"createdAt",
|
|
1313
|
+
"definition",
|
|
1314
|
+
"flowId",
|
|
1315
|
+
"input",
|
|
1316
|
+
"journal",
|
|
1317
|
+
"launcher",
|
|
1318
|
+
"revision",
|
|
1319
|
+
"status",
|
|
1320
|
+
"updatedAt",
|
|
1321
|
+
"uuid",
|
|
1322
|
+
"version"
|
|
1323
|
+
],
|
|
1324
|
+
"type": "object",
|
|
1325
|
+
"$webda": "fromDto$auto"
|
|
1326
|
+
},
|
|
1327
|
+
"Stored": {
|
|
1328
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1329
|
+
"WebdaModel": true,
|
|
1330
|
+
"WebdaPlural": "WorkflowInstances",
|
|
1331
|
+
"additionalProperties": false,
|
|
1332
|
+
"definitions": {
|
|
1333
|
+
"FlowDefinitionData": {
|
|
1334
|
+
"additionalProperties": false,
|
|
1335
|
+
"description": "A {@link FlowDefinition} as models and configuration hold it\n\nThe statements are recursive: describing them in a JSON schema makes the schema generator explode, so they are\nplain JSON there. {@link validateExpr } checks untrusted expressions.",
|
|
1336
|
+
"properties": {
|
|
1337
|
+
"body": {
|
|
1338
|
+
"description": "The statements ({@link Stmt}[])",
|
|
1339
|
+
"items": {},
|
|
1340
|
+
"type": "array"
|
|
1341
|
+
},
|
|
1342
|
+
"id": {
|
|
1343
|
+
"description": "Operation id `<Class>.<Method>`",
|
|
1344
|
+
"type": "string"
|
|
1345
|
+
},
|
|
1346
|
+
"input": {
|
|
1347
|
+
"description": "JSON schema of the input",
|
|
1348
|
+
"type": "object"
|
|
1349
|
+
},
|
|
1350
|
+
"options": {
|
|
1351
|
+
"$ref": "#/definitions/TaskOptions",
|
|
1352
|
+
"description": "Default options of every task"
|
|
1353
|
+
},
|
|
1354
|
+
"output": {
|
|
1355
|
+
"description": "JSON schema of the output",
|
|
1356
|
+
"type": "object"
|
|
1357
|
+
},
|
|
1358
|
+
"params": {
|
|
1359
|
+
"description": "Names of the flow parameters, in order",
|
|
1360
|
+
"items": {
|
|
1361
|
+
"type": "string"
|
|
1362
|
+
},
|
|
1363
|
+
"type": "array"
|
|
1364
|
+
},
|
|
1365
|
+
"source": {
|
|
1366
|
+
"default": "code",
|
|
1367
|
+
"description": "Where the flow comes from",
|
|
1368
|
+
"enum": [
|
|
1369
|
+
"code",
|
|
1370
|
+
"stored"
|
|
1371
|
+
],
|
|
1372
|
+
"type": "string"
|
|
1373
|
+
},
|
|
1374
|
+
"version": {
|
|
1375
|
+
"description": "{@link flowVersion} of the definition, computed when missing",
|
|
1376
|
+
"type": "string"
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
"required": [
|
|
1380
|
+
"body",
|
|
1381
|
+
"id",
|
|
1382
|
+
"input",
|
|
1383
|
+
"params"
|
|
1384
|
+
],
|
|
1385
|
+
"type": "object"
|
|
1386
|
+
},
|
|
1387
|
+
"FlowError": {
|
|
1388
|
+
"additionalProperties": false,
|
|
1389
|
+
"description": "An error, as seen by the flow: plain data",
|
|
1390
|
+
"properties": {
|
|
1391
|
+
"code": {
|
|
1392
|
+
"type": "string"
|
|
1393
|
+
},
|
|
1394
|
+
"message": {
|
|
1395
|
+
"type": "string"
|
|
1396
|
+
},
|
|
1397
|
+
"operation": {
|
|
1398
|
+
"type": "string"
|
|
1399
|
+
}
|
|
1400
|
+
},
|
|
1401
|
+
"required": [
|
|
1402
|
+
"code",
|
|
1403
|
+
"message",
|
|
1404
|
+
"operation"
|
|
1405
|
+
],
|
|
1406
|
+
"type": "object"
|
|
1407
|
+
},
|
|
1408
|
+
"Journal": {
|
|
1409
|
+
"additionalProperties": {
|
|
1410
|
+
"anyOf": [
|
|
1411
|
+
{
|
|
1412
|
+
"additionalProperties": false,
|
|
1413
|
+
"properties": {
|
|
1414
|
+
"at": {
|
|
1415
|
+
"description": "When the outcome was journaled (ms)",
|
|
1416
|
+
"type": "number"
|
|
1417
|
+
},
|
|
1418
|
+
"result": {},
|
|
1419
|
+
"seq": {
|
|
1420
|
+
"description": "Instance revision that journaled it: the order of the outcomes",
|
|
1421
|
+
"type": "number"
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
"required": [
|
|
1425
|
+
"result"
|
|
1426
|
+
],
|
|
1427
|
+
"type": "object"
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
"additionalProperties": false,
|
|
1431
|
+
"properties": {
|
|
1432
|
+
"at": {
|
|
1433
|
+
"description": "When the outcome was journaled (ms)",
|
|
1434
|
+
"type": "number"
|
|
1435
|
+
},
|
|
1436
|
+
"error": {
|
|
1437
|
+
"$ref": "#/definitions/FlowError"
|
|
1438
|
+
},
|
|
1439
|
+
"seq": {
|
|
1440
|
+
"description": "Instance revision that journaled it: the order of the outcomes",
|
|
1441
|
+
"type": "number"
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
"required": [
|
|
1445
|
+
"error"
|
|
1446
|
+
],
|
|
1447
|
+
"type": "object"
|
|
1448
|
+
}
|
|
1449
|
+
],
|
|
1450
|
+
"description": "Outcome of a task"
|
|
1451
|
+
},
|
|
1452
|
+
"description": "Outcome of each finished task, keyed by task key (`<statement id>@<iteration path>`)",
|
|
1453
|
+
"type": "object"
|
|
1454
|
+
},
|
|
1455
|
+
"Record<string, any>": {
|
|
1456
|
+
"additionalProperties": {},
|
|
1457
|
+
"description": "Construct a type with a set of properties K of type T",
|
|
1458
|
+
"type": "object"
|
|
1459
|
+
},
|
|
1460
|
+
"TaskOptions": {
|
|
1461
|
+
"additionalProperties": false,
|
|
1462
|
+
"description": "Options of a task, and defaults of a flow",
|
|
1463
|
+
"properties": {
|
|
1464
|
+
"backoff": {
|
|
1465
|
+
"default": "exponential",
|
|
1466
|
+
"description": "Delay growth between attempts",
|
|
1467
|
+
"enum": [
|
|
1468
|
+
"fixed",
|
|
1469
|
+
"exponential"
|
|
1470
|
+
],
|
|
1471
|
+
"type": "string"
|
|
1472
|
+
},
|
|
1473
|
+
"delay": {
|
|
1474
|
+
"default": "1s",
|
|
1475
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
1476
|
+
"type": "string"
|
|
1477
|
+
},
|
|
1478
|
+
"retries": {
|
|
1479
|
+
"default": 0,
|
|
1480
|
+
"description": "Retries after the first attempt",
|
|
1481
|
+
"type": "number"
|
|
1482
|
+
},
|
|
1483
|
+
"timeout": {
|
|
1484
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
1485
|
+
"type": "string"
|
|
1486
|
+
},
|
|
1487
|
+
"useSystem": {
|
|
1488
|
+
"default": false,
|
|
1489
|
+
"description": "Run the task as the system instead of the launcher",
|
|
1490
|
+
"type": "boolean"
|
|
1491
|
+
}
|
|
1492
|
+
},
|
|
1493
|
+
"type": "object"
|
|
1494
|
+
},
|
|
1495
|
+
"WorkflowLauncher": {
|
|
1496
|
+
"additionalProperties": false,
|
|
1497
|
+
"description": "Who launched a workflow: the steps run as this identity",
|
|
1498
|
+
"properties": {
|
|
1499
|
+
"clientId": {
|
|
1500
|
+
"description": "OAuth client id of the launcher session, when applicable",
|
|
1501
|
+
"type": "string"
|
|
1502
|
+
},
|
|
1503
|
+
"identId": {
|
|
1504
|
+
"description": "Ident used by the launcher to log in",
|
|
1505
|
+
"type": "string"
|
|
1506
|
+
},
|
|
1507
|
+
"mfa": {
|
|
1508
|
+
"description": "MFA state of the launcher session",
|
|
1509
|
+
"enum": [
|
|
1510
|
+
"none",
|
|
1511
|
+
"pending",
|
|
1512
|
+
"verified"
|
|
1513
|
+
],
|
|
1514
|
+
"type": "string"
|
|
1515
|
+
},
|
|
1516
|
+
"mfaAt": {
|
|
1517
|
+
"description": "MFA verification timestamp of the launcher session",
|
|
1518
|
+
"type": "number"
|
|
1519
|
+
},
|
|
1520
|
+
"scopes": {
|
|
1521
|
+
"description": "Granted scopes of the launcher session, when restricted",
|
|
1522
|
+
"items": {
|
|
1523
|
+
"type": "string"
|
|
1524
|
+
},
|
|
1525
|
+
"type": "array"
|
|
1526
|
+
},
|
|
1527
|
+
"system": {
|
|
1528
|
+
"default": false,
|
|
1529
|
+
"description": "Launched by the system",
|
|
1530
|
+
"type": "boolean"
|
|
1531
|
+
},
|
|
1532
|
+
"userId": {
|
|
1533
|
+
"description": "User id of the launcher",
|
|
1534
|
+
"type": "string"
|
|
1535
|
+
}
|
|
1536
|
+
},
|
|
1537
|
+
"type": "object"
|
|
1538
|
+
},
|
|
1539
|
+
"parent#2": {
|
|
1540
|
+
"additionalProperties": false,
|
|
1541
|
+
"description": "Parent instance and task key of a child flow",
|
|
1542
|
+
"properties": {
|
|
1543
|
+
"instance": {
|
|
1544
|
+
"type": "string"
|
|
1545
|
+
},
|
|
1546
|
+
"key": {
|
|
1547
|
+
"type": "string"
|
|
1548
|
+
}
|
|
1549
|
+
},
|
|
1550
|
+
"required": [
|
|
1551
|
+
"instance",
|
|
1552
|
+
"key"
|
|
1553
|
+
],
|
|
1554
|
+
"type": "object"
|
|
1555
|
+
}
|
|
1556
|
+
},
|
|
1557
|
+
"description": "A running (or finished) flow: its pinned definition, input and journal of task outcomes",
|
|
1558
|
+
"properties": {
|
|
1559
|
+
"createdAt": {
|
|
1560
|
+
"description": "Creation time (ms)",
|
|
1561
|
+
"type": "number"
|
|
1562
|
+
},
|
|
1563
|
+
"definition": {
|
|
1564
|
+
"$ref": "#/definitions/FlowDefinitionData",
|
|
1565
|
+
"description": "The definition the instance runs, pinned at launch"
|
|
1566
|
+
},
|
|
1567
|
+
"error": {
|
|
1568
|
+
"$ref": "#/definitions/FlowError",
|
|
1569
|
+
"description": "Uncaught error, once ERROR"
|
|
1570
|
+
},
|
|
1571
|
+
"flowId": {
|
|
1572
|
+
"description": "Flow id: the operation id launching the flow",
|
|
1573
|
+
"type": "string"
|
|
1574
|
+
},
|
|
1575
|
+
"input": {
|
|
1576
|
+
"$ref": "#/definitions/Record%3Cstring%2C%20any%3E",
|
|
1577
|
+
"description": "Flow input, by parameter name"
|
|
1578
|
+
},
|
|
1579
|
+
"journal": {
|
|
1580
|
+
"$ref": "#/definitions/Journal",
|
|
1581
|
+
"description": "Outcomes of the finished tasks, by task key"
|
|
1582
|
+
},
|
|
1583
|
+
"launcher": {
|
|
1584
|
+
"$ref": "#/definitions/WorkflowLauncher",
|
|
1585
|
+
"description": "Identity the steps run as"
|
|
1586
|
+
},
|
|
1587
|
+
"output": {
|
|
1588
|
+
"description": "Flow output, once SUCCESS"
|
|
1589
|
+
},
|
|
1590
|
+
"parent": {
|
|
1591
|
+
"$ref": "#/definitions/parent%232",
|
|
1592
|
+
"description": "Parent instance and task key of a child flow"
|
|
1593
|
+
},
|
|
1594
|
+
"revision": {
|
|
1595
|
+
"description": "Revision of the instance, incremented by every write (compare-and-set)",
|
|
1596
|
+
"type": "number"
|
|
1597
|
+
},
|
|
1598
|
+
"status": {
|
|
1599
|
+
"description": "Current status",
|
|
1600
|
+
"enum": [
|
|
1601
|
+
"RUNNING",
|
|
1602
|
+
"WAITING",
|
|
1603
|
+
"SUCCESS",
|
|
1604
|
+
"ERROR",
|
|
1605
|
+
"CANCELLED"
|
|
1606
|
+
],
|
|
1607
|
+
"type": "string"
|
|
1608
|
+
},
|
|
1609
|
+
"updatedAt": {
|
|
1610
|
+
"description": "Last update time (ms)",
|
|
1611
|
+
"type": "number"
|
|
1612
|
+
},
|
|
1613
|
+
"uuid": {
|
|
1614
|
+
"description": "UUID of the model",
|
|
1615
|
+
"format": "uuid",
|
|
1616
|
+
"type": "string"
|
|
1617
|
+
},
|
|
1618
|
+
"version": {
|
|
1619
|
+
"description": "Version of the pinned definition",
|
|
1620
|
+
"type": "string"
|
|
1621
|
+
}
|
|
1622
|
+
},
|
|
1623
|
+
"required": [
|
|
1624
|
+
"createdAt",
|
|
1625
|
+
"definition",
|
|
1626
|
+
"flowId",
|
|
1627
|
+
"input",
|
|
1628
|
+
"journal",
|
|
1629
|
+
"launcher",
|
|
1630
|
+
"revision",
|
|
1631
|
+
"status",
|
|
1632
|
+
"updatedAt",
|
|
1633
|
+
"uuid",
|
|
1634
|
+
"version"
|
|
1635
|
+
],
|
|
1636
|
+
"type": "object",
|
|
1637
|
+
"$webda": "toJSON$return"
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
"Actions": {
|
|
1641
|
+
"cancel": {
|
|
1642
|
+
"rest": {
|
|
1643
|
+
"method": "POST"
|
|
1644
|
+
}
|
|
1645
|
+
},
|
|
1646
|
+
"retry": {
|
|
1647
|
+
"rest": {
|
|
1648
|
+
"method": "POST"
|
|
1649
|
+
}
|
|
1650
|
+
},
|
|
1651
|
+
"migrate": {
|
|
1652
|
+
"rest": {
|
|
1653
|
+
"method": "POST"
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
},
|
|
1657
|
+
"Events": [
|
|
1658
|
+
"Create",
|
|
1659
|
+
"PartialUpdate",
|
|
1660
|
+
"Delete",
|
|
1661
|
+
"Update",
|
|
1662
|
+
"Patch",
|
|
1663
|
+
"Query",
|
|
1664
|
+
"Aggregate",
|
|
1665
|
+
"Created",
|
|
1666
|
+
"PartialUpdated",
|
|
1667
|
+
"Deleted",
|
|
1668
|
+
"Patched",
|
|
1669
|
+
"Updated",
|
|
1670
|
+
"Queried",
|
|
1671
|
+
"Aggregated"
|
|
1672
|
+
],
|
|
1673
|
+
"PrimaryKey": [
|
|
1674
|
+
"uuid"
|
|
1675
|
+
],
|
|
1676
|
+
"Identifier": "Webda/WorkflowInstance"
|
|
1677
|
+
},
|
|
1678
|
+
"Webda/WorkflowSignal": {
|
|
1679
|
+
"Plural": "WorkflowSignals",
|
|
1680
|
+
"Import": "lib/models/workflowsignal.model:default",
|
|
1681
|
+
"Relations": {},
|
|
1682
|
+
"Ancestors": [],
|
|
1683
|
+
"Subclasses": [],
|
|
1684
|
+
"Reflection": {
|
|
1685
|
+
"event": {
|
|
1686
|
+
"type": "string"
|
|
1687
|
+
},
|
|
1688
|
+
"key": {
|
|
1689
|
+
"type": "string"
|
|
1690
|
+
},
|
|
1691
|
+
"payload": {
|
|
1692
|
+
"type": "any"
|
|
1693
|
+
},
|
|
1694
|
+
"senderId": {
|
|
1695
|
+
"type": "string"
|
|
1696
|
+
},
|
|
1697
|
+
"senderIdent": {
|
|
1698
|
+
"type": "string"
|
|
1699
|
+
},
|
|
1700
|
+
"system": {
|
|
1701
|
+
"type": "boolean"
|
|
1702
|
+
},
|
|
1703
|
+
"createdAt": {
|
|
1704
|
+
"type": "number"
|
|
1705
|
+
},
|
|
1706
|
+
"expiresAt": {
|
|
1707
|
+
"type": "number"
|
|
1708
|
+
},
|
|
1709
|
+
"uuid": {
|
|
1710
|
+
"type": "string"
|
|
1711
|
+
}
|
|
1712
|
+
},
|
|
1713
|
+
"Schemas": {
|
|
1714
|
+
"Output": {
|
|
1715
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1716
|
+
"WebdaModel": true,
|
|
1717
|
+
"WebdaPlural": "WorkflowSignals",
|
|
1718
|
+
"additionalProperties": false,
|
|
1719
|
+
"description": "A signal sent before any instance waited for it, kept until `expiresAt`\n\nThe first wait on the same `(event, key)` whose instance accepts the sender consumes it.",
|
|
1720
|
+
"properties": {
|
|
1721
|
+
"createdAt": {
|
|
1722
|
+
"description": "When it was sent (ms)",
|
|
1723
|
+
"type": "number"
|
|
1724
|
+
},
|
|
1725
|
+
"event": {
|
|
1726
|
+
"description": "Event name",
|
|
1727
|
+
"type": "string"
|
|
1728
|
+
},
|
|
1729
|
+
"expiresAt": {
|
|
1730
|
+
"description": "When it can no longer be consumed (ms)",
|
|
1731
|
+
"type": "number"
|
|
1732
|
+
},
|
|
1733
|
+
"key": {
|
|
1734
|
+
"description": "Business key",
|
|
1735
|
+
"type": "string"
|
|
1736
|
+
},
|
|
1737
|
+
"payload": {
|
|
1738
|
+
"description": "Payload, the result of the wait"
|
|
1739
|
+
},
|
|
1740
|
+
"senderId": {
|
|
1741
|
+
"description": "User id of the sender",
|
|
1742
|
+
"type": "string"
|
|
1743
|
+
},
|
|
1744
|
+
"senderIdent": {
|
|
1745
|
+
"description": "Ident used by the sender",
|
|
1746
|
+
"type": "string"
|
|
1747
|
+
},
|
|
1748
|
+
"system": {
|
|
1749
|
+
"default": false,
|
|
1750
|
+
"description": "Sent by the system",
|
|
1751
|
+
"type": "boolean"
|
|
1752
|
+
},
|
|
1753
|
+
"uuid": {
|
|
1754
|
+
"description": "UUID of the model",
|
|
1755
|
+
"format": "uuid",
|
|
1756
|
+
"type": "string"
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1759
|
+
"required": [
|
|
1760
|
+
"createdAt",
|
|
1761
|
+
"event",
|
|
1762
|
+
"expiresAt",
|
|
1763
|
+
"key",
|
|
1764
|
+
"uuid"
|
|
1765
|
+
],
|
|
1766
|
+
"type": "object",
|
|
1767
|
+
"$webda": "toDto$auto"
|
|
1768
|
+
},
|
|
1769
|
+
"Input": {
|
|
1770
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1771
|
+
"WebdaModel": true,
|
|
1772
|
+
"WebdaPlural": "WorkflowSignals",
|
|
1773
|
+
"additionalProperties": false,
|
|
1774
|
+
"description": "A signal sent before any instance waited for it, kept until `expiresAt`\n\nThe first wait on the same `(event, key)` whose instance accepts the sender consumes it.",
|
|
1775
|
+
"properties": {
|
|
1776
|
+
"createdAt": {
|
|
1777
|
+
"description": "When it was sent (ms)",
|
|
1778
|
+
"type": "number"
|
|
1779
|
+
},
|
|
1780
|
+
"event": {
|
|
1781
|
+
"description": "Event name",
|
|
1782
|
+
"type": "string"
|
|
1783
|
+
},
|
|
1784
|
+
"expiresAt": {
|
|
1785
|
+
"description": "When it can no longer be consumed (ms)",
|
|
1786
|
+
"type": "number"
|
|
1787
|
+
},
|
|
1788
|
+
"key": {
|
|
1789
|
+
"description": "Business key",
|
|
1790
|
+
"type": "string"
|
|
1791
|
+
},
|
|
1792
|
+
"payload": {
|
|
1793
|
+
"description": "Payload, the result of the wait"
|
|
1794
|
+
},
|
|
1795
|
+
"senderId": {
|
|
1796
|
+
"description": "User id of the sender",
|
|
1797
|
+
"type": "string"
|
|
1798
|
+
},
|
|
1799
|
+
"senderIdent": {
|
|
1800
|
+
"description": "Ident used by the sender",
|
|
1801
|
+
"type": "string"
|
|
1802
|
+
},
|
|
1803
|
+
"system": {
|
|
1804
|
+
"default": false,
|
|
1805
|
+
"description": "Sent by the system",
|
|
1806
|
+
"type": "boolean"
|
|
1807
|
+
},
|
|
1808
|
+
"uuid": {
|
|
1809
|
+
"description": "UUID of the model",
|
|
1810
|
+
"format": "uuid",
|
|
1811
|
+
"type": "string"
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
"required": [
|
|
1815
|
+
"createdAt",
|
|
1816
|
+
"event",
|
|
1817
|
+
"expiresAt",
|
|
1818
|
+
"key",
|
|
1819
|
+
"uuid"
|
|
1820
|
+
],
|
|
1821
|
+
"type": "object",
|
|
1822
|
+
"$webda": "fromDto$auto"
|
|
1823
|
+
},
|
|
1824
|
+
"Stored": {
|
|
1825
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1826
|
+
"WebdaModel": true,
|
|
1827
|
+
"WebdaPlural": "WorkflowSignals",
|
|
1828
|
+
"additionalProperties": false,
|
|
1829
|
+
"description": "A signal sent before any instance waited for it, kept until `expiresAt`\n\nThe first wait on the same `(event, key)` whose instance accepts the sender consumes it.",
|
|
1830
|
+
"properties": {
|
|
1831
|
+
"createdAt": {
|
|
1832
|
+
"description": "When it was sent (ms)",
|
|
1833
|
+
"type": "number"
|
|
1834
|
+
},
|
|
1835
|
+
"event": {
|
|
1836
|
+
"description": "Event name",
|
|
1837
|
+
"type": "string"
|
|
1838
|
+
},
|
|
1839
|
+
"expiresAt": {
|
|
1840
|
+
"description": "When it can no longer be consumed (ms)",
|
|
1841
|
+
"type": "number"
|
|
1842
|
+
},
|
|
1843
|
+
"key": {
|
|
1844
|
+
"description": "Business key",
|
|
1845
|
+
"type": "string"
|
|
1846
|
+
},
|
|
1847
|
+
"payload": {
|
|
1848
|
+
"description": "Payload, the result of the wait"
|
|
1849
|
+
},
|
|
1850
|
+
"senderId": {
|
|
1851
|
+
"description": "User id of the sender",
|
|
1852
|
+
"type": "string"
|
|
1853
|
+
},
|
|
1854
|
+
"senderIdent": {
|
|
1855
|
+
"description": "Ident used by the sender",
|
|
1856
|
+
"type": "string"
|
|
1857
|
+
},
|
|
1858
|
+
"system": {
|
|
1859
|
+
"default": false,
|
|
1860
|
+
"description": "Sent by the system",
|
|
1861
|
+
"type": "boolean"
|
|
1862
|
+
},
|
|
1863
|
+
"uuid": {
|
|
1864
|
+
"description": "UUID of the model",
|
|
1865
|
+
"format": "uuid",
|
|
1866
|
+
"type": "string"
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
"required": [
|
|
1870
|
+
"createdAt",
|
|
1871
|
+
"event",
|
|
1872
|
+
"expiresAt",
|
|
1873
|
+
"key",
|
|
1874
|
+
"uuid"
|
|
1875
|
+
],
|
|
1876
|
+
"type": "object",
|
|
1877
|
+
"$webda": "toJSON$return"
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
"Actions": {},
|
|
1881
|
+
"Events": [
|
|
1882
|
+
"Create",
|
|
1883
|
+
"PartialUpdate",
|
|
1884
|
+
"Delete",
|
|
1885
|
+
"Update",
|
|
1886
|
+
"Patch",
|
|
1887
|
+
"Query",
|
|
1888
|
+
"Aggregate",
|
|
1889
|
+
"Created",
|
|
1890
|
+
"PartialUpdated",
|
|
1891
|
+
"Deleted",
|
|
1892
|
+
"Patched",
|
|
1893
|
+
"Updated",
|
|
1894
|
+
"Queried",
|
|
1895
|
+
"Aggregated"
|
|
1896
|
+
],
|
|
1897
|
+
"PrimaryKey": [
|
|
1898
|
+
"uuid"
|
|
1899
|
+
],
|
|
1900
|
+
"Identifier": "Webda/WorkflowSignal"
|
|
1901
|
+
},
|
|
1902
|
+
"Webda/WorkflowTask": {
|
|
1903
|
+
"Plural": "WorkflowTasks",
|
|
1904
|
+
"Import": "lib/models/workflowtask.model:default",
|
|
1905
|
+
"Relations": {},
|
|
1906
|
+
"Ancestors": [],
|
|
1907
|
+
"Subclasses": [],
|
|
1908
|
+
"Reflection": {
|
|
1909
|
+
"instance": {
|
|
1910
|
+
"type": "string"
|
|
1911
|
+
},
|
|
1912
|
+
"key": {
|
|
1913
|
+
"type": "string"
|
|
1914
|
+
},
|
|
1915
|
+
"operation": {
|
|
1916
|
+
"type": "string"
|
|
1917
|
+
},
|
|
1918
|
+
"input": {
|
|
1919
|
+
"type": "any"
|
|
1920
|
+
},
|
|
1921
|
+
"options": {
|
|
1922
|
+
"type": "TaskOptions"
|
|
1923
|
+
},
|
|
1924
|
+
"attempt": {
|
|
1925
|
+
"type": "number"
|
|
1926
|
+
},
|
|
1927
|
+
"status": {
|
|
1928
|
+
"type": "WorkflowTaskStatus"
|
|
1929
|
+
},
|
|
1930
|
+
"runAt": {
|
|
1931
|
+
"type": "number"
|
|
1932
|
+
},
|
|
1933
|
+
"owner": {
|
|
1934
|
+
"type": "string"
|
|
1935
|
+
},
|
|
1936
|
+
"leaseUntil": {
|
|
1937
|
+
"type": "number"
|
|
1938
|
+
},
|
|
1939
|
+
"output": {
|
|
1940
|
+
"type": "any"
|
|
1941
|
+
},
|
|
1942
|
+
"error": {
|
|
1943
|
+
"type": "FlowError"
|
|
1944
|
+
},
|
|
1945
|
+
"startedAt": {
|
|
1946
|
+
"type": "number"
|
|
1947
|
+
},
|
|
1948
|
+
"endedAt": {
|
|
1949
|
+
"type": "number"
|
|
1950
|
+
},
|
|
1951
|
+
"launcherId": {
|
|
1952
|
+
"type": "string"
|
|
1953
|
+
},
|
|
1954
|
+
"event": {
|
|
1955
|
+
"type": "string"
|
|
1956
|
+
},
|
|
1957
|
+
"eventKey": {
|
|
1958
|
+
"type": "string"
|
|
1959
|
+
},
|
|
1960
|
+
"allow": {
|
|
1961
|
+
"type": "Array",
|
|
1962
|
+
"typeParameters": [
|
|
1963
|
+
"string"
|
|
1964
|
+
]
|
|
1965
|
+
},
|
|
1966
|
+
"signaled": {
|
|
1967
|
+
"type": "boolean"
|
|
1968
|
+
},
|
|
1969
|
+
"child": {
|
|
1970
|
+
"type": "string"
|
|
1971
|
+
},
|
|
1972
|
+
"uuid": {
|
|
1973
|
+
"type": "string"
|
|
1974
|
+
}
|
|
1975
|
+
},
|
|
1976
|
+
"Schemas": {
|
|
1977
|
+
"Output": {
|
|
1978
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1979
|
+
"WebdaModel": true,
|
|
1980
|
+
"WebdaPlural": "WorkflowTasks",
|
|
1981
|
+
"additionalProperties": false,
|
|
1982
|
+
"definitions": {
|
|
1983
|
+
"FlowError": {
|
|
1984
|
+
"additionalProperties": false,
|
|
1985
|
+
"description": "An error, as seen by the flow: plain data",
|
|
1986
|
+
"properties": {
|
|
1987
|
+
"code": {
|
|
1988
|
+
"type": "string"
|
|
1989
|
+
},
|
|
1990
|
+
"message": {
|
|
1991
|
+
"type": "string"
|
|
1992
|
+
},
|
|
1993
|
+
"operation": {
|
|
1994
|
+
"type": "string"
|
|
1995
|
+
}
|
|
1996
|
+
},
|
|
1997
|
+
"required": [
|
|
1998
|
+
"code",
|
|
1999
|
+
"message",
|
|
2000
|
+
"operation"
|
|
2001
|
+
],
|
|
2002
|
+
"type": "object"
|
|
2003
|
+
},
|
|
2004
|
+
"TaskOptions": {
|
|
2005
|
+
"additionalProperties": false,
|
|
2006
|
+
"description": "Options of a task, and defaults of a flow",
|
|
2007
|
+
"properties": {
|
|
2008
|
+
"backoff": {
|
|
2009
|
+
"default": "exponential",
|
|
2010
|
+
"description": "Delay growth between attempts",
|
|
2011
|
+
"enum": [
|
|
2012
|
+
"fixed",
|
|
2013
|
+
"exponential"
|
|
2014
|
+
],
|
|
2015
|
+
"type": "string"
|
|
2016
|
+
},
|
|
2017
|
+
"delay": {
|
|
2018
|
+
"default": "1s",
|
|
2019
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
2020
|
+
"type": "string"
|
|
2021
|
+
},
|
|
2022
|
+
"retries": {
|
|
2023
|
+
"default": 0,
|
|
2024
|
+
"description": "Retries after the first attempt",
|
|
2025
|
+
"type": "number"
|
|
2026
|
+
},
|
|
2027
|
+
"timeout": {
|
|
2028
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
2029
|
+
"type": "string"
|
|
2030
|
+
},
|
|
2031
|
+
"useSystem": {
|
|
2032
|
+
"default": false,
|
|
2033
|
+
"description": "Run the task as the system instead of the launcher",
|
|
2034
|
+
"type": "boolean"
|
|
2035
|
+
}
|
|
2036
|
+
},
|
|
2037
|
+
"type": "object"
|
|
2038
|
+
}
|
|
2039
|
+
},
|
|
2040
|
+
"description": "One attempt of a task of a workflow instance",
|
|
2041
|
+
"properties": {
|
|
2042
|
+
"allow": {
|
|
2043
|
+
"description": "Users allowed to signal the wait, besides the launcher and the system",
|
|
2044
|
+
"items": {
|
|
2045
|
+
"type": "string"
|
|
2046
|
+
},
|
|
2047
|
+
"type": "array"
|
|
2048
|
+
},
|
|
2049
|
+
"attempt": {
|
|
2050
|
+
"description": "Attempt number, starting at 1",
|
|
2051
|
+
"type": "number"
|
|
2052
|
+
},
|
|
2053
|
+
"child": {
|
|
2054
|
+
"description": "Child instance of a `WAITING_CHILD` task",
|
|
2055
|
+
"type": "string"
|
|
2056
|
+
},
|
|
2057
|
+
"endedAt": {
|
|
2058
|
+
"description": "End of the attempt (ms)",
|
|
2059
|
+
"type": "number"
|
|
2060
|
+
},
|
|
2061
|
+
"error": {
|
|
2062
|
+
"$ref": "#/definitions/FlowError",
|
|
2063
|
+
"description": "Error of the attempt"
|
|
2064
|
+
},
|
|
2065
|
+
"event": {
|
|
2066
|
+
"description": "Event a `Wait.ForEvent` waits for",
|
|
2067
|
+
"type": "string"
|
|
2068
|
+
},
|
|
2069
|
+
"eventKey": {
|
|
2070
|
+
"description": "Business key a `Wait.ForEvent` waits for",
|
|
2071
|
+
"type": "string"
|
|
2072
|
+
},
|
|
2073
|
+
"input": {
|
|
2074
|
+
"description": "Operation input"
|
|
2075
|
+
},
|
|
2076
|
+
"instance": {
|
|
2077
|
+
"description": "Uuid of the workflow instance",
|
|
2078
|
+
"type": "string"
|
|
2079
|
+
},
|
|
2080
|
+
"key": {
|
|
2081
|
+
"description": "Task key in the instance journal",
|
|
2082
|
+
"type": "string"
|
|
2083
|
+
},
|
|
2084
|
+
"launcherId": {
|
|
2085
|
+
"description": "User id of the instance launcher, for canAct",
|
|
2086
|
+
"type": "string"
|
|
2087
|
+
},
|
|
2088
|
+
"leaseUntil": {
|
|
2089
|
+
"description": "End of the lease (ms), 0 when free",
|
|
2090
|
+
"type": "number"
|
|
2091
|
+
},
|
|
2092
|
+
"operation": {
|
|
2093
|
+
"description": "Operation id or built-in",
|
|
2094
|
+
"type": "string"
|
|
2095
|
+
},
|
|
2096
|
+
"options": {
|
|
2097
|
+
"$ref": "#/definitions/TaskOptions",
|
|
2098
|
+
"description": "Task options, flow defaults included"
|
|
2099
|
+
},
|
|
2100
|
+
"output": {
|
|
2101
|
+
"description": "Result of the attempt"
|
|
2102
|
+
},
|
|
2103
|
+
"owner": {
|
|
2104
|
+
"description": "Worker holding the lease",
|
|
2105
|
+
"type": "string"
|
|
2106
|
+
},
|
|
2107
|
+
"runAt": {
|
|
2108
|
+
"description": "When the task becomes runnable (ms)",
|
|
2109
|
+
"type": "number"
|
|
2110
|
+
},
|
|
2111
|
+
"signaled": {
|
|
2112
|
+
"default": false,
|
|
2113
|
+
"description": "The wait was resolved by a signal: `output` holds its payload",
|
|
2114
|
+
"type": "boolean"
|
|
2115
|
+
},
|
|
2116
|
+
"startedAt": {
|
|
2117
|
+
"description": "Start of the attempt (ms)",
|
|
2118
|
+
"type": "number"
|
|
2119
|
+
},
|
|
2120
|
+
"status": {
|
|
2121
|
+
"description": "Current status",
|
|
2122
|
+
"enum": [
|
|
2123
|
+
"PENDING",
|
|
2124
|
+
"RUNNING",
|
|
2125
|
+
"WAITING_EVENT",
|
|
2126
|
+
"WAITING_CHILD",
|
|
2127
|
+
"SUCCESS",
|
|
2128
|
+
"ERROR",
|
|
2129
|
+
"CANCELLED"
|
|
2130
|
+
],
|
|
2131
|
+
"type": "string"
|
|
2132
|
+
},
|
|
2133
|
+
"uuid": {
|
|
2134
|
+
"description": "UUID of the model",
|
|
2135
|
+
"format": "uuid",
|
|
2136
|
+
"type": "string"
|
|
2137
|
+
}
|
|
2138
|
+
},
|
|
2139
|
+
"required": [
|
|
2140
|
+
"attempt",
|
|
2141
|
+
"input",
|
|
2142
|
+
"instance",
|
|
2143
|
+
"key",
|
|
2144
|
+
"leaseUntil",
|
|
2145
|
+
"operation",
|
|
2146
|
+
"options",
|
|
2147
|
+
"runAt",
|
|
2148
|
+
"status",
|
|
2149
|
+
"uuid"
|
|
2150
|
+
],
|
|
2151
|
+
"type": "object",
|
|
2152
|
+
"$webda": "toDto$auto"
|
|
2153
|
+
},
|
|
2154
|
+
"Input": {
|
|
2155
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2156
|
+
"WebdaModel": true,
|
|
2157
|
+
"WebdaPlural": "WorkflowTasks",
|
|
2158
|
+
"additionalProperties": false,
|
|
2159
|
+
"definitions": {
|
|
2160
|
+
"FlowError": {
|
|
2161
|
+
"additionalProperties": false,
|
|
2162
|
+
"description": "An error, as seen by the flow: plain data",
|
|
2163
|
+
"properties": {
|
|
2164
|
+
"code": {
|
|
2165
|
+
"type": "string"
|
|
2166
|
+
},
|
|
2167
|
+
"message": {
|
|
2168
|
+
"type": "string"
|
|
2169
|
+
},
|
|
2170
|
+
"operation": {
|
|
2171
|
+
"type": "string"
|
|
2172
|
+
}
|
|
2173
|
+
},
|
|
2174
|
+
"required": [
|
|
2175
|
+
"code",
|
|
2176
|
+
"message",
|
|
2177
|
+
"operation"
|
|
2178
|
+
],
|
|
2179
|
+
"type": "object"
|
|
2180
|
+
},
|
|
2181
|
+
"TaskOptions": {
|
|
2182
|
+
"additionalProperties": false,
|
|
2183
|
+
"description": "Options of a task, and defaults of a flow",
|
|
2184
|
+
"properties": {
|
|
2185
|
+
"backoff": {
|
|
2186
|
+
"default": "exponential",
|
|
2187
|
+
"description": "Delay growth between attempts",
|
|
2188
|
+
"enum": [
|
|
2189
|
+
"fixed",
|
|
2190
|
+
"exponential"
|
|
2191
|
+
],
|
|
2192
|
+
"type": "string"
|
|
2193
|
+
},
|
|
2194
|
+
"delay": {
|
|
2195
|
+
"default": "1s",
|
|
2196
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
2197
|
+
"type": "string"
|
|
2198
|
+
},
|
|
2199
|
+
"retries": {
|
|
2200
|
+
"default": 0,
|
|
2201
|
+
"description": "Retries after the first attempt",
|
|
2202
|
+
"type": "number"
|
|
2203
|
+
},
|
|
2204
|
+
"timeout": {
|
|
2205
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
2206
|
+
"type": "string"
|
|
2207
|
+
},
|
|
2208
|
+
"useSystem": {
|
|
2209
|
+
"default": false,
|
|
2210
|
+
"description": "Run the task as the system instead of the launcher",
|
|
2211
|
+
"type": "boolean"
|
|
2212
|
+
}
|
|
2213
|
+
},
|
|
2214
|
+
"type": "object"
|
|
2215
|
+
}
|
|
2216
|
+
},
|
|
2217
|
+
"description": "One attempt of a task of a workflow instance",
|
|
2218
|
+
"properties": {
|
|
2219
|
+
"allow": {
|
|
2220
|
+
"description": "Users allowed to signal the wait, besides the launcher and the system",
|
|
2221
|
+
"items": {
|
|
2222
|
+
"type": "string"
|
|
2223
|
+
},
|
|
2224
|
+
"type": "array"
|
|
2225
|
+
},
|
|
2226
|
+
"attempt": {
|
|
2227
|
+
"description": "Attempt number, starting at 1",
|
|
2228
|
+
"type": "number"
|
|
2229
|
+
},
|
|
2230
|
+
"child": {
|
|
2231
|
+
"description": "Child instance of a `WAITING_CHILD` task",
|
|
2232
|
+
"type": "string"
|
|
2233
|
+
},
|
|
2234
|
+
"endedAt": {
|
|
2235
|
+
"description": "End of the attempt (ms)",
|
|
2236
|
+
"type": "number"
|
|
2237
|
+
},
|
|
2238
|
+
"error": {
|
|
2239
|
+
"$ref": "#/definitions/FlowError",
|
|
2240
|
+
"description": "Error of the attempt"
|
|
2241
|
+
},
|
|
2242
|
+
"event": {
|
|
2243
|
+
"description": "Event a `Wait.ForEvent` waits for",
|
|
2244
|
+
"type": "string"
|
|
2245
|
+
},
|
|
2246
|
+
"eventKey": {
|
|
2247
|
+
"description": "Business key a `Wait.ForEvent` waits for",
|
|
2248
|
+
"type": "string"
|
|
2249
|
+
},
|
|
2250
|
+
"input": {
|
|
2251
|
+
"description": "Operation input"
|
|
2252
|
+
},
|
|
2253
|
+
"instance": {
|
|
2254
|
+
"description": "Uuid of the workflow instance",
|
|
2255
|
+
"type": "string"
|
|
2256
|
+
},
|
|
2257
|
+
"key": {
|
|
2258
|
+
"description": "Task key in the instance journal",
|
|
2259
|
+
"type": "string"
|
|
2260
|
+
},
|
|
2261
|
+
"launcherId": {
|
|
2262
|
+
"description": "User id of the instance launcher, for canAct",
|
|
2263
|
+
"type": "string"
|
|
2264
|
+
},
|
|
2265
|
+
"leaseUntil": {
|
|
2266
|
+
"description": "End of the lease (ms), 0 when free",
|
|
2267
|
+
"type": "number"
|
|
2268
|
+
},
|
|
2269
|
+
"operation": {
|
|
2270
|
+
"description": "Operation id or built-in",
|
|
2271
|
+
"type": "string"
|
|
2272
|
+
},
|
|
2273
|
+
"options": {
|
|
2274
|
+
"$ref": "#/definitions/TaskOptions",
|
|
2275
|
+
"description": "Task options, flow defaults included"
|
|
2276
|
+
},
|
|
2277
|
+
"output": {
|
|
2278
|
+
"description": "Result of the attempt"
|
|
2279
|
+
},
|
|
2280
|
+
"owner": {
|
|
2281
|
+
"description": "Worker holding the lease",
|
|
2282
|
+
"type": "string"
|
|
2283
|
+
},
|
|
2284
|
+
"runAt": {
|
|
2285
|
+
"description": "When the task becomes runnable (ms)",
|
|
2286
|
+
"type": "number"
|
|
2287
|
+
},
|
|
2288
|
+
"signaled": {
|
|
2289
|
+
"default": false,
|
|
2290
|
+
"description": "The wait was resolved by a signal: `output` holds its payload",
|
|
2291
|
+
"type": "boolean"
|
|
2292
|
+
},
|
|
2293
|
+
"startedAt": {
|
|
2294
|
+
"description": "Start of the attempt (ms)",
|
|
2295
|
+
"type": "number"
|
|
2296
|
+
},
|
|
2297
|
+
"status": {
|
|
2298
|
+
"description": "Current status",
|
|
2299
|
+
"enum": [
|
|
2300
|
+
"PENDING",
|
|
2301
|
+
"RUNNING",
|
|
2302
|
+
"WAITING_EVENT",
|
|
2303
|
+
"WAITING_CHILD",
|
|
2304
|
+
"SUCCESS",
|
|
2305
|
+
"ERROR",
|
|
2306
|
+
"CANCELLED"
|
|
2307
|
+
],
|
|
2308
|
+
"type": "string"
|
|
2309
|
+
},
|
|
2310
|
+
"uuid": {
|
|
2311
|
+
"description": "UUID of the model",
|
|
2312
|
+
"format": "uuid",
|
|
2313
|
+
"type": "string"
|
|
2314
|
+
}
|
|
2315
|
+
},
|
|
2316
|
+
"required": [
|
|
2317
|
+
"attempt",
|
|
2318
|
+
"input",
|
|
2319
|
+
"instance",
|
|
2320
|
+
"key",
|
|
2321
|
+
"leaseUntil",
|
|
2322
|
+
"operation",
|
|
2323
|
+
"options",
|
|
2324
|
+
"runAt",
|
|
2325
|
+
"status",
|
|
2326
|
+
"uuid"
|
|
2327
|
+
],
|
|
2328
|
+
"type": "object",
|
|
2329
|
+
"$webda": "fromDto$auto"
|
|
2330
|
+
},
|
|
2331
|
+
"Stored": {
|
|
2332
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2333
|
+
"WebdaModel": true,
|
|
2334
|
+
"WebdaPlural": "WorkflowTasks",
|
|
2335
|
+
"additionalProperties": false,
|
|
2336
|
+
"definitions": {
|
|
2337
|
+
"FlowError": {
|
|
2338
|
+
"additionalProperties": false,
|
|
2339
|
+
"description": "An error, as seen by the flow: plain data",
|
|
2340
|
+
"properties": {
|
|
2341
|
+
"code": {
|
|
2342
|
+
"type": "string"
|
|
2343
|
+
},
|
|
2344
|
+
"message": {
|
|
2345
|
+
"type": "string"
|
|
2346
|
+
},
|
|
2347
|
+
"operation": {
|
|
2348
|
+
"type": "string"
|
|
2349
|
+
}
|
|
2350
|
+
},
|
|
2351
|
+
"required": [
|
|
2352
|
+
"code",
|
|
2353
|
+
"message",
|
|
2354
|
+
"operation"
|
|
2355
|
+
],
|
|
2356
|
+
"type": "object"
|
|
2357
|
+
},
|
|
2358
|
+
"TaskOptions": {
|
|
2359
|
+
"additionalProperties": false,
|
|
2360
|
+
"description": "Options of a task, and defaults of a flow",
|
|
2361
|
+
"properties": {
|
|
2362
|
+
"backoff": {
|
|
2363
|
+
"default": "exponential",
|
|
2364
|
+
"description": "Delay growth between attempts",
|
|
2365
|
+
"enum": [
|
|
2366
|
+
"fixed",
|
|
2367
|
+
"exponential"
|
|
2368
|
+
],
|
|
2369
|
+
"type": "string"
|
|
2370
|
+
},
|
|
2371
|
+
"delay": {
|
|
2372
|
+
"default": "1s",
|
|
2373
|
+
"description": "Delay before the first retry (Duration syntax)",
|
|
2374
|
+
"type": "string"
|
|
2375
|
+
},
|
|
2376
|
+
"retries": {
|
|
2377
|
+
"default": 0,
|
|
2378
|
+
"description": "Retries after the first attempt",
|
|
2379
|
+
"type": "number"
|
|
2380
|
+
},
|
|
2381
|
+
"timeout": {
|
|
2382
|
+
"description": "Maximum duration of one attempt (Duration syntax)",
|
|
2383
|
+
"type": "string"
|
|
2384
|
+
},
|
|
2385
|
+
"useSystem": {
|
|
2386
|
+
"default": false,
|
|
2387
|
+
"description": "Run the task as the system instead of the launcher",
|
|
2388
|
+
"type": "boolean"
|
|
2389
|
+
}
|
|
2390
|
+
},
|
|
2391
|
+
"type": "object"
|
|
2392
|
+
}
|
|
2393
|
+
},
|
|
2394
|
+
"description": "One attempt of a task of a workflow instance",
|
|
2395
|
+
"properties": {
|
|
2396
|
+
"allow": {
|
|
2397
|
+
"description": "Users allowed to signal the wait, besides the launcher and the system",
|
|
2398
|
+
"items": {
|
|
2399
|
+
"type": "string"
|
|
2400
|
+
},
|
|
2401
|
+
"type": "array"
|
|
2402
|
+
},
|
|
2403
|
+
"attempt": {
|
|
2404
|
+
"description": "Attempt number, starting at 1",
|
|
2405
|
+
"type": "number"
|
|
2406
|
+
},
|
|
2407
|
+
"child": {
|
|
2408
|
+
"description": "Child instance of a `WAITING_CHILD` task",
|
|
2409
|
+
"type": "string"
|
|
2410
|
+
},
|
|
2411
|
+
"endedAt": {
|
|
2412
|
+
"description": "End of the attempt (ms)",
|
|
2413
|
+
"type": "number"
|
|
2414
|
+
},
|
|
2415
|
+
"error": {
|
|
2416
|
+
"$ref": "#/definitions/FlowError",
|
|
2417
|
+
"description": "Error of the attempt"
|
|
2418
|
+
},
|
|
2419
|
+
"event": {
|
|
2420
|
+
"description": "Event a `Wait.ForEvent` waits for",
|
|
2421
|
+
"type": "string"
|
|
2422
|
+
},
|
|
2423
|
+
"eventKey": {
|
|
2424
|
+
"description": "Business key a `Wait.ForEvent` waits for",
|
|
2425
|
+
"type": "string"
|
|
2426
|
+
},
|
|
2427
|
+
"input": {
|
|
2428
|
+
"description": "Operation input"
|
|
2429
|
+
},
|
|
2430
|
+
"instance": {
|
|
2431
|
+
"description": "Uuid of the workflow instance",
|
|
2432
|
+
"type": "string"
|
|
2433
|
+
},
|
|
2434
|
+
"key": {
|
|
2435
|
+
"description": "Task key in the instance journal",
|
|
2436
|
+
"type": "string"
|
|
2437
|
+
},
|
|
2438
|
+
"launcherId": {
|
|
2439
|
+
"description": "User id of the instance launcher, for canAct",
|
|
2440
|
+
"type": "string"
|
|
2441
|
+
},
|
|
2442
|
+
"leaseUntil": {
|
|
2443
|
+
"description": "End of the lease (ms), 0 when free",
|
|
2444
|
+
"type": "number"
|
|
2445
|
+
},
|
|
2446
|
+
"operation": {
|
|
2447
|
+
"description": "Operation id or built-in",
|
|
2448
|
+
"type": "string"
|
|
2449
|
+
},
|
|
2450
|
+
"options": {
|
|
2451
|
+
"$ref": "#/definitions/TaskOptions",
|
|
2452
|
+
"description": "Task options, flow defaults included"
|
|
2453
|
+
},
|
|
2454
|
+
"output": {
|
|
2455
|
+
"description": "Result of the attempt"
|
|
2456
|
+
},
|
|
2457
|
+
"owner": {
|
|
2458
|
+
"description": "Worker holding the lease",
|
|
2459
|
+
"type": "string"
|
|
2460
|
+
},
|
|
2461
|
+
"runAt": {
|
|
2462
|
+
"description": "When the task becomes runnable (ms)",
|
|
2463
|
+
"type": "number"
|
|
2464
|
+
},
|
|
2465
|
+
"signaled": {
|
|
2466
|
+
"default": false,
|
|
2467
|
+
"description": "The wait was resolved by a signal: `output` holds its payload",
|
|
2468
|
+
"type": "boolean"
|
|
2469
|
+
},
|
|
2470
|
+
"startedAt": {
|
|
2471
|
+
"description": "Start of the attempt (ms)",
|
|
2472
|
+
"type": "number"
|
|
2473
|
+
},
|
|
2474
|
+
"status": {
|
|
2475
|
+
"description": "Current status",
|
|
2476
|
+
"enum": [
|
|
2477
|
+
"PENDING",
|
|
2478
|
+
"RUNNING",
|
|
2479
|
+
"WAITING_EVENT",
|
|
2480
|
+
"WAITING_CHILD",
|
|
2481
|
+
"SUCCESS",
|
|
2482
|
+
"ERROR",
|
|
2483
|
+
"CANCELLED"
|
|
2484
|
+
],
|
|
2485
|
+
"type": "string"
|
|
2486
|
+
},
|
|
2487
|
+
"uuid": {
|
|
2488
|
+
"description": "UUID of the model",
|
|
2489
|
+
"format": "uuid",
|
|
2490
|
+
"type": "string"
|
|
2491
|
+
}
|
|
2492
|
+
},
|
|
2493
|
+
"required": [
|
|
2494
|
+
"attempt",
|
|
2495
|
+
"input",
|
|
2496
|
+
"instance",
|
|
2497
|
+
"key",
|
|
2498
|
+
"leaseUntil",
|
|
2499
|
+
"operation",
|
|
2500
|
+
"options",
|
|
2501
|
+
"runAt",
|
|
2502
|
+
"status",
|
|
2503
|
+
"uuid"
|
|
2504
|
+
],
|
|
2505
|
+
"type": "object",
|
|
2506
|
+
"$webda": "toJSON$return"
|
|
2507
|
+
}
|
|
2508
|
+
},
|
|
2509
|
+
"Actions": {},
|
|
2510
|
+
"Events": [
|
|
2511
|
+
"Create",
|
|
2512
|
+
"PartialUpdate",
|
|
2513
|
+
"Delete",
|
|
2514
|
+
"Update",
|
|
2515
|
+
"Patch",
|
|
2516
|
+
"Query",
|
|
2517
|
+
"Aggregate",
|
|
2518
|
+
"Created",
|
|
2519
|
+
"PartialUpdated",
|
|
2520
|
+
"Deleted",
|
|
2521
|
+
"Patched",
|
|
2522
|
+
"Updated",
|
|
2523
|
+
"Queried",
|
|
2524
|
+
"Aggregated"
|
|
2525
|
+
],
|
|
2526
|
+
"PrimaryKey": [
|
|
2527
|
+
"uuid"
|
|
2528
|
+
],
|
|
2529
|
+
"Identifier": "Webda/WorkflowTask"
|
|
2530
|
+
}
|
|
2531
|
+
},
|
|
2532
|
+
"schemas": {
|
|
2533
|
+
"Webda/BinaryFile": {
|
|
2534
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2535
|
+
"WebdaSchema": true,
|
|
2536
|
+
"additionalProperties": false,
|
|
2537
|
+
"description": "Represent a file to store",
|
|
2538
|
+
"properties": {
|
|
2539
|
+
"hash": {
|
|
2540
|
+
"description": "Will be computed by the service\n\nhash of the content",
|
|
2541
|
+
"type": "string"
|
|
2542
|
+
},
|
|
2543
|
+
"metadata": {
|
|
2544
|
+
"description": "Metadatas stored along with the binary"
|
|
2545
|
+
},
|
|
2546
|
+
"mimetype": {
|
|
2547
|
+
"description": "Mimetype of the binary",
|
|
2548
|
+
"type": "string"
|
|
2549
|
+
},
|
|
2550
|
+
"name": {
|
|
2551
|
+
"description": "Current name",
|
|
2552
|
+
"type": "string"
|
|
2553
|
+
},
|
|
2554
|
+
"originalname": {
|
|
2555
|
+
"description": "Original name",
|
|
2556
|
+
"type": "string"
|
|
2557
|
+
},
|
|
2558
|
+
"size": {
|
|
2559
|
+
"description": "Size of the binary",
|
|
2560
|
+
"type": "number"
|
|
2561
|
+
}
|
|
2562
|
+
},
|
|
2563
|
+
"required": [
|
|
2564
|
+
"mimetype",
|
|
2565
|
+
"name",
|
|
2566
|
+
"size"
|
|
2567
|
+
],
|
|
2568
|
+
"type": "object",
|
|
2569
|
+
"title": "BinaryFile"
|
|
2570
|
+
},
|
|
2571
|
+
"Webda/WorkflowInstance.cancel.input": {
|
|
2572
|
+
"type": "object",
|
|
2573
|
+
"properties": {},
|
|
2574
|
+
"x-webda-rest": {
|
|
2575
|
+
"method": "post",
|
|
2576
|
+
"template": "",
|
|
2577
|
+
"path": [
|
|
2578
|
+
"uuid"
|
|
2579
|
+
],
|
|
2580
|
+
"query": [],
|
|
2581
|
+
"body": []
|
|
2582
|
+
}
|
|
2583
|
+
},
|
|
2584
|
+
"Webda/WorkflowInstance.cancel.output": {
|
|
2585
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2586
|
+
"not": {}
|
|
2587
|
+
},
|
|
2588
|
+
"Webda/WorkflowInstance.retry.input": {
|
|
2589
|
+
"type": "object",
|
|
2590
|
+
"properties": {},
|
|
2591
|
+
"x-webda-rest": {
|
|
2592
|
+
"method": "post",
|
|
2593
|
+
"template": "",
|
|
2594
|
+
"path": [
|
|
2595
|
+
"uuid"
|
|
2596
|
+
],
|
|
2597
|
+
"query": [],
|
|
2598
|
+
"body": []
|
|
2599
|
+
}
|
|
2600
|
+
},
|
|
2601
|
+
"Webda/WorkflowInstance.retry.output": {
|
|
2602
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2603
|
+
"not": {}
|
|
2604
|
+
},
|
|
2605
|
+
"Webda/WorkflowInstance.migrate.input": {
|
|
2606
|
+
"type": "object",
|
|
2607
|
+
"properties": {
|
|
2608
|
+
"version": {
|
|
2609
|
+
"type": "string"
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2612
|
+
"x-webda-rest": {
|
|
2613
|
+
"method": "post",
|
|
2614
|
+
"template": "",
|
|
2615
|
+
"path": [
|
|
2616
|
+
"uuid"
|
|
2617
|
+
],
|
|
2618
|
+
"query": [],
|
|
2619
|
+
"body": [
|
|
2620
|
+
"version"
|
|
2621
|
+
]
|
|
2622
|
+
}
|
|
2623
|
+
},
|
|
2624
|
+
"Webda/WorkflowInstance.migrate.output": {
|
|
2625
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2626
|
+
"not": {}
|
|
2627
|
+
},
|
|
2628
|
+
"WorkflowService.signal.input": {
|
|
2629
|
+
"type": "object",
|
|
2630
|
+
"properties": {
|
|
2631
|
+
"event": {
|
|
2632
|
+
"type": "string"
|
|
2633
|
+
},
|
|
2634
|
+
"key": {
|
|
2635
|
+
"type": "string"
|
|
2636
|
+
},
|
|
2637
|
+
"payload": {}
|
|
2638
|
+
},
|
|
2639
|
+
"required": [
|
|
2640
|
+
"event",
|
|
2641
|
+
"key"
|
|
2642
|
+
],
|
|
2643
|
+
"x-webda-rest": {
|
|
2644
|
+
"method": "post",
|
|
2645
|
+
"template": "workflows/signal",
|
|
2646
|
+
"path": [],
|
|
2647
|
+
"query": [],
|
|
2648
|
+
"body": [
|
|
2649
|
+
"event",
|
|
2650
|
+
"key",
|
|
2651
|
+
"payload"
|
|
2652
|
+
]
|
|
2653
|
+
}
|
|
2654
|
+
},
|
|
2655
|
+
"WorkflowService.signal.output": {
|
|
2656
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
2657
|
+
"additionalProperties": false,
|
|
2658
|
+
"properties": {
|
|
2659
|
+
"delivered": {
|
|
2660
|
+
"type": "number"
|
|
2661
|
+
}
|
|
2662
|
+
},
|
|
2663
|
+
"required": [
|
|
2664
|
+
"delivered"
|
|
2665
|
+
],
|
|
2666
|
+
"type": "object"
|
|
2667
|
+
}
|
|
2668
|
+
},
|
|
2669
|
+
"behaviors": {}
|
|
2670
|
+
}
|