@onlineapps/conn-orch-orchestrator 1.0.5 → 1.0.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/conn-orch-orchestrator",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Workflow orchestration connector for OA Drive - handles message routing and workflow execution",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -152,8 +152,8 @@ class WorkflowOrchestrator {
152
152
  // Route to next step
153
153
  await this._routeToNextStep(nextStep, cookbookDef, updatedContext, workflow_id);
154
154
  } else {
155
- // Workflow completed - pass serviceName for monitoring
156
- await this._completeWorkflow(workflow_id, updatedContext, serviceName);
155
+ // Workflow completed - pass serviceName and last step info for monitoring
156
+ await this._completeWorkflow(workflow_id, updatedContext, serviceName, current_step, currentIndex);
157
157
  }
158
158
 
159
159
  return {
@@ -329,13 +329,17 @@ class WorkflowOrchestrator {
329
329
  * @param {string} workflow_id - Workflow ID
330
330
  * @param {Object} finalContext - Final workflow context
331
331
  * @param {string} serviceName - Service name that completed the workflow
332
+ * @param {string} lastStepId - ID of the last completed step
333
+ * @param {number} lastStepIndex - Index of the last completed step
332
334
  */
333
- async _completeWorkflow(workflow_id, finalContext, serviceName = 'unknown') {
335
+ async _completeWorkflow(workflow_id, finalContext, serviceName = 'unknown', lastStepId = null, lastStepIndex = 0) {
334
336
  try {
335
337
  console.log(`[WorkflowOrchestrator] [PUBLISH] Preparing to publish workflow.completed for ${workflow_id}`);
336
338
  this.logger.info(`[WorkflowOrchestrator] [PUBLISH] Preparing to publish workflow.completed`, {
337
339
  workflow_id,
338
340
  serviceName,
341
+ lastStepId,
342
+ lastStepIndex,
339
343
  hasMqClient: !!this.mqClient,
340
344
  mqClientConnected: this.mqClient?._connected
341
345
  });
@@ -349,6 +353,8 @@ class WorkflowOrchestrator {
349
353
  workflow_id,
350
354
  status: 'completed',
351
355
  service: serviceName, // Service that completed the workflow (for monitoring)
356
+ step_id: lastStepId, // Last step ID for monitoring
357
+ step_index: lastStepIndex, // Last step index for monitoring
352
358
  delivery: delivery, // Delivery configuration from Gateway context (must be object)
353
359
  context: finalContext, // Full context for output resolution
354
360
  steps: finalContext?.steps || {}, // Steps results for output resolution