Merge remote-tracking branch 'origin/master' into release/1.0.1

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-07-05 20:01:24 +02:00
193 changed files with 16701 additions and 4702 deletions

View File

@@ -49,6 +49,7 @@ import type {
IRunNodeResponse,
NodeParameterValueType,
} from './Interfaces';
import { Node } from './Interfaces';
import type { IDeferredPromise } from './DeferredPromise';
import * as NodeHelpers from './NodeHelpers';
@@ -1137,14 +1138,14 @@ export class Workflow {
throw new Error(`The node "${node.name}" does not have any webhooks defined.`);
}
const thisArgs = nodeExecuteFunctions.getExecuteWebhookFunctions(
const context = nodeExecuteFunctions.getExecuteWebhookFunctions(
this,
node,
additionalData,
mode,
webhookData,
);
return nodeType.webhook.call(thisArgs);
return nodeType instanceof Node ? nodeType.webhook(context) : nodeType.webhook.call(context);
}
/**
@@ -1235,7 +1236,7 @@ export class Workflow {
}
if (nodeType.execute) {
const thisArgs = nodeExecuteFunctions.getExecuteFunctions(
const context = nodeExecuteFunctions.getExecuteFunctions(
this,
runExecutionData,
runIndex,
@@ -1246,7 +1247,11 @@ export class Workflow {
executionData,
mode,
);
return { data: await nodeType.execute.call(thisArgs) };
const data =
nodeType instanceof Node
? await nodeType.execute(context)
: await nodeType.execute.call(context);
return { data };
} else if (nodeType.poll) {
if (mode === 'manual') {
// In manual mode run the poll function