mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(Code Node): Warning if pairedItem absent or could not be auto mapped (#11737)
Co-authored-by: Shireen Missi <shireen@n8n.io>
This commit is contained in:
@@ -17,7 +17,7 @@ import { JavaScriptSandbox } from './JavaScriptSandbox';
|
||||
import { JsTaskRunnerSandbox } from './JsTaskRunnerSandbox';
|
||||
import { PythonSandbox } from './PythonSandbox';
|
||||
import { getSandboxContext } from './Sandbox';
|
||||
import { standardizeOutput } from './utils';
|
||||
import { addPostExecutionWarning, standardizeOutput } from './utils';
|
||||
|
||||
const { CODE_ENABLE_STDOUT } = process.env;
|
||||
|
||||
@@ -142,6 +142,8 @@ export class Code implements INodeType {
|
||||
return sandbox;
|
||||
};
|
||||
|
||||
const inputDataItems = this.getInputData();
|
||||
|
||||
// ----------------------------------
|
||||
// runOnceForAllItems
|
||||
// ----------------------------------
|
||||
@@ -163,7 +165,7 @@ export class Code implements INodeType {
|
||||
standardizeOutput(item.json);
|
||||
}
|
||||
|
||||
return [items];
|
||||
return addPostExecutionWarning(items, inputDataItems?.length);
|
||||
}
|
||||
|
||||
// ----------------------------------
|
||||
@@ -172,9 +174,7 @@ export class Code implements INodeType {
|
||||
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
|
||||
const items = this.getInputData();
|
||||
|
||||
for (let index = 0; index < items.length; index++) {
|
||||
for (let index = 0; index < inputDataItems.length; index++) {
|
||||
const sandbox = getSandbox(index);
|
||||
let result: INodeExecutionData | undefined;
|
||||
try {
|
||||
@@ -201,6 +201,6 @@ export class Code implements INodeType {
|
||||
}
|
||||
}
|
||||
|
||||
return [returnData];
|
||||
return addPostExecutionWarning(returnData, inputDataItems?.length);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user