n8n-core 1.22.0 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,16 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.ActiveWorkflows = void 0;
10
+ const typedi_1 = require("typedi");
4
11
  const cron_1 = require("cron");
5
12
  const n8n_workflow_1 = require("n8n-workflow");
6
- class ActiveWorkflows {
13
+ let ActiveWorkflows = class ActiveWorkflows {
7
14
  constructor() {
8
15
  this.activeWorkflows = {};
9
16
  }
@@ -119,6 +126,9 @@ class ActiveWorkflows {
119
126
  throw new n8n_workflow_1.WorkflowDeactivationError(`Failed to deactivate ${target} of workflow ID "${workflowId}": "${error.message}"`, { cause: error, workflowId });
120
127
  }
121
128
  }
122
- }
129
+ };
123
130
  exports.ActiveWorkflows = ActiveWorkflows;
131
+ exports.ActiveWorkflows = ActiveWorkflows = __decorate([
132
+ (0, typedi_1.Service)()
133
+ ], ActiveWorkflows);
124
134
  //# sourceMappingURL=ActiveWorkflows.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActiveWorkflows.js","sourceRoot":"","sources":["../src/ActiveWorkflows.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAc/B,+CAMsB;AAItB,MAAa,eAAe;IAA5B;QACS,oBAAe,GAEnB,EAAE,CAAC;IA2NR,CAAC;IAtNA,QAAQ,CAAC,UAAk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,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEzD,MAAM,IAAI,wCAAyB,CAClC,wBAAwB,MAAM,oBAAoB,UAAU,OAAO,KAAK,CAAC,OAAO,GAAG,EACnF,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,CAC5B,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAA;AA5NY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,gBAAO,GAAE;GACG,eAAe,CA4N3B"}
@@ -1,4 +1,5 @@
1
1
  import type { IPollResponse, ITriggerResponse, IWorkflowSettings as IWorkflowSettingsWorkflow, ValidationResult } from 'n8n-workflow';
2
+ export type Class<T = object, A extends unknown[] = unknown[]> = new (...args: A) => T;
2
3
  export interface IProcessMessage {
3
4
  data?: any;
4
5
  type: string;
@@ -3,7 +3,7 @@
3
3
  /// <reference types="node" />
4
4
  /// <reference types="node/http" />
5
5
  import { IncomingMessage } from 'http';
6
- import type { IAdditionalCredentialOptions, IAllExecuteFunctions, IBinaryData, ICredentialDataDecryptedObject, ICredentialTestFunctions, IDataObject, IExecuteData, IExecuteFunctions, IExecuteSingleFunctions, IGetNodeParameterOptions, IHookFunctions, IHttpRequestOptions, ILoadOptionsFunctions, INode, INodeExecutionData, INodeType, IOAuth2Options, IPairedItemData, IPollFunctions, IRunExecutionData, ITaskDataConnections, ITriggerFunctions, IWebhookData, IWebhookDescription, IWebhookFunctions, IWorkflowDataProxyAdditionalKeys, IWorkflowExecuteAdditionalData, NodeExecutionWithMetadata, NodeParameterValueType, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
6
+ import type { CloseFunction, IAdditionalCredentialOptions, IAllExecuteFunctions, IBinaryData, ICredentialDataDecryptedObject, ICredentialTestFunctions, IDataObject, IExecuteData, IExecuteFunctions, IExecuteSingleFunctions, IGetNodeParameterOptions, IHookFunctions, IHttpRequestOptions, ILoadOptionsFunctions, INode, INodeExecutionData, INodeType, IOAuth2Options, IPairedItemData, IPollFunctions, IRunExecutionData, ITaskDataConnections, ITriggerFunctions, IWebhookData, IWebhookDescription, IWebhookFunctions, IWorkflowDataProxyAdditionalKeys, IWorkflowExecuteAdditionalData, NodeExecutionWithMetadata, NodeParameterValueType, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
7
7
  import type { OptionsWithUrl } from 'request';
8
8
  import type { OptionsWithUri, RequestPromiseOptions } from 'request-promise-native';
9
9
  import { Readable } from 'stream';
@@ -29,7 +29,7 @@ export declare function requestWithAuthentication(this: IAllExecuteFunctions, cr
29
29
  export declare function getAdditionalKeys(additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData: IRunExecutionData | null, options?: {
30
30
  secretsEnabled?: boolean;
31
31
  }): IWorkflowDataProxyAdditionalKeys;
32
- export declare function getCredentials(workflow: Workflow, node: INode, type: string, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData?: IRunExecutionData | null, runIndex?: number, connectionInputData?: INodeExecutionData[], itemIndex?: number): Promise<ICredentialDataDecryptedObject>;
32
+ export declare function getCredentials(workflow: Workflow, node: INode, type: string, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, executeData?: IExecuteData, runExecutionData?: IRunExecutionData | null, runIndex?: number, connectionInputData?: INodeExecutionData[], itemIndex?: number): Promise<ICredentialDataDecryptedObject>;
33
33
  export declare const validateValueAgainstSchema: (node: INode, nodeType: INodeType, parameterValue: string | number | boolean | object | null | undefined, parameterName: string, runIndex: number, itemIndex: number) => string | number | boolean | object | null | undefined;
34
34
  export declare function getNodeParameter(workflow: Workflow, runExecutionData: IRunExecutionData | null, runIndex: number, connectionInputData: INodeExecutionData[], node: INode, parameterName: string, itemIndex: number, mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
35
35
  export declare function continueOnFail(node: INode): boolean;
@@ -39,9 +39,9 @@ export declare function getWebhookDescription(name: string, workflow: Workflow,
39
39
  export declare function copyInputItems(items: INodeExecutionData[], properties: string[]): IDataObject[];
40
40
  export declare function getExecutePollFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): IPollFunctions;
41
41
  export declare function getExecuteTriggerFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): ITriggerFunctions;
42
- export declare function getExecuteFunctions(workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, node: INode, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, abortSignal?: AbortSignal): IExecuteFunctions;
42
+ export declare function getExecuteFunctions(workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, node: INode, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, closeFunctions: CloseFunction[], abortSignal?: AbortSignal): IExecuteFunctions;
43
43
  export declare function getExecuteSingleFunctions(workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, node: INode, itemIndex: number, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, abortSignal?: AbortSignal): IExecuteSingleFunctions;
44
44
  export declare function getCredentialTestFunctions(): ICredentialTestFunctions;
45
45
  export declare function getLoadOptionsFunctions(workflow: Workflow, node: INode, path: string, additionalData: IWorkflowExecuteAdditionalData): ILoadOptionsFunctions;
46
46
  export declare function getExecuteHookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, webhookData?: IWebhookData): IHookFunctions;
47
- export declare function getExecuteWebhookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, webhookData: IWebhookData): IWebhookFunctions;
47
+ export declare function getExecuteWebhookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, webhookData: IWebhookData, closeFunctions: CloseFunction[]): IWebhookFunctions;
@@ -48,7 +48,6 @@ const url_1 = __importStar(require("url"));
48
48
  const BinaryData_service_1 = require("./BinaryData/BinaryData.service");
49
49
  const Constants_1 = require("./Constants");
50
50
  const ExtractValue_1 = require("./ExtractValue");
51
- const OAuth2Helper_1 = require("./OAuth2Helper");
52
51
  const ExecutionMetadata_1 = require("./ExecutionMetadata");
53
52
  const Secrets_1 = require("./Secrets");
54
53
  const typedi_1 = __importDefault(require("typedi"));
@@ -709,14 +708,16 @@ exports.getBinaryStream = getBinaryStream;
709
708
  function assertBinaryData(inputData, node, itemIndex, propertyName, inputIndex) {
710
709
  const binaryKeyData = inputData.main[inputIndex][itemIndex].binary;
711
710
  if (binaryKeyData === undefined) {
712
- throw new n8n_workflow_1.NodeOperationError(node, 'No binary data exists on item!', {
711
+ throw new n8n_workflow_1.NodeOperationError(node, `This operation expects the node's input data to contain a binary file '${propertyName}', but none was found [item ${itemIndex}]`, {
713
712
  itemIndex,
713
+ description: 'Make sure that the previous node outputs a binary file',
714
714
  });
715
715
  }
716
716
  const binaryPropertyData = binaryKeyData[propertyName];
717
717
  if (binaryPropertyData === undefined) {
718
- throw new n8n_workflow_1.NodeOperationError(node, `Item has no binary property called "${propertyName}"`, {
718
+ throw new n8n_workflow_1.NodeOperationError(node, `The item has no binary field '${propertyName}' [item ${itemIndex}]`, {
719
719
  itemIndex,
720
+ description: 'Check that the parameter where you specified the input binary field name is correct, and that it matches a field in the binary input',
720
721
  });
721
722
  }
722
723
  return binaryPropertyData;
@@ -836,10 +837,9 @@ async function prepareBinaryData(binaryData, executionId, workflowId, filePath,
836
837
  return setBinaryDataBuffer(returnData, binaryData, workflowId, executionId);
837
838
  }
838
839
  async function requestOAuth2(credentialsType, requestOptions, node, additionalData, oAuth2Options, isN8nRequest = false) {
839
- var _a, _b;
840
- const credentials = await this.getCredentials(credentialsType);
841
- if (credentials.grantType === "authorizationCode" &&
842
- credentials.oauthTokenData === undefined) {
840
+ var _a, _b, _c;
841
+ const credentials = (await this.getCredentials(credentialsType));
842
+ if (credentials.grantType === 'authorizationCode' && credentials.oauthTokenData === undefined) {
843
843
  throw new n8n_workflow_1.ApplicationError('OAuth credentials not connected');
844
844
  }
845
845
  const oAuthClient = new client_oauth2_1.ClientOAuth2({
@@ -848,19 +848,21 @@ async function requestOAuth2(credentialsType, requestOptions, node, additionalDa
848
848
  accessTokenUri: credentials.accessTokenUrl,
849
849
  scopes: credentials.scope.split(' '),
850
850
  ignoreSSLIssues: credentials.ignoreSSLIssues,
851
+ authentication: (_a = credentials.authentication) !== null && _a !== void 0 ? _a : 'header',
851
852
  });
852
853
  let oauthTokenData = credentials.oauthTokenData;
853
- if (credentials.grantType === "clientCredentials" &&
854
+ if (credentials.grantType === 'clientCredentials' &&
854
855
  (oauthTokenData === undefined || Object.keys(oauthTokenData).length === 0)) {
855
- const { data } = await (0, OAuth2Helper_1.getClientCredentialsToken)(oAuthClient, credentials);
856
- if (!((_a = node.credentials) === null || _a === void 0 ? void 0 : _a[credentialsType])) {
856
+ const { data } = await oAuthClient.credentials.getToken();
857
+ if (!((_b = node.credentials) === null || _b === void 0 ? void 0 : _b[credentialsType])) {
857
858
  throw new n8n_workflow_1.ApplicationError('Node does not have credential type', {
858
859
  extra: { nodeName: node.name },
859
860
  tags: { credentialType: credentialsType },
860
861
  });
861
862
  }
862
863
  const nodeCredentials = node.credentials[credentialsType];
863
- await additionalData.credentialsHelper.updateCredentials(nodeCredentials, credentialsType, Object.assign(credentials, { oauthTokenData: data }));
864
+ credentials.oauthTokenData = data;
865
+ await additionalData.credentialsHelper.updateCredentials(nodeCredentials, credentialsType, credentials);
864
866
  oauthTokenData = data;
865
867
  }
866
868
  const accessToken = (0, get_1.default)(oauthTokenData, oAuth2Options === null || oAuth2Options === void 0 ? void 0 : oAuth2Options.property) || oauthTokenData.accessToken;
@@ -872,7 +874,7 @@ async function requestOAuth2(credentialsType, requestOptions, node, additionalDa
872
874
  }, (oAuth2Options === null || oAuth2Options === void 0 ? void 0 : oAuth2Options.tokenType) || oauthTokenData.tokenType);
873
875
  requestOptions.rejectUnauthorized = !credentials.ignoreSSLIssues;
874
876
  const newRequestOptions = token.sign(requestOptions);
875
- const newRequestHeaders = (newRequestOptions.headers = (_b = newRequestOptions.headers) !== null && _b !== void 0 ? _b : {});
877
+ const newRequestHeaders = (newRequestOptions.headers = (_c = newRequestOptions.headers) !== null && _c !== void 0 ? _c : {});
876
878
  if ((oAuth2Options === null || oAuth2Options === void 0 ? void 0 : oAuth2Options.keepBearer) === false && typeof newRequestHeaders.Authorization === 'string') {
877
879
  newRequestHeaders.Authorization = newRequestHeaders.Authorization.split(' ')[1];
878
880
  }
@@ -901,8 +903,8 @@ async function requestOAuth2(credentialsType, requestOptions, node, additionalDa
901
903
  }
902
904
  let newToken;
903
905
  n8n_workflow_1.LoggerProxy.debug(`OAuth2 token for "${credentialsType}" used by node "${node.name}" has been renewed.`);
904
- if ("clientCredentials" === credentials.grantType) {
905
- newToken = await (0, OAuth2Helper_1.getClientCredentialsToken)(token.client, credentials);
906
+ if (credentials.grantType === 'clientCredentials') {
907
+ newToken = await token.client.credentials.getToken();
906
908
  }
907
909
  else {
908
910
  newToken = await token.refresh(tokenRefreshOptions);
@@ -957,8 +959,8 @@ async function requestOAuth2(credentialsType, requestOptions, node, additionalDa
957
959
  }
958
960
  n8n_workflow_1.LoggerProxy.debug(`OAuth2 token for "${credentialsType}" used by node "${node.name}" expired. Should revalidate.`);
959
961
  let newToken;
960
- if ("clientCredentials" === credentials.grantType) {
961
- newToken = await (0, OAuth2Helper_1.getClientCredentialsToken)(token.client, credentials);
962
+ if (credentials.grantType === 'clientCredentials') {
963
+ newToken = await token.client.credentials.getToken();
962
964
  }
963
965
  else {
964
966
  newToken = await token.refresh(tokenRefreshOptions);
@@ -1179,6 +1181,8 @@ async function requestWithAuthentication(credentialsType, requestOptions, workfl
1179
1181
  throw error;
1180
1182
  }
1181
1183
  catch (error) {
1184
+ if (error instanceof n8n_workflow_1.ExecutionBaseError)
1185
+ throw error;
1182
1186
  throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
1183
1187
  }
1184
1188
  }
@@ -1234,7 +1238,7 @@ function getAdditionalKeys(additionalData, mode, runExecutionData, options) {
1234
1238
  };
1235
1239
  }
1236
1240
  exports.getAdditionalKeys = getAdditionalKeys;
1237
- async function getCredentials(workflow, node, type, additionalData, mode, runExecutionData, runIndex, connectionInputData, itemIndex) {
1241
+ async function getCredentials(workflow, node, type, additionalData, mode, executeData, runExecutionData, runIndex, connectionInputData, itemIndex) {
1238
1242
  var _a, _b;
1239
1243
  const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
1240
1244
  if (nodeType === undefined) {
@@ -1286,7 +1290,7 @@ async function getCredentials(workflow, node, type, additionalData, mode, runExe
1286
1290
  const nodeCredentials = node.credentials
1287
1291
  ? node.credentials[type]
1288
1292
  : {};
1289
- const decryptedDataObject = await additionalData.credentialsHelper.getDecrypted(additionalData, nodeCredentials, type, mode, false, expressionResolveValues);
1293
+ const decryptedDataObject = await additionalData.credentialsHelper.getDecrypted(additionalData, nodeCredentials, type, mode, executeData, false, expressionResolveValues);
1290
1294
  return decryptedDataObject;
1291
1295
  }
1292
1296
  exports.getCredentials = getCredentials;
@@ -1595,6 +1599,102 @@ const addExecutionDataFunctions = async (type, nodeName, data, runExecutionData,
1595
1599
  });
1596
1600
  }
1597
1601
  };
1602
+ async function getInputConnectionData(workflow, runExecutionData, runIndex, connectionInputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex, inputIndex) {
1603
+ var _a;
1604
+ const node = this.getNode();
1605
+ const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
1606
+ const inputs = n8n_workflow_1.NodeHelpers.getNodeInputs(workflow, node, nodeType.description);
1607
+ let inputConfiguration = inputs.find((input) => {
1608
+ if (typeof input === 'string') {
1609
+ return input === inputName;
1610
+ }
1611
+ return input.type === inputName;
1612
+ });
1613
+ if (inputConfiguration === undefined) {
1614
+ throw new n8n_workflow_1.ApplicationError('Node does not have input of type', {
1615
+ extra: { nodeName: node.name, inputName },
1616
+ });
1617
+ }
1618
+ if (typeof inputConfiguration === 'string') {
1619
+ inputConfiguration = {
1620
+ type: inputConfiguration,
1621
+ };
1622
+ }
1623
+ const parentNodes = workflow.getParentNodes(node.name, inputName, 1);
1624
+ if (parentNodes.length === 0) {
1625
+ return inputConfiguration.maxConnections === 1 ? undefined : [];
1626
+ }
1627
+ const constParentNodes = parentNodes
1628
+ .map((nodeName) => {
1629
+ return workflow.getNode(nodeName);
1630
+ })
1631
+ .filter((connectedNode) => connectedNode.disabled !== true)
1632
+ .map(async (connectedNode) => {
1633
+ const nodeType = workflow.nodeTypes.getByNameAndVersion(connectedNode.type, connectedNode.typeVersion);
1634
+ if (!nodeType.supplyData) {
1635
+ throw new n8n_workflow_1.ApplicationError('Node does not have a `supplyData` method defined', {
1636
+ extra: { nodeName: connectedNode.name },
1637
+ });
1638
+ }
1639
+ const context = Object.assign({}, this);
1640
+ context.getNodeParameter = (parameterName, itemIndex, fallbackValue, options) => {
1641
+ return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, connectedNode, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), executeData, fallbackValue, { ...(options || {}), contextNode: node });
1642
+ };
1643
+ context.getNode = () => {
1644
+ return (0, n8n_workflow_1.deepCopy)(connectedNode);
1645
+ };
1646
+ context.getCredentials = async (key) => {
1647
+ try {
1648
+ return await getCredentials(workflow, connectedNode, key, additionalData, mode, executeData, runExecutionData, runIndex, connectionInputData, itemIndex);
1649
+ }
1650
+ catch (error) {
1651
+ let currentNodeRunIndex = 0;
1652
+ if (runExecutionData.resultData.runData.hasOwnProperty(node.name)) {
1653
+ currentNodeRunIndex = runExecutionData.resultData.runData[node.name].length;
1654
+ }
1655
+ await addExecutionDataFunctions('input', connectedNode.name, error, runExecutionData, inputName, additionalData, node.name, runIndex, currentNodeRunIndex);
1656
+ throw error;
1657
+ }
1658
+ };
1659
+ try {
1660
+ const response = await nodeType.supplyData.call(context, itemIndex);
1661
+ if (response.closeFunction) {
1662
+ closeFunctions.push(response.closeFunction);
1663
+ }
1664
+ return response;
1665
+ }
1666
+ catch (error) {
1667
+ if (error.functionality === 'configuration-node')
1668
+ throw error;
1669
+ if (!(error instanceof n8n_workflow_1.ExecutionBaseError)) {
1670
+ error = new n8n_workflow_1.NodeOperationError(connectedNode, error, {
1671
+ itemIndex,
1672
+ });
1673
+ }
1674
+ let currentNodeRunIndex = 0;
1675
+ if (runExecutionData.resultData.runData.hasOwnProperty(node.name)) {
1676
+ currentNodeRunIndex = runExecutionData.resultData.runData[node.name].length;
1677
+ }
1678
+ await addExecutionDataFunctions('input', connectedNode.name, error, runExecutionData, inputName, additionalData, node.name, runIndex, currentNodeRunIndex);
1679
+ throw new n8n_workflow_1.NodeOperationError(connectedNode, `Error in sub-node ${connectedNode.name}`, {
1680
+ itemIndex,
1681
+ functionality: 'configuration-node',
1682
+ description: error.message,
1683
+ });
1684
+ }
1685
+ });
1686
+ const nodes = await Promise.all(constParentNodes);
1687
+ if (inputConfiguration.required && nodes.length === 0) {
1688
+ throw new n8n_workflow_1.NodeOperationError(node, `A ${inputName} processor node must be connected!`);
1689
+ }
1690
+ if (inputConfiguration.maxConnections !== undefined &&
1691
+ nodes.length > inputConfiguration.maxConnections) {
1692
+ throw new n8n_workflow_1.NodeOperationError(node, `Only ${inputConfiguration.maxConnections} ${inputName} processor nodes are/is allowed to be connected!`);
1693
+ }
1694
+ return inputConfiguration.maxConnections === 1
1695
+ ? (_a = (nodes || [])[0]) === null || _a === void 0 ? void 0 : _a.response
1696
+ : nodes.map((node) => node.response);
1697
+ }
1598
1698
  const getCommonWorkflowFunctions = (workflow, node, additionalData) => ({
1599
1699
  logger: n8n_workflow_1.LoggerProxy,
1600
1700
  getExecutionId: () => additionalData.executionId,
@@ -1740,6 +1840,9 @@ const getRequestHelperFunctions = (workflow, node, additionalData) => {
1740
1840
  }
1741
1841
  makeAdditionalRequest = getResolvedValue(paginationOptions.continue, itemIndex, runIndex, executeData, additionalKeys, false);
1742
1842
  if (makeAdditionalRequest) {
1843
+ if (paginationOptions.requestInterval) {
1844
+ await (0, n8n_workflow_1.sleep)(paginationOptions.requestInterval);
1845
+ }
1743
1846
  if (tempResponseData.statusCode < 200 || tempResponseData.statusCode >= 300) {
1744
1847
  let data = tempResponseData.body;
1745
1848
  if ((data === null || data === void 0 ? void 0 : data.constructor.name) === 'IncomingMessage' &&
@@ -1954,13 +2057,13 @@ function getExecuteTriggerFunctions(workflow, node, additionalData, mode, activa
1954
2057
  })(workflow, node);
1955
2058
  }
1956
2059
  exports.getExecuteTriggerFunctions = getExecuteTriggerFunctions;
1957
- function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, node, additionalData, executeData, mode, abortSignal) {
2060
+ function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, node, additionalData, executeData, mode, closeFunctions, abortSignal) {
1958
2061
  return ((workflow, runExecutionData, connectionInputData, inputData, node) => {
1959
2062
  return {
1960
2063
  ...getCommonWorkflowFunctions(workflow, node, additionalData),
1961
2064
  ...executionCancellationFunctions(abortSignal),
1962
2065
  getMode: () => mode,
1963
- getCredentials: async (type, itemIndex) => getCredentials(workflow, node, type, additionalData, mode, runExecutionData, runIndex, connectionInputData, itemIndex),
2066
+ getCredentials: async (type, itemIndex) => getCredentials(workflow, node, type, additionalData, mode, executeData, runExecutionData, runIndex, connectionInputData, itemIndex),
1964
2067
  getExecuteData: () => executeData,
1965
2068
  continueOnFail: () => continueOnFail(node),
1966
2069
  evaluateExpression: (expression, itemIndex) => {
@@ -1981,96 +2084,7 @@ function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInp
1981
2084
  return n8n_workflow_1.NodeHelpers.getContext(runExecutionData, type, node);
1982
2085
  },
1983
2086
  async getInputConnectionData(inputName, itemIndex, inputIndex) {
1984
- var _a;
1985
- const node = this.getNode();
1986
- const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
1987
- const inputs = n8n_workflow_1.NodeHelpers.getNodeInputs(workflow, node, nodeType.description);
1988
- let inputConfiguration = inputs.find((input) => {
1989
- if (typeof input === 'string') {
1990
- return input === inputName;
1991
- }
1992
- return input.type === inputName;
1993
- });
1994
- if (inputConfiguration === undefined) {
1995
- throw new n8n_workflow_1.ApplicationError('Node does not have input of type', {
1996
- extra: { nodeName: node.name, inputName },
1997
- });
1998
- }
1999
- if (typeof inputConfiguration === 'string') {
2000
- inputConfiguration = {
2001
- type: inputConfiguration,
2002
- };
2003
- }
2004
- const parentNodes = workflow.getParentNodes(node.name, inputName, 1);
2005
- if (parentNodes.length === 0) {
2006
- return inputConfiguration.maxConnections === 1 ? undefined : [];
2007
- }
2008
- const constParentNodes = parentNodes
2009
- .map((nodeName) => {
2010
- return workflow.getNode(nodeName);
2011
- })
2012
- .filter((connectedNode) => connectedNode.disabled !== true)
2013
- .map(async (connectedNode) => {
2014
- const nodeType = workflow.nodeTypes.getByNameAndVersion(connectedNode.type, connectedNode.typeVersion);
2015
- if (!nodeType.supplyData) {
2016
- throw new n8n_workflow_1.ApplicationError('Node does not have a `supplyData` method defined', {
2017
- extra: { nodeName: connectedNode.name },
2018
- });
2019
- }
2020
- const context = Object.assign({}, this);
2021
- context.getNodeParameter = (parameterName, itemIndex, fallbackValue, options) => {
2022
- return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, connectedNode, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), executeData, fallbackValue, { ...(options || {}), contextNode: node });
2023
- };
2024
- context.getNode = () => {
2025
- return (0, n8n_workflow_1.deepCopy)(connectedNode);
2026
- };
2027
- context.getCredentials = async (key) => {
2028
- try {
2029
- return await getCredentials(workflow, connectedNode, key, additionalData, mode, runExecutionData, runIndex, connectionInputData, itemIndex);
2030
- }
2031
- catch (error) {
2032
- let currentNodeRunIndex = 0;
2033
- if (runExecutionData.resultData.runData.hasOwnProperty(node.name)) {
2034
- currentNodeRunIndex = runExecutionData.resultData.runData[node.name].length;
2035
- }
2036
- await addExecutionDataFunctions('input', connectedNode.name, error, runExecutionData, inputName, additionalData, node.name, runIndex, currentNodeRunIndex);
2037
- throw error;
2038
- }
2039
- };
2040
- try {
2041
- return await nodeType.supplyData.call(context, itemIndex);
2042
- }
2043
- catch (error) {
2044
- if (error.functionality === 'configuration-node')
2045
- throw error;
2046
- if (!(error instanceof n8n_workflow_1.ExecutionBaseError)) {
2047
- error = new n8n_workflow_1.NodeOperationError(connectedNode, error, {
2048
- itemIndex,
2049
- });
2050
- }
2051
- let currentNodeRunIndex = 0;
2052
- if (runExecutionData.resultData.runData.hasOwnProperty(node.name)) {
2053
- currentNodeRunIndex = runExecutionData.resultData.runData[node.name].length;
2054
- }
2055
- await addExecutionDataFunctions('input', connectedNode.name, error, runExecutionData, inputName, additionalData, node.name, runIndex, currentNodeRunIndex);
2056
- throw new n8n_workflow_1.NodeOperationError(connectedNode, `Error in sub-node ${connectedNode.name}`, {
2057
- itemIndex,
2058
- functionality: 'configuration-node',
2059
- description: error.message,
2060
- });
2061
- }
2062
- });
2063
- const nodes = await Promise.all(constParentNodes);
2064
- if (inputConfiguration.required && nodes.length === 0) {
2065
- throw new n8n_workflow_1.NodeOperationError(node, `A ${inputName} processor node must be connected!`);
2066
- }
2067
- if (inputConfiguration.maxConnections !== undefined &&
2068
- nodes.length > inputConfiguration.maxConnections) {
2069
- throw new n8n_workflow_1.NodeOperationError(node, `Only ${inputConfiguration.maxConnections} ${inputName} processor nodes are/is allowed to be connected!`);
2070
- }
2071
- return inputConfiguration.maxConnections === 1
2072
- ? (_a = (nodes || [])[0]) === null || _a === void 0 ? void 0 : _a.response
2073
- : nodes.map((node) => node.response);
2087
+ return getInputConnectionData.call(this, workflow, runExecutionData, runIndex, connectionInputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex, inputIndex);
2074
2088
  },
2075
2089
  getNodeOutputs() {
2076
2090
  const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
@@ -2194,7 +2208,7 @@ function getExecuteSingleFunctions(workflow, runExecutionData, runIndex, connect
2194
2208
  getContext(type) {
2195
2209
  return n8n_workflow_1.NodeHelpers.getContext(runExecutionData, type, node);
2196
2210
  },
2197
- getCredentials: async (type) => getCredentials(workflow, node, type, additionalData, mode, runExecutionData, runIndex, connectionInputData, itemIndex),
2211
+ getCredentials: async (type) => getCredentials(workflow, node, type, additionalData, mode, executeData, runExecutionData, runIndex, connectionInputData, itemIndex),
2198
2212
  getInputData: (inputIndex = 0, inputName = 'main') => {
2199
2213
  if (!inputData.hasOwnProperty(inputName)) {
2200
2214
  return { json: {} };
@@ -2319,7 +2333,7 @@ function getExecuteHookFunctions(workflow, node, additionalData, mode, activatio
2319
2333
  })(workflow, node);
2320
2334
  }
2321
2335
  exports.getExecuteHookFunctions = getExecuteHookFunctions;
2322
- function getExecuteWebhookFunctions(workflow, node, additionalData, mode, webhookData) {
2336
+ function getExecuteWebhookFunctions(workflow, node, additionalData, mode, webhookData, closeFunctions) {
2323
2337
  return ((workflow, node) => {
2324
2338
  return {
2325
2339
  ...getCommonWorkflowFunctions(workflow, node, additionalData),
@@ -2336,6 +2350,26 @@ function getExecuteWebhookFunctions(workflow, node, additionalData, mode, webhoo
2336
2350
  }
2337
2351
  return additionalData.httpRequest.headers;
2338
2352
  },
2353
+ async getInputConnectionData(inputName, itemIndex, inputIndex) {
2354
+ var _a;
2355
+ const connectionInputData = [
2356
+ { json: ((_a = additionalData.httpRequest) === null || _a === void 0 ? void 0 : _a.body) || {} },
2357
+ ];
2358
+ const runExecutionData = {
2359
+ resultData: {
2360
+ runData: {},
2361
+ },
2362
+ };
2363
+ const executeData = {
2364
+ data: {
2365
+ main: [connectionInputData],
2366
+ },
2367
+ node,
2368
+ source: null,
2369
+ };
2370
+ const runIndex = 0;
2371
+ return getInputConnectionData.call(this, workflow, runExecutionData, runIndex, connectionInputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex, inputIndex);
2372
+ },
2339
2373
  getMode: () => mode,
2340
2374
  getNodeParameter: (parameterName, fallbackValue, options) => {
2341
2375
  const runExecutionData = null;