mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Remove NodeExecutionOutput. Add execution hints directly to the context (#13111)
This commit is contained in:
committed by
GitHub
parent
5dddf772cf
commit
dbb9475b7b
@@ -1,5 +1,4 @@
|
||||
import type { INodeExecutionData, IDataObject } from 'n8n-workflow';
|
||||
import { NodeExecutionOutput } from 'n8n-workflow';
|
||||
import type { INodeExecutionData, IDataObject, IExecuteFunctions } from 'n8n-workflow';
|
||||
|
||||
export function isObject(maybe: unknown): maybe is { [key: string]: unknown } {
|
||||
return (
|
||||
@@ -39,24 +38,18 @@ export function standardizeOutput(output: IDataObject) {
|
||||
}
|
||||
|
||||
export const addPostExecutionWarning = (
|
||||
context: IExecuteFunctions,
|
||||
returnData: INodeExecutionData[],
|
||||
inputItemsLength: number,
|
||||
) => {
|
||||
): void => {
|
||||
if (
|
||||
returnData.length !== inputItemsLength ||
|
||||
returnData.some((item) => item.pairedItem === undefined)
|
||||
) {
|
||||
return new NodeExecutionOutput(
|
||||
[returnData],
|
||||
[
|
||||
{
|
||||
message:
|
||||
'To make sure expressions after this node work, return the input items that produced each output item. <a target="_blank" href="https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-code-node/">More info</a>',
|
||||
location: 'outputPane',
|
||||
},
|
||||
],
|
||||
);
|
||||
context.addExecutionHints({
|
||||
message:
|
||||
'To make sure expressions after this node work, return the input items that produced each output item. <a target="_blank" href="https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-code-node/">More info</a>',
|
||||
location: 'outputPane',
|
||||
});
|
||||
}
|
||||
|
||||
return [returnData];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user