@onlineapps/conn-orch-orchestrator 1.0.58 → 1.0.59

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.58",
3
+ "version": "1.0.59",
4
4
  "description": "Workflow orchestration connector for OA Drive - handles message routing and workflow execution",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -153,8 +153,9 @@ class WorkflowOrchestrator {
153
153
  };
154
154
 
155
155
  // Execute the step (build full context for template resolution)
156
+ const stepsArrayCtx = this._getStepsArray(cookbookDef);
156
157
  const stepsMap = {};
157
- this._getStepsArray(cookbookDef).forEach((s) => {
158
+ stepsArrayCtx.forEach((s) => {
158
159
  const id = this._getStepId(s);
159
160
  if (id) {
160
161
  stepsMap[id] = s;
@@ -162,7 +163,8 @@ class WorkflowOrchestrator {
162
163
  });
163
164
  const stepContext = {
164
165
  api_input: cookbookDef.api_input || {},
165
- steps: stepsMap,
166
+ steps: stepsArrayCtx, // array (legacy consumers expect .map)
167
+ steps_by_id: stepsMap, // fast lookup by step_id for templating
166
168
  _system: cookbookDef._system,
167
169
  delivery: cookbookDef.delivery
168
170
  };
@@ -571,13 +573,16 @@ class WorkflowOrchestrator {
571
573
  const part = parts[i];
572
574
  if (current === undefined || current === null) return undefined;
573
575
 
574
- // Special handling for 'steps' array - lookup by step id
575
- // context.steps is an array of {id/step_id: "step_id", output: {...}}
576
- // Path like "steps.greeting.output" should find step with id="greeting"
577
- if (parts[i - 1] === 'steps' && Array.isArray(context.steps)) {
578
- // 'part' is the step_id, find the step in the array (support both 'id' and 'step_id')
579
- const step = context.steps.find(s => s.id === part || s.step_id === part);
580
- current = step;
576
+ // Special handling for 'steps' - support array (legacy) and map (steps_by_id)
577
+ if (parts[i - 1] === 'steps') {
578
+ if (context.steps_by_id && context.steps_by_id[part]) {
579
+ current = context.steps_by_id[part];
580
+ } else if (Array.isArray(context.steps)) {
581
+ const step = context.steps.find(s => s.id === part || s.step_id === part);
582
+ current = step;
583
+ } else {
584
+ current = undefined;
585
+ }
581
586
  } else {
582
587
  current = current[part];
583
588
  }