@onlineapps/cookbook-core 2.1.2 → 2.1.3
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/package.json +1 -1
- package/schemas/cookbook.v2.schema.json +136 -519
package/package.json
CHANGED
|
@@ -1,63 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$
|
|
4
|
-
"title": "Cookbook Workflow Schema v2.1",
|
|
5
|
-
"description": "Schema for defining workflow orchestration with snake_case convention",
|
|
3
|
+
"$comment": "COOKBOOK V2 FORMAT - V1 IS BANNED! steps MUST be object keyed by step_id, NOT array!",
|
|
6
4
|
"type": "object",
|
|
7
|
-
"required": ["
|
|
8
|
-
"additionalProperties":
|
|
5
|
+
"required": ["steps", "version"],
|
|
6
|
+
"additionalProperties": true,
|
|
9
7
|
"properties": {
|
|
10
|
-
"version": {
|
|
11
|
-
"type": "string",
|
|
12
|
-
"pattern": "^2\\.\\d+\\.\\d+$",
|
|
13
|
-
"description": "Schema version (must start with 2.x.x)"
|
|
14
|
-
},
|
|
15
8
|
"name": {
|
|
16
9
|
"type": "string",
|
|
17
|
-
"
|
|
10
|
+
"minLength": 1
|
|
18
11
|
},
|
|
19
|
-
"
|
|
12
|
+
"version": {
|
|
20
13
|
"type": "string",
|
|
21
|
-
"
|
|
14
|
+
"pattern": "^2\\.\\d+\\.\\d+$",
|
|
15
|
+
"description": "Semantic version - MUST be 2.x.x (V1 is banned)"
|
|
22
16
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"description": "Global configuration and defaults"
|
|
17
|
+
"description": {
|
|
18
|
+
"type": "string"
|
|
26
19
|
},
|
|
27
20
|
"api_input": {
|
|
21
|
+
"type": "object"
|
|
22
|
+
},
|
|
23
|
+
"global_error_handler": {
|
|
24
|
+
"$ref": "#/definitions/ErrorHandler",
|
|
25
|
+
"description": "Default error handling for all steps"
|
|
26
|
+
},
|
|
27
|
+
"global_retry": {
|
|
28
|
+
"$ref": "#/definitions/Retry",
|
|
29
|
+
"description": "Default retry policy for all steps"
|
|
30
|
+
},
|
|
31
|
+
"global_timeout": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 1,
|
|
34
|
+
"description": "Maximum execution time for entire workflow in milliseconds"
|
|
35
|
+
},
|
|
36
|
+
"metadata": {
|
|
28
37
|
"type": "object",
|
|
29
|
-
"description": "Expected input parameters for the workflow",
|
|
30
38
|
"additionalProperties": true
|
|
31
39
|
},
|
|
32
40
|
"steps": {
|
|
33
|
-
"type": "
|
|
34
|
-
"
|
|
35
|
-
"
|
|
41
|
+
"type": "object",
|
|
42
|
+
"minProperties": 1,
|
|
43
|
+
"additionalProperties": {
|
|
36
44
|
"$ref": "#/definitions/Step"
|
|
37
45
|
},
|
|
38
|
-
"description": "
|
|
46
|
+
"description": "V2: Object keyed by step_id (NOT array!)"
|
|
39
47
|
},
|
|
40
48
|
"delivery": {
|
|
41
|
-
"
|
|
42
|
-
"description": "Delivery
|
|
49
|
+
"type": "object",
|
|
50
|
+
"description": "Delivery configuration for workflow results"
|
|
43
51
|
}
|
|
44
52
|
},
|
|
45
53
|
"definitions": {
|
|
46
|
-
"Config": {
|
|
47
|
-
"type": "object",
|
|
48
|
-
"additionalProperties": false,
|
|
49
|
-
"properties": {
|
|
50
|
-
"default_timeout_ms": {
|
|
51
|
-
"type": "integer",
|
|
52
|
-
"minimum": 1,
|
|
53
|
-
"description": "Default timeout for all steps in milliseconds"
|
|
54
|
-
},
|
|
55
|
-
"default_retry": {
|
|
56
|
-
"$ref": "#/definitions/RetryConfig",
|
|
57
|
-
"description": "Default retry configuration for all steps"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
54
|
"Step": {
|
|
62
55
|
"type": "object",
|
|
63
56
|
"required": ["step_id", "type"],
|
|
@@ -73,112 +66,86 @@
|
|
|
73
66
|
},
|
|
74
67
|
"TaskStep": {
|
|
75
68
|
"type": "object",
|
|
76
|
-
"required": ["step_id", "type", "service"
|
|
77
|
-
"additionalProperties":
|
|
69
|
+
"required": ["step_id", "type", "service"],
|
|
70
|
+
"additionalProperties": true,
|
|
78
71
|
"properties": {
|
|
79
72
|
"step_id": {
|
|
80
73
|
"type": "string",
|
|
74
|
+
"minLength": 1,
|
|
81
75
|
"pattern": "^[a-zA-Z0-9_]+$",
|
|
82
|
-
"description": "
|
|
76
|
+
"description": "V2: step_id (snake_case, must match object key)"
|
|
83
77
|
},
|
|
84
78
|
"type": {
|
|
85
|
-
"
|
|
86
|
-
"
|
|
79
|
+
"type": "string",
|
|
80
|
+
"const": "task"
|
|
87
81
|
},
|
|
88
82
|
"name": {
|
|
89
83
|
"type": "string",
|
|
90
|
-
"
|
|
84
|
+
"minLength": 1
|
|
91
85
|
},
|
|
92
86
|
"service": {
|
|
93
87
|
"type": "string",
|
|
94
|
-
"
|
|
95
|
-
"description": "Target microservice name"
|
|
88
|
+
"minLength": 1
|
|
96
89
|
},
|
|
97
90
|
"operation": {
|
|
98
91
|
"type": "string",
|
|
99
|
-
"
|
|
92
|
+
"minLength": 1,
|
|
93
|
+
"description": "Operation identifier for the service to execute"
|
|
100
94
|
},
|
|
101
95
|
"input": {
|
|
102
96
|
"type": "object",
|
|
103
|
-
"additionalProperties": true
|
|
104
|
-
"description": "Input parameters for the operation"
|
|
97
|
+
"additionalProperties": true
|
|
105
98
|
},
|
|
106
99
|
"output": {
|
|
107
100
|
"type": "object",
|
|
108
|
-
"additionalProperties": true
|
|
109
|
-
"description": "Output mapping to workflow context"
|
|
101
|
+
"additionalProperties": true
|
|
110
102
|
},
|
|
111
|
-
"
|
|
112
|
-
"type": "
|
|
113
|
-
"
|
|
114
|
-
"description": "Timeout in milliseconds (overrides default)"
|
|
103
|
+
"depends_on": {
|
|
104
|
+
"type": "array",
|
|
105
|
+
"items": { "type": "string" }
|
|
115
106
|
},
|
|
116
107
|
"retry": {
|
|
117
|
-
"$ref": "#/definitions/
|
|
118
|
-
|
|
108
|
+
"$ref": "#/definitions/Retry"
|
|
109
|
+
},
|
|
110
|
+
"timeoutMs": {
|
|
111
|
+
"type": "integer",
|
|
112
|
+
"minimum": 1
|
|
119
113
|
},
|
|
120
114
|
"on_error": {
|
|
121
|
-
"$ref": "#/definitions/ErrorHandler"
|
|
122
|
-
"description": "Error handling configuration"
|
|
115
|
+
"$ref": "#/definitions/ErrorHandler"
|
|
123
116
|
},
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"description": "Rollback/compensation configuration"
|
|
117
|
+
"condition": {
|
|
118
|
+
"type": "string"
|
|
127
119
|
},
|
|
128
|
-
"
|
|
129
|
-
"type": "
|
|
130
|
-
"
|
|
131
|
-
"type": "string"
|
|
132
|
-
},
|
|
133
|
-
"description": "Array of step_ids this step depends on"
|
|
120
|
+
"expect": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"description": "Expected output for testing"
|
|
134
123
|
}
|
|
135
124
|
}
|
|
136
125
|
},
|
|
137
126
|
"ForeachStep": {
|
|
138
127
|
"type": "object",
|
|
139
|
-
"required": ["step_id", "type", "iterator", "
|
|
140
|
-
"additionalProperties":
|
|
128
|
+
"required": ["step_id", "type", "iterator", "body"],
|
|
129
|
+
"additionalProperties": true,
|
|
141
130
|
"properties": {
|
|
142
131
|
"step_id": {
|
|
143
132
|
"type": "string",
|
|
133
|
+
"minLength": 1,
|
|
144
134
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
145
135
|
},
|
|
146
136
|
"type": {
|
|
137
|
+
"type": "string",
|
|
147
138
|
"const": "foreach"
|
|
148
139
|
},
|
|
149
|
-
"name": {
|
|
150
|
-
"type": "string"
|
|
151
|
-
},
|
|
152
140
|
"iterator": {
|
|
153
141
|
"type": "string",
|
|
154
|
-
"
|
|
155
|
-
"description": "Reference to array to iterate over"
|
|
142
|
+
"minLength": 1
|
|
156
143
|
},
|
|
157
|
-
"
|
|
158
|
-
"type": "array",
|
|
159
|
-
"minItems": 1,
|
|
160
|
-
"items": {
|
|
161
|
-
"$ref": "#/definitions/Step"
|
|
162
|
-
},
|
|
163
|
-
"description": "Steps to execute for each item"
|
|
164
|
-
},
|
|
165
|
-
"output": {
|
|
144
|
+
"body": {
|
|
166
145
|
"type": "object",
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
|
|
170
|
-
"max_concurrency": {
|
|
171
|
-
"type": "integer",
|
|
172
|
-
"minimum": 1,
|
|
173
|
-
"description": "Maximum parallel executions"
|
|
174
|
-
},
|
|
175
|
-
"on_error": {
|
|
176
|
-
"$ref": "#/definitions/ErrorHandler"
|
|
177
|
-
},
|
|
178
|
-
"depends_on": {
|
|
179
|
-
"type": "array",
|
|
180
|
-
"items": {
|
|
181
|
-
"type": "string"
|
|
146
|
+
"minProperties": 1,
|
|
147
|
+
"additionalProperties": {
|
|
148
|
+
"$ref": "#/definitions/Step"
|
|
182
149
|
}
|
|
183
150
|
}
|
|
184
151
|
}
|
|
@@ -186,543 +153,193 @@
|
|
|
186
153
|
"ForkJoinStep": {
|
|
187
154
|
"type": "object",
|
|
188
155
|
"required": ["step_id", "type", "branches", "join"],
|
|
189
|
-
"additionalProperties":
|
|
156
|
+
"additionalProperties": true,
|
|
190
157
|
"properties": {
|
|
191
158
|
"step_id": {
|
|
192
159
|
"type": "string",
|
|
160
|
+
"minLength": 1,
|
|
193
161
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
194
162
|
},
|
|
195
163
|
"type": {
|
|
164
|
+
"type": "string",
|
|
196
165
|
"const": "fork_join"
|
|
197
166
|
},
|
|
198
|
-
"name": {
|
|
199
|
-
"type": "string"
|
|
200
|
-
},
|
|
201
167
|
"branches": {
|
|
202
|
-
"type": "
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
|
|
207
|
-
"properties": {
|
|
208
|
-
"branch_id": {
|
|
209
|
-
"type": "string"
|
|
210
|
-
},
|
|
211
|
-
"steps": {
|
|
212
|
-
"type": "array",
|
|
213
|
-
"minItems": 1,
|
|
214
|
-
"items": {
|
|
215
|
-
"$ref": "#/definitions/Step"
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
"description": "Parallel branches to execute"
|
|
168
|
+
"type": "object",
|
|
169
|
+
"minProperties": 1,
|
|
170
|
+
"additionalProperties": {
|
|
171
|
+
"$ref": "#/definitions/Step"
|
|
172
|
+
}
|
|
221
173
|
},
|
|
222
174
|
"join": {
|
|
223
175
|
"type": "object",
|
|
224
176
|
"required": ["strategy"],
|
|
225
177
|
"properties": {
|
|
226
178
|
"strategy": {
|
|
227
|
-
"
|
|
228
|
-
"
|
|
179
|
+
"type": "string",
|
|
180
|
+
"enum": ["merge", "first", "last", "all", "custom"]
|
|
229
181
|
},
|
|
230
|
-
"
|
|
231
|
-
"type": "
|
|
232
|
-
"minimum": 1
|
|
182
|
+
"output": {
|
|
183
|
+
"type": "object"
|
|
233
184
|
}
|
|
234
185
|
}
|
|
235
|
-
},
|
|
236
|
-
"output": {
|
|
237
|
-
"type": "object",
|
|
238
|
-
"additionalProperties": true
|
|
239
|
-
},
|
|
240
|
-
"on_error": {
|
|
241
|
-
"$ref": "#/definitions/ErrorHandler"
|
|
242
|
-
},
|
|
243
|
-
"depends_on": {
|
|
244
|
-
"type": "array",
|
|
245
|
-
"items": {
|
|
246
|
-
"type": "string"
|
|
247
|
-
}
|
|
248
186
|
}
|
|
249
187
|
}
|
|
250
188
|
},
|
|
251
189
|
"SwitchStep": {
|
|
252
190
|
"type": "object",
|
|
253
|
-
"required": ["step_id", "type", "expression", "cases"
|
|
254
|
-
"additionalProperties":
|
|
191
|
+
"required": ["step_id", "type", "expression", "cases"],
|
|
192
|
+
"additionalProperties": true,
|
|
255
193
|
"properties": {
|
|
256
194
|
"step_id": {
|
|
257
195
|
"type": "string",
|
|
196
|
+
"minLength": 1,
|
|
258
197
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
259
198
|
},
|
|
260
199
|
"type": {
|
|
200
|
+
"type": "string",
|
|
261
201
|
"const": "switch"
|
|
262
202
|
},
|
|
263
|
-
"name": {
|
|
264
|
-
"type": "string"
|
|
265
|
-
},
|
|
266
203
|
"expression": {
|
|
267
204
|
"type": "string",
|
|
268
|
-
"
|
|
269
|
-
"description": "Expression to evaluate for switch"
|
|
205
|
+
"minLength": 1
|
|
270
206
|
},
|
|
271
207
|
"cases": {
|
|
272
208
|
"type": "object",
|
|
209
|
+
"minProperties": 1,
|
|
273
210
|
"additionalProperties": {
|
|
274
|
-
"
|
|
275
|
-
|
|
276
|
-
"properties": {
|
|
277
|
-
"steps": {
|
|
278
|
-
"type": "array",
|
|
279
|
-
"minItems": 1,
|
|
280
|
-
"items": {
|
|
281
|
-
"$ref": "#/definitions/Step"
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
"description": "Case branches"
|
|
211
|
+
"$ref": "#/definitions/Step"
|
|
212
|
+
}
|
|
287
213
|
},
|
|
288
214
|
"default": {
|
|
289
|
-
"
|
|
290
|
-
"required": ["steps"],
|
|
291
|
-
"properties": {
|
|
292
|
-
"steps": {
|
|
293
|
-
"type": "array",
|
|
294
|
-
"minItems": 1,
|
|
295
|
-
"items": {
|
|
296
|
-
"$ref": "#/definitions/Step"
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
"description": "Default branch (required)"
|
|
301
|
-
},
|
|
302
|
-
"on_error": {
|
|
303
|
-
"$ref": "#/definitions/ErrorHandler"
|
|
304
|
-
},
|
|
305
|
-
"depends_on": {
|
|
306
|
-
"type": "array",
|
|
307
|
-
"items": {
|
|
308
|
-
"type": "string"
|
|
309
|
-
}
|
|
215
|
+
"$ref": "#/definitions/Step"
|
|
310
216
|
}
|
|
311
217
|
}
|
|
312
218
|
},
|
|
313
219
|
"SubWorkflowStep": {
|
|
314
220
|
"type": "object",
|
|
315
|
-
"required": ["step_id", "type", "
|
|
316
|
-
"additionalProperties":
|
|
221
|
+
"required": ["step_id", "type", "steps"],
|
|
222
|
+
"additionalProperties": true,
|
|
317
223
|
"properties": {
|
|
318
224
|
"step_id": {
|
|
319
225
|
"type": "string",
|
|
226
|
+
"minLength": 1,
|
|
320
227
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
321
228
|
},
|
|
322
229
|
"type": {
|
|
323
|
-
"const": "sub_workflow"
|
|
324
|
-
},
|
|
325
|
-
"name": {
|
|
326
|
-
"type": "string"
|
|
327
|
-
},
|
|
328
|
-
"workflow_id": {
|
|
329
230
|
"type": "string",
|
|
330
|
-
"
|
|
231
|
+
"const": "sub_workflow"
|
|
331
232
|
},
|
|
332
|
-
"
|
|
333
|
-
"type": "object"
|
|
334
|
-
"additionalProperties": true,
|
|
335
|
-
"description": "Parameters to pass to sub-workflow"
|
|
233
|
+
"input": {
|
|
234
|
+
"type": "object"
|
|
336
235
|
},
|
|
337
|
-
"
|
|
236
|
+
"steps": {
|
|
338
237
|
"type": "object",
|
|
339
|
-
"
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
"type": "integer",
|
|
343
|
-
"minimum": 1
|
|
344
|
-
},
|
|
345
|
-
"on_error": {
|
|
346
|
-
"$ref": "#/definitions/ErrorHandler"
|
|
347
|
-
},
|
|
348
|
-
"depends_on": {
|
|
349
|
-
"type": "array",
|
|
350
|
-
"items": {
|
|
351
|
-
"type": "string"
|
|
238
|
+
"minProperties": 1,
|
|
239
|
+
"additionalProperties": {
|
|
240
|
+
"$ref": "#/definitions/Step"
|
|
352
241
|
}
|
|
353
242
|
}
|
|
354
243
|
}
|
|
355
244
|
},
|
|
356
245
|
"WaitStep": {
|
|
357
246
|
"type": "object",
|
|
358
|
-
"required": ["step_id", "type", "
|
|
359
|
-
"additionalProperties":
|
|
247
|
+
"required": ["step_id", "type", "durationMs"],
|
|
248
|
+
"additionalProperties": true,
|
|
360
249
|
"properties": {
|
|
361
250
|
"step_id": {
|
|
362
251
|
"type": "string",
|
|
252
|
+
"minLength": 1,
|
|
363
253
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
364
254
|
},
|
|
365
255
|
"type": {
|
|
256
|
+
"type": "string",
|
|
366
257
|
"const": "wait"
|
|
367
258
|
},
|
|
368
|
-
"
|
|
369
|
-
"type": "string"
|
|
370
|
-
},
|
|
371
|
-
"duration_ms": {
|
|
259
|
+
"durationMs": {
|
|
372
260
|
"type": "integer",
|
|
373
|
-
"minimum":
|
|
374
|
-
"description": "Wait duration in milliseconds"
|
|
375
|
-
},
|
|
376
|
-
"message": {
|
|
377
|
-
"type": "string",
|
|
378
|
-
"description": "Optional message explaining the wait"
|
|
379
|
-
},
|
|
380
|
-
"depends_on": {
|
|
381
|
-
"type": "array",
|
|
382
|
-
"items": {
|
|
383
|
-
"type": "string"
|
|
384
|
-
}
|
|
261
|
+
"minimum": 0
|
|
385
262
|
}
|
|
386
263
|
}
|
|
387
264
|
},
|
|
388
265
|
"DispatchStep": {
|
|
389
266
|
"type": "object",
|
|
390
267
|
"required": ["step_id", "type", "method", "target"],
|
|
391
|
-
"additionalProperties":
|
|
268
|
+
"additionalProperties": true,
|
|
392
269
|
"properties": {
|
|
393
270
|
"step_id": {
|
|
394
271
|
"type": "string",
|
|
272
|
+
"minLength": 1,
|
|
395
273
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
396
274
|
},
|
|
397
275
|
"type": {
|
|
276
|
+
"type": "string",
|
|
398
277
|
"const": "dispatch"
|
|
399
278
|
},
|
|
400
|
-
"name": {
|
|
401
|
-
"type": "string"
|
|
402
|
-
},
|
|
403
279
|
"method": {
|
|
404
|
-
"
|
|
405
|
-
"
|
|
280
|
+
"type": "string",
|
|
281
|
+
"enum": ["webhook", "http", "grpc", "kafka", "sqs", "custom"]
|
|
406
282
|
},
|
|
407
283
|
"target": {
|
|
408
284
|
"type": "string",
|
|
409
|
-
"
|
|
285
|
+
"format": "uri"
|
|
410
286
|
},
|
|
411
287
|
"input": {
|
|
412
|
-
"type": "object"
|
|
413
|
-
"additionalProperties": true
|
|
414
|
-
},
|
|
415
|
-
"headers": {
|
|
416
|
-
"type": "object",
|
|
417
|
-
"additionalProperties": {
|
|
418
|
-
"type": "string"
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
"timeout_ms": {
|
|
422
|
-
"type": "integer",
|
|
423
|
-
"minimum": 1
|
|
288
|
+
"type": "object"
|
|
424
289
|
},
|
|
425
290
|
"retry": {
|
|
426
|
-
"$ref": "#/definitions/
|
|
427
|
-
},
|
|
428
|
-
"on_error": {
|
|
429
|
-
"$ref": "#/definitions/ErrorHandler"
|
|
430
|
-
},
|
|
431
|
-
"depends_on": {
|
|
432
|
-
"type": "array",
|
|
433
|
-
"items": {
|
|
434
|
-
"type": "string"
|
|
435
|
-
}
|
|
291
|
+
"$ref": "#/definitions/Retry"
|
|
436
292
|
}
|
|
437
293
|
}
|
|
438
294
|
},
|
|
439
|
-
"
|
|
295
|
+
"Retry": {
|
|
440
296
|
"type": "object",
|
|
297
|
+
"required": ["maxAttempts", "delayMs"],
|
|
441
298
|
"additionalProperties": false,
|
|
442
299
|
"properties": {
|
|
443
|
-
"
|
|
300
|
+
"maxAttempts": {
|
|
444
301
|
"type": "integer",
|
|
445
|
-
"minimum": 1
|
|
446
|
-
"description": "Maximum retry attempts"
|
|
302
|
+
"minimum": 1
|
|
447
303
|
},
|
|
448
|
-
"
|
|
304
|
+
"delayMs": {
|
|
449
305
|
"type": "integer",
|
|
450
|
-
"minimum": 0
|
|
451
|
-
"description": "Delay between retries in milliseconds"
|
|
306
|
+
"minimum": 0
|
|
452
307
|
},
|
|
453
|
-
"
|
|
454
|
-
"
|
|
455
|
-
"
|
|
456
|
-
|
|
457
|
-
"max_delay_ms": {
|
|
458
|
-
"type": "integer",
|
|
459
|
-
"minimum": 1,
|
|
460
|
-
"description": "Maximum delay for exponential backoff"
|
|
308
|
+
"backoffMultiplier": {
|
|
309
|
+
"type": "number",
|
|
310
|
+
"minimum": 1.0,
|
|
311
|
+
"maximum": 5.0
|
|
461
312
|
}
|
|
462
313
|
}
|
|
463
314
|
},
|
|
464
315
|
"ErrorHandler": {
|
|
465
316
|
"type": "object",
|
|
317
|
+
"required": ["strategy"],
|
|
466
318
|
"additionalProperties": false,
|
|
467
319
|
"properties": {
|
|
468
320
|
"strategy": {
|
|
469
|
-
"enum": ["retry", "fail", "continue", "compensate"],
|
|
470
|
-
"description": "Error handling strategy"
|
|
471
|
-
},
|
|
472
|
-
"retry": {
|
|
473
|
-
"$ref": "#/definitions/RetryConfig"
|
|
474
|
-
},
|
|
475
|
-
"catch": {
|
|
476
|
-
"type": "array",
|
|
477
|
-
"items": {
|
|
478
|
-
"type": "object",
|
|
479
|
-
"required": ["error_type", "handler_step"],
|
|
480
|
-
"properties": {
|
|
481
|
-
"error_type": {
|
|
482
|
-
"type": "string",
|
|
483
|
-
"description": "Type of error to catch"
|
|
484
|
-
},
|
|
485
|
-
"handler_step": {
|
|
486
|
-
"type": "string",
|
|
487
|
-
"description": "Step to execute on this error"
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
"description": "Specific error handlers"
|
|
492
|
-
},
|
|
493
|
-
"finally": {
|
|
494
|
-
"type": "string",
|
|
495
|
-
"description": "Step to always execute"
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
},
|
|
499
|
-
"CompensationStep": {
|
|
500
|
-
"type": "object",
|
|
501
|
-
"required": ["step_id", "service", "operation"],
|
|
502
|
-
"additionalProperties": false,
|
|
503
|
-
"properties": {
|
|
504
|
-
"step_id": {
|
|
505
|
-
"type": "string",
|
|
506
|
-
"pattern": "^[a-zA-Z0-9_]+$",
|
|
507
|
-
"description": "ID for compensation step"
|
|
508
|
-
},
|
|
509
|
-
"service": {
|
|
510
|
-
"type": "string",
|
|
511
|
-
"pattern": "^[a-z0-9-]+$"
|
|
512
|
-
},
|
|
513
|
-
"operation": {
|
|
514
|
-
"type": "string"
|
|
515
|
-
},
|
|
516
|
-
"input": {
|
|
517
|
-
"type": "object",
|
|
518
|
-
"additionalProperties": true
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
},
|
|
522
|
-
"DeliveryConfig": {
|
|
523
|
-
"type": "object",
|
|
524
|
-
"required": ["handler"],
|
|
525
|
-
"additionalProperties": false,
|
|
526
|
-
"properties": {
|
|
527
|
-
"handler": {
|
|
528
|
-
"enum": ["dispatcher", "service_step", "none"],
|
|
529
|
-
"description": "Delivery handler selection"
|
|
530
|
-
},
|
|
531
|
-
"allow_skip": {
|
|
532
|
-
"type": "boolean",
|
|
533
|
-
"default": false,
|
|
534
|
-
"description": "Allow dispatcher to skip delivery without failing workflow"
|
|
535
|
-
},
|
|
536
|
-
"delivery_step": {
|
|
537
|
-
"type": "string",
|
|
538
|
-
"pattern": "^[a-zA-Z0-9_]+$",
|
|
539
|
-
"description": "Step ID that performs delivery when handler=service_step"
|
|
540
|
-
},
|
|
541
|
-
"destinations": {
|
|
542
|
-
"type": "array",
|
|
543
|
-
"items": {
|
|
544
|
-
"$ref": "#/definitions/DeliveryDestination"
|
|
545
|
-
},
|
|
546
|
-
"default": []
|
|
547
|
-
},
|
|
548
|
-
"output": {
|
|
549
|
-
"$ref": "#/definitions/DeliveryOutput"
|
|
550
|
-
}
|
|
551
|
-
},
|
|
552
|
-
"allOf": [
|
|
553
|
-
{
|
|
554
|
-
"if": {
|
|
555
|
-
"properties": {
|
|
556
|
-
"handler": { "const": "dispatcher" }
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
"then": {
|
|
560
|
-
"required": ["destinations", "output"],
|
|
561
|
-
"properties": {
|
|
562
|
-
"destinations": {
|
|
563
|
-
"minItems": 1
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
"if": {
|
|
570
|
-
"properties": {
|
|
571
|
-
"handler": { "const": "service_step" }
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
"then": {
|
|
575
|
-
"required": ["delivery_step", "output"]
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
]
|
|
579
|
-
},
|
|
580
|
-
"DeliveryDestination": {
|
|
581
|
-
"type": "object",
|
|
582
|
-
"required": ["type"],
|
|
583
|
-
"properties": {
|
|
584
|
-
"type": {
|
|
585
|
-
"enum": ["webhook", "websocket", "public_url"],
|
|
586
|
-
"description": "Delivery channel type"
|
|
587
|
-
},
|
|
588
|
-
"name": {
|
|
589
|
-
"type": "string",
|
|
590
|
-
"pattern": "^[a-zA-Z0-9._-]+$",
|
|
591
|
-
"description": "Optional identifier for monitoring"
|
|
592
|
-
},
|
|
593
|
-
"enabled": {
|
|
594
|
-
"type": "boolean",
|
|
595
|
-
"default": true
|
|
596
|
-
},
|
|
597
|
-
"retry": {
|
|
598
|
-
"$ref": "#/definitions/RetryConfig"
|
|
599
|
-
}
|
|
600
|
-
},
|
|
601
|
-
"allOf": [
|
|
602
|
-
{
|
|
603
|
-
"if": {
|
|
604
|
-
"properties": {
|
|
605
|
-
"type": { "const": "webhook" }
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
"then": {
|
|
609
|
-
"$ref": "#/definitions/DeliveryWebhookOptions"
|
|
610
|
-
}
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
"if": {
|
|
614
|
-
"properties": {
|
|
615
|
-
"type": { "const": "websocket" }
|
|
616
|
-
}
|
|
617
|
-
},
|
|
618
|
-
"then": {
|
|
619
|
-
"$ref": "#/definitions/DeliveryWebsocketOptions"
|
|
620
|
-
}
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
"if": {
|
|
624
|
-
"properties": {
|
|
625
|
-
"type": { "const": "public_url" }
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
"then": {
|
|
629
|
-
"$ref": "#/definitions/DeliveryPublicUrlOptions"
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
]
|
|
633
|
-
},
|
|
634
|
-
"DeliveryWebhookOptions": {
|
|
635
|
-
"type": "object",
|
|
636
|
-
"required": ["url", "method"],
|
|
637
|
-
"properties": {
|
|
638
|
-
"url": {
|
|
639
|
-
"type": "string",
|
|
640
|
-
"format": "uri",
|
|
641
|
-
"description": "Target webhook URL"
|
|
642
|
-
},
|
|
643
|
-
"method": {
|
|
644
321
|
"type": "string",
|
|
645
|
-
"enum": ["
|
|
646
|
-
},
|
|
647
|
-
"headers": {
|
|
648
|
-
"type": "object",
|
|
649
|
-
"additionalProperties": {
|
|
650
|
-
"type": "string"
|
|
651
|
-
}
|
|
652
|
-
},
|
|
653
|
-
"body_template": {
|
|
654
|
-
"type": ["object", "array"],
|
|
655
|
-
"description": "Optional custom payload template"
|
|
322
|
+
"enum": ["retry", "fail", "continue", "compensate", "fallback"]
|
|
656
323
|
},
|
|
657
|
-
"
|
|
324
|
+
"retries": {
|
|
658
325
|
"type": "integer",
|
|
659
|
-
"minimum":
|
|
660
|
-
"
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
},
|
|
664
|
-
"DeliveryWebsocketOptions": {
|
|
665
|
-
"type": "object",
|
|
666
|
-
"properties": {
|
|
667
|
-
"client_id": {
|
|
668
|
-
"type": "string",
|
|
669
|
-
"description": "Client session identifier"
|
|
670
|
-
},
|
|
671
|
-
"tenant_id": {
|
|
672
|
-
"type": "string",
|
|
673
|
-
"description": "Tenant/topic identifier"
|
|
674
|
-
},
|
|
675
|
-
"events": {
|
|
676
|
-
"type": "array",
|
|
677
|
-
"items": {
|
|
678
|
-
"type": "string"
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
"anyOf": [
|
|
683
|
-
{ "required": ["client_id"] },
|
|
684
|
-
{ "required": ["tenant_id"] }
|
|
685
|
-
]
|
|
686
|
-
},
|
|
687
|
-
"DeliveryPublicUrlOptions": {
|
|
688
|
-
"type": "object",
|
|
689
|
-
"required": ["path"],
|
|
690
|
-
"properties": {
|
|
691
|
-
"path": {
|
|
692
|
-
"type": "string",
|
|
693
|
-
"pattern": "^[a-zA-Z0-9._\\-/\\${}]+$",
|
|
694
|
-
"description": "Storage key / relative path"
|
|
326
|
+
"minimum": 0,
|
|
327
|
+
"maximum": 10
|
|
695
328
|
},
|
|
696
|
-
"
|
|
329
|
+
"retryDelayMs": {
|
|
697
330
|
"type": "integer",
|
|
698
|
-
"minimum":
|
|
699
|
-
"description": "Time to live for generated URL"
|
|
331
|
+
"minimum": 0
|
|
700
332
|
},
|
|
701
|
-
"
|
|
702
|
-
"type": "string"
|
|
703
|
-
"enum": ["public", "signed"],
|
|
704
|
-
"default": "signed"
|
|
333
|
+
"fallbackStep": {
|
|
334
|
+
"type": "string"
|
|
705
335
|
},
|
|
706
|
-
"
|
|
707
|
-
"type": "
|
|
708
|
-
|
|
336
|
+
"compensationStep": {
|
|
337
|
+
"type": "string"
|
|
338
|
+
},
|
|
339
|
+
"errorOutput": {
|
|
340
|
+
"type": "string"
|
|
709
341
|
}
|
|
710
342
|
}
|
|
711
|
-
},
|
|
712
|
-
"DeliveryOutput": {
|
|
713
|
-
"type": "object",
|
|
714
|
-
"propertyNames": {
|
|
715
|
-
"pattern": "^[a-zA-Z0-9_]+$"
|
|
716
|
-
},
|
|
717
|
-
"additionalProperties": {
|
|
718
|
-
"type": [
|
|
719
|
-
"string",
|
|
720
|
-
"number",
|
|
721
|
-
"boolean",
|
|
722
|
-
"object",
|
|
723
|
-
"array"
|
|
724
|
-
]
|
|
725
|
-
}
|
|
726
343
|
}
|
|
727
344
|
}
|
|
728
|
-
}
|
|
345
|
+
}
|