Skip to content

Commit a8827dd

Browse files
author
drowl87
committed
refactor DynamicNode: simplify output handling in execution and update package version to 0.1.8
1 parent fd53bf2 commit a8827dd

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

nodes/DynamicNode/DynamicNode.node.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,13 @@ export class DynamicNode implements INodeType {
8484
},
8585
);
8686

87-
// 8) Pull out just the runData for the node you injected
88-
const allRunData = (executionResult as any).runData;
89-
const nodeRuns = allRunData?.[raw.name] as INodeExecutionData[][];
87+
// 8) executionResult.data is already your sub-workflow’s output
88+
// as INodeExecutionData[][] keyed by output ports
89+
const returnedData = Array.isArray(executionResult)
90+
? executionResult
91+
: (executionResult as any).data as INodeExecutionData[][];
9092

91-
// 9) Return its first output port
92-
return this.prepareOutputData(nodeRuns?.[0] || []);
93+
// 9) Just hand it back to n8n
94+
return this.prepareOutputData(returnedData);
9395
}
9496
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "n8n-nodes-dynamic-node",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "A dynamic n8n node wrapper that can execute any node JSON by feeding it at runtime.",
55
"keywords": [
66
"n8n-community-node-package",

0 commit comments

Comments
 (0)