mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Execute Workflow Trigger Node): Reintroduce binary data on Workflow Triggers (#15259)
This commit is contained in:
@@ -212,14 +212,15 @@ export class ExecuteWorkflowTrigger implements INodeType {
|
||||
} else {
|
||||
const newParams = getFieldEntries(this);
|
||||
const newKeys = new Set(newParams.fields.map((x) => x.name));
|
||||
const itemsInSchema: INodeExecutionData[] = inputData.map((row, index) => ({
|
||||
const itemsInSchema: INodeExecutionData[] = inputData.map(({ json, binary }, index) => ({
|
||||
json: {
|
||||
...Object.fromEntries(newParams.fields.map((x) => [x.name, FALLBACK_DEFAULT_VALUE])),
|
||||
// Need to trim to the expected schema to support legacy Execute Workflow callers passing through all their data
|
||||
// which we do not want to expose past this node.
|
||||
..._.pickBy(row.json, (_value, key) => newKeys.has(key)),
|
||||
..._.pickBy(json, (_value, key) => newKeys.has(key)),
|
||||
},
|
||||
index,
|
||||
binary,
|
||||
}));
|
||||
|
||||
return [itemsInSchema];
|
||||
|
||||
@@ -142,10 +142,11 @@ export function getCurrentWorkflowInputData(this: IExecuteFunctions | ISupplyDat
|
||||
} else {
|
||||
const removedKeys = new Set(schema.filter((x) => x.removed).map((x) => x.displayName));
|
||||
|
||||
const filteredInputData: INodeExecutionData[] = inputData.map((item, index) => ({
|
||||
const filteredInputData: INodeExecutionData[] = inputData.map(({ json, binary }, index) => ({
|
||||
index,
|
||||
pairedItem: { item: index },
|
||||
json: _.pickBy(item.json, (_v, key) => !removedKeys.has(key)),
|
||||
json: _.pickBy(json, (_v, key) => !removedKeys.has(key)),
|
||||
binary,
|
||||
}));
|
||||
|
||||
return filteredInputData;
|
||||
|
||||
Reference in New Issue
Block a user