mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Missing pairedItem fixes (#8394)
This commit is contained in:
@@ -9,6 +9,7 @@ import type {
|
||||
ILoadOptionsFunctions,
|
||||
INodeExecutionData,
|
||||
INodeProperties,
|
||||
IPairedItemData,
|
||||
IPollFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
@@ -860,12 +861,15 @@ export type FileRecord = {
|
||||
};
|
||||
};
|
||||
// prettier-ignore
|
||||
export async function downloadFiles(this: IExecuteFunctions | IPollFunctions, records: FileRecord[]): Promise<INodeExecutionData[]> {
|
||||
export async function downloadFiles(this: IExecuteFunctions | IPollFunctions, records: FileRecord[], pairedItem?: IPairedItemData[]): Promise<INodeExecutionData[]> {
|
||||
|
||||
const elements: INodeExecutionData[] = [];
|
||||
for (const record of records) {
|
||||
const element: INodeExecutionData = { json: {}, binary: {} };
|
||||
element.json = record as unknown as IDataObject;
|
||||
if (pairedItem) {
|
||||
element.pairedItems = pairedItem;
|
||||
}
|
||||
for (const key of Object.keys(record.properties)) {
|
||||
if (record.properties[key].type === 'files') {
|
||||
if (record.properties[key].files.length) {
|
||||
|
||||
Reference in New Issue
Block a user