mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Add support for pairedItem (beta) (#3012)
* ✨ Add pairedItem support * 👕 Fix lint issue * 🐛 Fix resolution in frontend * 🐛 Fix resolution issue * 🐛 Fix resolution in frontend * 🐛 Fix another resolution issue in frontend * ⚡ Try to automatically add pairedItem data if possible * ⚡ Cleanup * ⚡ Display expression errors in editor UI * 🐛 Fix issue that it did not display errors in production * 🐛 Fix auto-fix of missing pairedItem data * 🐛 Fix frontend resolution for not executed nodes * ⚡ Fail execution on pairedItem resolve issue and display information about itemIndex and runIndex * ⚡ Allow that pairedItem is only set to number if runIndex is 0 * ✨ Improve Expression Errors * ⚡ Remove no longer needed code * ⚡ Make errors more helpful * ⚡ Add additional errors * 👕 Fix lint issue * ⚡ Add pairedItem support to core nodes * ⚡ Improve support in Merge-Node * ⚡ Fix issue with not correctly converted incoming pairedItem data * 🐛 Fix frontend resolve issue * 🐛 Fix frontend parameter name display issue * ⚡ Improve errors * 👕 Fix lint issue * ⚡ Improve errors * ⚡ Make it possible to display parameter name in error messages * ⚡ Improve error messages * ⚡ Fix error message * ⚡ Improve error messages * ⚡ Add another error message * ⚡ Simplify
This commit is contained in:
@@ -56,6 +56,7 @@ import {
|
||||
WorkflowDataProxy,
|
||||
WorkflowExecuteMode,
|
||||
LoggerProxy as Logger,
|
||||
IExecuteData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { Agent } from 'https';
|
||||
@@ -1447,6 +1448,7 @@ export function getNodeParameter(
|
||||
mode: WorkflowExecuteMode,
|
||||
timezone: string,
|
||||
additionalKeys: IWorkflowDataProxyAdditionalKeys,
|
||||
executeData?: IExecuteData,
|
||||
fallbackValue?: any,
|
||||
): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[] | object {
|
||||
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
||||
@@ -1472,11 +1474,13 @@ export function getNodeParameter(
|
||||
mode,
|
||||
timezone,
|
||||
additionalKeys,
|
||||
executeData,
|
||||
);
|
||||
|
||||
returnData = cleanupParameterData(returnData);
|
||||
} catch (e) {
|
||||
e.message += ` [Error in parameter: "${parameterName}"]`;
|
||||
if (e.context) e.context.parameter = parameterName;
|
||||
e.cause = value;
|
||||
throw e;
|
||||
}
|
||||
|
||||
@@ -1543,6 +1547,7 @@ export function getNodeWebhookUrl(
|
||||
mode,
|
||||
timezone,
|
||||
additionalKeys,
|
||||
undefined,
|
||||
false,
|
||||
) as boolean;
|
||||
return NodeHelpers.getNodeWebhookUrl(baseUrl, workflow.id!, node, path.toString(), isFullPath);
|
||||
@@ -1673,6 +1678,7 @@ export function getExecutePollFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
);
|
||||
},
|
||||
@@ -1827,6 +1833,7 @@ export function getExecuteTriggerFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
);
|
||||
},
|
||||
@@ -1940,6 +1947,7 @@ export function getExecuteFunctions(
|
||||
inputData: ITaskDataConnections,
|
||||
node: INode,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
executeData: IExecuteData,
|
||||
mode: WorkflowExecuteMode,
|
||||
): IExecuteFunctions {
|
||||
return ((workflow, runExecutionData, connectionInputData, inputData, node) => {
|
||||
@@ -1959,6 +1967,7 @@ export function getExecuteFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
);
|
||||
},
|
||||
async executeWorkflow(
|
||||
@@ -2035,6 +2044,7 @@ export function getExecuteFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
fallbackValue,
|
||||
);
|
||||
},
|
||||
@@ -2050,6 +2060,9 @@ export function getExecuteFunctions(
|
||||
getTimezone: (): string => {
|
||||
return getTimezone(workflow, additionalData);
|
||||
},
|
||||
getExecuteData: (): IExecuteData => {
|
||||
return executeData;
|
||||
},
|
||||
getWorkflow: () => {
|
||||
return getWorkflowMetadata(workflow);
|
||||
},
|
||||
@@ -2065,6 +2078,7 @@ export function getExecuteFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
);
|
||||
return dataProxy.getDataProxy();
|
||||
},
|
||||
@@ -2199,6 +2213,7 @@ export function getExecuteSingleFunctions(
|
||||
node: INode,
|
||||
itemIndex: number,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
executeData: IExecuteData,
|
||||
mode: WorkflowExecuteMode,
|
||||
): IExecuteSingleFunctions {
|
||||
return ((workflow, runExecutionData, connectionInputData, inputData, node, itemIndex) => {
|
||||
@@ -2219,6 +2234,7 @@ export function getExecuteSingleFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
);
|
||||
},
|
||||
getContext(type: string): IContextObject {
|
||||
@@ -2276,6 +2292,9 @@ export function getExecuteSingleFunctions(
|
||||
getTimezone: (): string => {
|
||||
return getTimezone(workflow, additionalData);
|
||||
},
|
||||
getExecuteData: (): IExecuteData => {
|
||||
return executeData;
|
||||
},
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
@@ -2296,6 +2315,7 @@ export function getExecuteSingleFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
fallbackValue,
|
||||
);
|
||||
},
|
||||
@@ -2314,6 +2334,7 @@ export function getExecuteSingleFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
);
|
||||
return dataProxy.getDataProxy();
|
||||
},
|
||||
@@ -2471,6 +2492,7 @@ export function getLoadOptionsFunctions(
|
||||
'internal' as WorkflowExecuteMode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
);
|
||||
},
|
||||
@@ -2601,6 +2623,7 @@ export function getExecuteHookFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
);
|
||||
},
|
||||
@@ -2763,6 +2786,7 @@ export function getExecuteWebhookFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user