@onlineapps/conn-orch-orchestrator 1.0.49 → 1.0.50
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/src/WorkflowOrchestrator.js +22 -11
package/package.json
CHANGED
|
@@ -145,13 +145,15 @@ class WorkflowOrchestrator {
|
|
|
145
145
|
const updatedSteps = [...stepsArray];
|
|
146
146
|
updatedSteps[currentIndex] = {
|
|
147
147
|
...step,
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
_execution: {
|
|
149
|
+
status: 'in_progress',
|
|
150
|
+
started_at: new Date().toISOString()
|
|
151
|
+
}
|
|
150
152
|
};
|
|
151
153
|
|
|
152
|
-
// Execute the step (pass
|
|
154
|
+
// Execute the step (pass api_input from cookbook as context for operations)
|
|
153
155
|
const stepContext = {
|
|
154
|
-
...cookbookDef.
|
|
156
|
+
...cookbookDef.api_input,
|
|
155
157
|
_system: cookbookDef._system,
|
|
156
158
|
delivery: cookbookDef.delivery
|
|
157
159
|
};
|
|
@@ -177,14 +179,16 @@ class WorkflowOrchestrator {
|
|
|
177
179
|
? this._getStepId(nextStep)
|
|
178
180
|
: 'api_delivery_dispatcher'; // Last step -> dispatcher
|
|
179
181
|
|
|
180
|
-
// Update step with output and
|
|
182
|
+
// Update step with output and execution metadata
|
|
181
183
|
updatedSteps[currentIndex] = {
|
|
182
184
|
...step,
|
|
183
|
-
started_at: updatedSteps[currentIndex].started_at,
|
|
184
185
|
output: result,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
_execution: {
|
|
187
|
+
status: 'completed',
|
|
188
|
+
started_at: updatedSteps[currentIndex]._execution?.started_at || new Date().toISOString(),
|
|
189
|
+
completed_at: new Date().toISOString(),
|
|
190
|
+
duration_ms
|
|
191
|
+
}
|
|
188
192
|
};
|
|
189
193
|
|
|
190
194
|
// Build UPDATED UNIFIED COOKBOOK
|
|
@@ -267,7 +271,10 @@ class WorkflowOrchestrator {
|
|
|
267
271
|
const updatedSteps = [...stepsArray];
|
|
268
272
|
updatedSteps[currentIndex] = {
|
|
269
273
|
...currentStepDef,
|
|
270
|
-
|
|
274
|
+
_execution: {
|
|
275
|
+
...currentStepDef._execution,
|
|
276
|
+
status: 'retrying'
|
|
277
|
+
},
|
|
271
278
|
_retry_history: [...stepRetryHistory, attemptRecord]
|
|
272
279
|
};
|
|
273
280
|
|
|
@@ -353,7 +360,11 @@ class WorkflowOrchestrator {
|
|
|
353
360
|
|
|
354
361
|
updatedSteps[currentIndex] = {
|
|
355
362
|
...updatedSteps[currentIndex],
|
|
356
|
-
|
|
363
|
+
_execution: {
|
|
364
|
+
...updatedSteps[currentIndex]._execution,
|
|
365
|
+
status: 'failed',
|
|
366
|
+
failed_at: new Date().toISOString()
|
|
367
|
+
},
|
|
357
368
|
_retry_history: [...updatedSteps[currentIndex]._retry_history, dlqEntryRecord]
|
|
358
369
|
};
|
|
359
370
|
|