@onlineapps/conn-orch-orchestrator 1.0.111 → 1.0.113

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.111",
3
+ "version": "1.0.113",
4
4
  "description": "Workflow orchestration connector for OA Drive - handles message routing and workflow execution",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1120,6 +1120,18 @@ class WorkflowOrchestrator {
1120
1120
  // at top level — not buried inside cookbook._system.
1121
1121
  const sys = cookbook._system || {};
1122
1122
 
1123
+ // Extract api_output from the last executed step's output.
1124
+ // Canonical source: cookbook.steps[lastStepIndex].output.
1125
+ // Downstream (DeliveryDispatcher, monitoring, Admin UI) needs a flat
1126
+ // api_output field to surface workflow results to clients without
1127
+ // having to traverse the cookbook graph.
1128
+ let apiOutput = null;
1129
+ const steps = Array.isArray(finalCookbook.steps) ? finalCookbook.steps : [];
1130
+ const lastStep = steps[lastStepIndex] || (steps.length > 0 ? steps[steps.length - 1] : null);
1131
+ if (lastStep && typeof lastStep === 'object' && Object.prototype.hasOwnProperty.call(lastStep, 'output')) {
1132
+ apiOutput = lastStep.output ?? null;
1133
+ }
1134
+
1123
1135
  const workflowCompletedMessage = {
1124
1136
  workflow_id,
1125
1137
  tenant_id: sys.tenant_id,
@@ -1129,6 +1141,7 @@ class WorkflowOrchestrator {
1129
1141
  service: serviceName,
1130
1142
  step_id: lastStepId,
1131
1143
  step_index: lastStepIndex,
1144
+ api_output: apiOutput,
1132
1145
  cookbook: finalCookbook,
1133
1146
  delivery: cookbook.delivery || { handler: 'none' },
1134
1147
  completed_at: new Date().toISOString()