@onlineapps/cookbook-core 2.1.4 → 2.1.7
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 -3
- package/schemas/cookbook.schema.json +211 -74
- package/schemas/cookbook.v2.schema.json +519 -136
- package/src/parser/cookbookValidatorV2.js +24 -19
|
@@ -1,56 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$
|
|
3
|
+
"$id": "https://onlineapps.com/schemas/cookbook/v2.1.0/cookbook.schema.json",
|
|
4
|
+
"title": "Cookbook Workflow Schema v2.1",
|
|
5
|
+
"description": "Schema for defining workflow orchestration with snake_case convention",
|
|
4
6
|
"type": "object",
|
|
5
|
-
"required": ["
|
|
6
|
-
"additionalProperties":
|
|
7
|
+
"required": ["version", "steps"],
|
|
8
|
+
"additionalProperties": false,
|
|
7
9
|
"properties": {
|
|
8
|
-
"name": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"minLength": 1
|
|
11
|
-
},
|
|
12
10
|
"version": {
|
|
13
11
|
"type": "string",
|
|
14
12
|
"pattern": "^2\\.\\d+\\.\\d+$",
|
|
15
|
-
"description": "
|
|
16
|
-
},
|
|
17
|
-
"description": {
|
|
18
|
-
"type": "string"
|
|
13
|
+
"description": "Schema version (must start with 2.x.x)"
|
|
19
14
|
},
|
|
20
|
-
"
|
|
21
|
-
"type": "
|
|
22
|
-
|
|
23
|
-
"global_error_handler": {
|
|
24
|
-
"$ref": "#/definitions/ErrorHandler",
|
|
25
|
-
"description": "Default error handling for all steps"
|
|
15
|
+
"name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Human-readable workflow name"
|
|
26
18
|
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"description": "
|
|
19
|
+
"description": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Workflow description"
|
|
30
22
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"description": "Maximum execution time for entire workflow in milliseconds"
|
|
23
|
+
"config": {
|
|
24
|
+
"$ref": "#/definitions/Config",
|
|
25
|
+
"description": "Global configuration and defaults"
|
|
35
26
|
},
|
|
36
|
-
"
|
|
27
|
+
"api_input": {
|
|
37
28
|
"type": "object",
|
|
29
|
+
"description": "Expected input parameters for the workflow",
|
|
38
30
|
"additionalProperties": true
|
|
39
31
|
},
|
|
40
32
|
"steps": {
|
|
41
|
-
"type": "
|
|
42
|
-
"
|
|
43
|
-
"
|
|
33
|
+
"type": "array",
|
|
34
|
+
"minItems": 1,
|
|
35
|
+
"items": {
|
|
44
36
|
"$ref": "#/definitions/Step"
|
|
45
37
|
},
|
|
46
|
-
"description": "
|
|
38
|
+
"description": "Array of workflow steps"
|
|
47
39
|
},
|
|
48
40
|
"delivery": {
|
|
49
|
-
"
|
|
50
|
-
"description": "Delivery
|
|
41
|
+
"$ref": "#/definitions/DeliveryConfig",
|
|
42
|
+
"description": "Delivery strategy and destinations for workflow output"
|
|
51
43
|
}
|
|
52
44
|
},
|
|
53
45
|
"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
|
+
},
|
|
54
61
|
"Step": {
|
|
55
62
|
"type": "object",
|
|
56
63
|
"required": ["step_id", "type"],
|
|
@@ -66,86 +73,112 @@
|
|
|
66
73
|
},
|
|
67
74
|
"TaskStep": {
|
|
68
75
|
"type": "object",
|
|
69
|
-
"required": ["step_id", "type", "service"],
|
|
70
|
-
"additionalProperties":
|
|
76
|
+
"required": ["step_id", "type", "service", "operation"],
|
|
77
|
+
"additionalProperties": false,
|
|
71
78
|
"properties": {
|
|
72
79
|
"step_id": {
|
|
73
80
|
"type": "string",
|
|
74
|
-
"minLength": 1,
|
|
75
81
|
"pattern": "^[a-zA-Z0-9_]+$",
|
|
76
|
-
"description": "
|
|
82
|
+
"description": "Unique identifier for the step"
|
|
77
83
|
},
|
|
78
84
|
"type": {
|
|
79
|
-
"
|
|
80
|
-
"
|
|
85
|
+
"const": "task",
|
|
86
|
+
"description": "Step type"
|
|
81
87
|
},
|
|
82
88
|
"name": {
|
|
83
89
|
"type": "string",
|
|
84
|
-
"
|
|
90
|
+
"description": "Human-readable step name"
|
|
85
91
|
},
|
|
86
92
|
"service": {
|
|
87
93
|
"type": "string",
|
|
88
|
-
"
|
|
94
|
+
"pattern": "^[a-z0-9-]+$",
|
|
95
|
+
"description": "Target microservice name"
|
|
89
96
|
},
|
|
90
97
|
"operation": {
|
|
91
98
|
"type": "string",
|
|
92
|
-
"
|
|
93
|
-
"description": "Operation identifier for the service to execute"
|
|
99
|
+
"description": "Operation ID from OpenAPI spec (required for task steps)"
|
|
94
100
|
},
|
|
95
101
|
"input": {
|
|
96
102
|
"type": "object",
|
|
97
|
-
"additionalProperties": true
|
|
103
|
+
"additionalProperties": true,
|
|
104
|
+
"description": "Input parameters for the operation"
|
|
98
105
|
},
|
|
99
106
|
"output": {
|
|
100
107
|
"type": "object",
|
|
101
|
-
"additionalProperties": true
|
|
108
|
+
"additionalProperties": true,
|
|
109
|
+
"description": "Output mapping to workflow context"
|
|
102
110
|
},
|
|
103
|
-
"
|
|
104
|
-
"type": "
|
|
105
|
-
"
|
|
111
|
+
"timeout_ms": {
|
|
112
|
+
"type": "integer",
|
|
113
|
+
"minimum": 1,
|
|
114
|
+
"description": "Timeout in milliseconds (overrides default)"
|
|
106
115
|
},
|
|
107
116
|
"retry": {
|
|
108
|
-
"$ref": "#/definitions/
|
|
109
|
-
|
|
110
|
-
"timeoutMs": {
|
|
111
|
-
"type": "integer",
|
|
112
|
-
"minimum": 1
|
|
117
|
+
"$ref": "#/definitions/RetryConfig",
|
|
118
|
+
"description": "Retry configuration (overrides default)"
|
|
113
119
|
},
|
|
114
120
|
"on_error": {
|
|
115
|
-
"$ref": "#/definitions/ErrorHandler"
|
|
121
|
+
"$ref": "#/definitions/ErrorHandler",
|
|
122
|
+
"description": "Error handling configuration"
|
|
116
123
|
},
|
|
117
|
-
"
|
|
118
|
-
"
|
|
124
|
+
"compensate": {
|
|
125
|
+
"$ref": "#/definitions/CompensationStep",
|
|
126
|
+
"description": "Rollback/compensation configuration"
|
|
119
127
|
},
|
|
120
|
-
"
|
|
121
|
-
"type": "
|
|
122
|
-
"
|
|
128
|
+
"depends_on": {
|
|
129
|
+
"type": "array",
|
|
130
|
+
"items": {
|
|
131
|
+
"type": "string"
|
|
132
|
+
},
|
|
133
|
+
"description": "Array of step_ids this step depends on"
|
|
123
134
|
}
|
|
124
135
|
}
|
|
125
136
|
},
|
|
126
137
|
"ForeachStep": {
|
|
127
138
|
"type": "object",
|
|
128
|
-
"required": ["step_id", "type", "iterator", "
|
|
129
|
-
"additionalProperties":
|
|
139
|
+
"required": ["step_id", "type", "iterator", "steps"],
|
|
140
|
+
"additionalProperties": false,
|
|
130
141
|
"properties": {
|
|
131
142
|
"step_id": {
|
|
132
143
|
"type": "string",
|
|
133
|
-
"minLength": 1,
|
|
134
144
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
135
145
|
},
|
|
136
146
|
"type": {
|
|
137
|
-
"type": "string",
|
|
138
147
|
"const": "foreach"
|
|
139
148
|
},
|
|
149
|
+
"name": {
|
|
150
|
+
"type": "string"
|
|
151
|
+
},
|
|
140
152
|
"iterator": {
|
|
141
153
|
"type": "string",
|
|
142
|
-
"
|
|
154
|
+
"pattern": "^\\$\\{.+\\}$",
|
|
155
|
+
"description": "Reference to array to iterate over"
|
|
143
156
|
},
|
|
144
|
-
"
|
|
145
|
-
"type": "
|
|
146
|
-
"
|
|
147
|
-
"
|
|
157
|
+
"steps": {
|
|
158
|
+
"type": "array",
|
|
159
|
+
"minItems": 1,
|
|
160
|
+
"items": {
|
|
148
161
|
"$ref": "#/definitions/Step"
|
|
162
|
+
},
|
|
163
|
+
"description": "Steps to execute for each item"
|
|
164
|
+
},
|
|
165
|
+
"output": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"additionalProperties": true,
|
|
168
|
+
"description": "How to aggregate results"
|
|
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"
|
|
149
182
|
}
|
|
150
183
|
}
|
|
151
184
|
}
|
|
@@ -153,193 +186,543 @@
|
|
|
153
186
|
"ForkJoinStep": {
|
|
154
187
|
"type": "object",
|
|
155
188
|
"required": ["step_id", "type", "branches", "join"],
|
|
156
|
-
"additionalProperties":
|
|
189
|
+
"additionalProperties": false,
|
|
157
190
|
"properties": {
|
|
158
191
|
"step_id": {
|
|
159
192
|
"type": "string",
|
|
160
|
-
"minLength": 1,
|
|
161
193
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
162
194
|
},
|
|
163
195
|
"type": {
|
|
164
|
-
"type": "string",
|
|
165
196
|
"const": "fork_join"
|
|
166
197
|
},
|
|
198
|
+
"name": {
|
|
199
|
+
"type": "string"
|
|
200
|
+
},
|
|
167
201
|
"branches": {
|
|
168
|
-
"type": "
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
|
|
202
|
+
"type": "array",
|
|
203
|
+
"minItems": 2,
|
|
204
|
+
"items": {
|
|
205
|
+
"type": "object",
|
|
206
|
+
"required": ["branch_id", "steps"],
|
|
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"
|
|
173
221
|
},
|
|
174
222
|
"join": {
|
|
175
223
|
"type": "object",
|
|
176
224
|
"required": ["strategy"],
|
|
177
225
|
"properties": {
|
|
178
226
|
"strategy": {
|
|
179
|
-
"
|
|
180
|
-
"
|
|
227
|
+
"enum": ["all", "first", "race", "merge"],
|
|
228
|
+
"description": "How to join branch results"
|
|
181
229
|
},
|
|
182
|
-
"
|
|
183
|
-
"type": "
|
|
230
|
+
"timeout_ms": {
|
|
231
|
+
"type": "integer",
|
|
232
|
+
"minimum": 1
|
|
184
233
|
}
|
|
185
234
|
}
|
|
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
|
+
}
|
|
186
248
|
}
|
|
187
249
|
}
|
|
188
250
|
},
|
|
189
251
|
"SwitchStep": {
|
|
190
252
|
"type": "object",
|
|
191
|
-
"required": ["step_id", "type", "expression", "cases"],
|
|
192
|
-
"additionalProperties":
|
|
253
|
+
"required": ["step_id", "type", "expression", "cases", "default"],
|
|
254
|
+
"additionalProperties": false,
|
|
193
255
|
"properties": {
|
|
194
256
|
"step_id": {
|
|
195
257
|
"type": "string",
|
|
196
|
-
"minLength": 1,
|
|
197
258
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
198
259
|
},
|
|
199
260
|
"type": {
|
|
200
|
-
"type": "string",
|
|
201
261
|
"const": "switch"
|
|
202
262
|
},
|
|
263
|
+
"name": {
|
|
264
|
+
"type": "string"
|
|
265
|
+
},
|
|
203
266
|
"expression": {
|
|
204
267
|
"type": "string",
|
|
205
|
-
"
|
|
268
|
+
"pattern": "^\\$\\{.+\\}$",
|
|
269
|
+
"description": "Expression to evaluate for switch"
|
|
206
270
|
},
|
|
207
271
|
"cases": {
|
|
208
272
|
"type": "object",
|
|
209
|
-
"minProperties": 1,
|
|
210
273
|
"additionalProperties": {
|
|
211
|
-
"
|
|
212
|
-
|
|
274
|
+
"type": "object",
|
|
275
|
+
"required": ["steps"],
|
|
276
|
+
"properties": {
|
|
277
|
+
"steps": {
|
|
278
|
+
"type": "array",
|
|
279
|
+
"minItems": 1,
|
|
280
|
+
"items": {
|
|
281
|
+
"$ref": "#/definitions/Step"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"description": "Case branches"
|
|
213
287
|
},
|
|
214
288
|
"default": {
|
|
215
|
-
"
|
|
289
|
+
"type": "object",
|
|
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
|
+
}
|
|
216
310
|
}
|
|
217
311
|
}
|
|
218
312
|
},
|
|
219
313
|
"SubWorkflowStep": {
|
|
220
314
|
"type": "object",
|
|
221
|
-
"required": ["step_id", "type", "
|
|
222
|
-
"additionalProperties":
|
|
315
|
+
"required": ["step_id", "type", "workflow_id"],
|
|
316
|
+
"additionalProperties": false,
|
|
223
317
|
"properties": {
|
|
224
318
|
"step_id": {
|
|
225
319
|
"type": "string",
|
|
226
|
-
"minLength": 1,
|
|
227
320
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
228
321
|
},
|
|
229
322
|
"type": {
|
|
230
|
-
"type": "string",
|
|
231
323
|
"const": "sub_workflow"
|
|
232
324
|
},
|
|
233
|
-
"
|
|
234
|
-
"type": "
|
|
325
|
+
"name": {
|
|
326
|
+
"type": "string"
|
|
235
327
|
},
|
|
236
|
-
"
|
|
328
|
+
"workflow_id": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"description": "ID of workflow to execute"
|
|
331
|
+
},
|
|
332
|
+
"parameters": {
|
|
237
333
|
"type": "object",
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
|
|
334
|
+
"additionalProperties": true,
|
|
335
|
+
"description": "Parameters to pass to sub-workflow"
|
|
336
|
+
},
|
|
337
|
+
"output": {
|
|
338
|
+
"type": "object",
|
|
339
|
+
"additionalProperties": true
|
|
340
|
+
},
|
|
341
|
+
"timeout_ms": {
|
|
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"
|
|
241
352
|
}
|
|
242
353
|
}
|
|
243
354
|
}
|
|
244
355
|
},
|
|
245
356
|
"WaitStep": {
|
|
246
357
|
"type": "object",
|
|
247
|
-
"required": ["step_id", "type", "
|
|
248
|
-
"additionalProperties":
|
|
358
|
+
"required": ["step_id", "type", "duration_ms"],
|
|
359
|
+
"additionalProperties": false,
|
|
249
360
|
"properties": {
|
|
250
361
|
"step_id": {
|
|
251
362
|
"type": "string",
|
|
252
|
-
"minLength": 1,
|
|
253
363
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
254
364
|
},
|
|
255
365
|
"type": {
|
|
256
|
-
"type": "string",
|
|
257
366
|
"const": "wait"
|
|
258
367
|
},
|
|
259
|
-
"
|
|
368
|
+
"name": {
|
|
369
|
+
"type": "string"
|
|
370
|
+
},
|
|
371
|
+
"duration_ms": {
|
|
260
372
|
"type": "integer",
|
|
261
|
-
"minimum":
|
|
373
|
+
"minimum": 1,
|
|
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
|
+
}
|
|
262
385
|
}
|
|
263
386
|
}
|
|
264
387
|
},
|
|
265
388
|
"DispatchStep": {
|
|
266
389
|
"type": "object",
|
|
267
390
|
"required": ["step_id", "type", "method", "target"],
|
|
268
|
-
"additionalProperties":
|
|
391
|
+
"additionalProperties": false,
|
|
269
392
|
"properties": {
|
|
270
393
|
"step_id": {
|
|
271
394
|
"type": "string",
|
|
272
|
-
"minLength": 1,
|
|
273
395
|
"pattern": "^[a-zA-Z0-9_]+$"
|
|
274
396
|
},
|
|
275
397
|
"type": {
|
|
276
|
-
"type": "string",
|
|
277
398
|
"const": "dispatch"
|
|
278
399
|
},
|
|
400
|
+
"name": {
|
|
401
|
+
"type": "string"
|
|
402
|
+
},
|
|
279
403
|
"method": {
|
|
280
|
-
"
|
|
281
|
-
"
|
|
404
|
+
"enum": ["webhook", "http", "grpc", "kafka", "sqs"],
|
|
405
|
+
"description": "Dispatch method"
|
|
282
406
|
},
|
|
283
407
|
"target": {
|
|
284
408
|
"type": "string",
|
|
285
|
-
"
|
|
409
|
+
"description": "Target URL or address"
|
|
286
410
|
},
|
|
287
411
|
"input": {
|
|
288
|
-
"type": "object"
|
|
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
|
|
289
424
|
},
|
|
290
425
|
"retry": {
|
|
291
|
-
"$ref": "#/definitions/
|
|
426
|
+
"$ref": "#/definitions/RetryConfig"
|
|
427
|
+
},
|
|
428
|
+
"on_error": {
|
|
429
|
+
"$ref": "#/definitions/ErrorHandler"
|
|
430
|
+
},
|
|
431
|
+
"depends_on": {
|
|
432
|
+
"type": "array",
|
|
433
|
+
"items": {
|
|
434
|
+
"type": "string"
|
|
435
|
+
}
|
|
292
436
|
}
|
|
293
437
|
}
|
|
294
438
|
},
|
|
295
|
-
"
|
|
439
|
+
"RetryConfig": {
|
|
296
440
|
"type": "object",
|
|
297
|
-
"required": ["maxAttempts", "delayMs"],
|
|
298
441
|
"additionalProperties": false,
|
|
299
442
|
"properties": {
|
|
300
|
-
"
|
|
443
|
+
"max_attempts": {
|
|
301
444
|
"type": "integer",
|
|
302
|
-
"minimum": 1
|
|
445
|
+
"minimum": 1,
|
|
446
|
+
"description": "Maximum retry attempts"
|
|
303
447
|
},
|
|
304
|
-
"
|
|
448
|
+
"delay_ms": {
|
|
305
449
|
"type": "integer",
|
|
306
|
-
"minimum": 0
|
|
450
|
+
"minimum": 0,
|
|
451
|
+
"description": "Delay between retries in milliseconds"
|
|
307
452
|
},
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
"
|
|
311
|
-
|
|
453
|
+
"backoff": {
|
|
454
|
+
"enum": ["linear", "exponential"],
|
|
455
|
+
"description": "Backoff strategy"
|
|
456
|
+
},
|
|
457
|
+
"max_delay_ms": {
|
|
458
|
+
"type": "integer",
|
|
459
|
+
"minimum": 1,
|
|
460
|
+
"description": "Maximum delay for exponential backoff"
|
|
312
461
|
}
|
|
313
462
|
}
|
|
314
463
|
},
|
|
315
464
|
"ErrorHandler": {
|
|
316
465
|
"type": "object",
|
|
317
|
-
"required": ["strategy"],
|
|
318
466
|
"additionalProperties": false,
|
|
319
467
|
"properties": {
|
|
320
468
|
"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": {
|
|
321
505
|
"type": "string",
|
|
322
|
-
"
|
|
506
|
+
"pattern": "^[a-zA-Z0-9_]+$",
|
|
507
|
+
"description": "ID for compensation step"
|
|
323
508
|
},
|
|
324
|
-
"
|
|
325
|
-
"type": "
|
|
326
|
-
"
|
|
327
|
-
|
|
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
|
+
"type": "string",
|
|
645
|
+
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]
|
|
646
|
+
},
|
|
647
|
+
"headers": {
|
|
648
|
+
"type": "object",
|
|
649
|
+
"additionalProperties": {
|
|
650
|
+
"type": "string"
|
|
651
|
+
}
|
|
328
652
|
},
|
|
329
|
-
"
|
|
653
|
+
"body_template": {
|
|
654
|
+
"type": ["object", "array"],
|
|
655
|
+
"description": "Optional custom payload template"
|
|
656
|
+
},
|
|
657
|
+
"timeout_ms": {
|
|
330
658
|
"type": "integer",
|
|
331
|
-
"minimum":
|
|
659
|
+
"minimum": 100,
|
|
660
|
+
"description": "Request timeout"
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
"DeliveryWebsocketOptions": {
|
|
665
|
+
"type": "object",
|
|
666
|
+
"properties": {
|
|
667
|
+
"client_id": {
|
|
668
|
+
"type": "string",
|
|
669
|
+
"description": "Client session identifier"
|
|
332
670
|
},
|
|
333
|
-
"
|
|
334
|
-
"type": "string"
|
|
671
|
+
"tenant_id": {
|
|
672
|
+
"type": "string",
|
|
673
|
+
"description": "Tenant/topic identifier"
|
|
335
674
|
},
|
|
336
|
-
"
|
|
337
|
-
"type": "
|
|
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"
|
|
338
695
|
},
|
|
339
|
-
"
|
|
340
|
-
"type": "
|
|
696
|
+
"ttl_seconds": {
|
|
697
|
+
"type": "integer",
|
|
698
|
+
"minimum": 60,
|
|
699
|
+
"description": "Time to live for generated URL"
|
|
700
|
+
},
|
|
701
|
+
"access": {
|
|
702
|
+
"type": "string",
|
|
703
|
+
"enum": ["public", "signed"],
|
|
704
|
+
"default": "signed"
|
|
705
|
+
},
|
|
706
|
+
"max_downloads": {
|
|
707
|
+
"type": "integer",
|
|
708
|
+
"minimum": 1
|
|
341
709
|
}
|
|
342
710
|
}
|
|
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
|
+
}
|
|
343
726
|
}
|
|
344
727
|
}
|
|
345
|
-
}
|
|
728
|
+
}
|