@onlineapps/conn-orch-orchestrator 1.0.41 → 1.0.43
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 +6 -6
- package/src/WorkflowOrchestrator.js +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/conn-orch-orchestrator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"description": "Workflow orchestration connector for OA Drive - handles message routing and workflow execution",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@onlineapps/conn-base-monitoring": "^1.0.0",
|
|
24
|
-
"@onlineapps/conn-infra-mq": "1.1.
|
|
25
|
-
"@onlineapps/conn-orch-
|
|
26
|
-
"@onlineapps/conn-orch-cookbook": "
|
|
27
|
-
"@onlineapps/conn-orch-
|
|
24
|
+
"@onlineapps/conn-infra-mq": "^1.1.0",
|
|
25
|
+
"@onlineapps/conn-orch-registry": "^1.1.4",
|
|
26
|
+
"@onlineapps/conn-orch-cookbook": "2.0.4",
|
|
27
|
+
"@onlineapps/conn-orch-api-mapper": "^1.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"eslint": "^8.30.0",
|
|
31
30
|
"jest": "^29.5.0",
|
|
31
|
+
"eslint": "^8.30.0",
|
|
32
32
|
"jsdoc-to-markdown": "^8.0.0"
|
|
33
33
|
},
|
|
34
34
|
"jest": {
|
|
@@ -230,7 +230,7 @@ class WorkflowOrchestrator {
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
} catch (error) {
|
|
233
|
-
// Publish to workflow.failed queue
|
|
233
|
+
// Publish to workflow.failed queue with FULL context for monitoring
|
|
234
234
|
try {
|
|
235
235
|
console.log(`[WorkflowOrchestrator] [PUBLISH] Preparing to publish workflow.failed for ${workflow_id}`);
|
|
236
236
|
this.logger.error(`[WorkflowOrchestrator] [PUBLISH] Workflow processing failed: ${error.message}`, {
|
|
@@ -239,9 +239,24 @@ class WorkflowOrchestrator {
|
|
|
239
239
|
error: error.stack
|
|
240
240
|
});
|
|
241
241
|
|
|
242
|
+
// Calculate step_index for failed step
|
|
243
|
+
let failedStepIndex = 0;
|
|
244
|
+
try {
|
|
245
|
+
const stepsArr = this._getStepsArray(cookbookDef);
|
|
246
|
+
const idx = stepsArr.findIndex(s => this._getStepId(s) === current_step);
|
|
247
|
+
if (idx >= 0) failedStepIndex = idx;
|
|
248
|
+
} catch (e) {
|
|
249
|
+
// Ignore - use default 0
|
|
250
|
+
}
|
|
251
|
+
|
|
242
252
|
await this.mqClient.publish('workflow.failed', {
|
|
243
253
|
workflow_id,
|
|
244
254
|
current_step,
|
|
255
|
+
step_id: current_step, // Explicit step_id for monitoring
|
|
256
|
+
step_index: failedStepIndex, // Step index for ordering
|
|
257
|
+
service: serviceName, // Service that failed
|
|
258
|
+
cookbook: cookbookDef, // Full cookbook for context
|
|
259
|
+
context: context, // Full context
|
|
245
260
|
error: error.message,
|
|
246
261
|
errorStack: error.stack,
|
|
247
262
|
failed_at: new Date().toISOString()
|