feat(core): Parent workflows should wait for sub-workflows to finish (#11985)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-12-06 12:20:34 +01:00
committed by GitHub
parent 956b11a560
commit 60b3dccf93
18 changed files with 257 additions and 70 deletions

View File

@@ -7,7 +7,6 @@ import type {
NodeTypeAndVersion,
} from 'n8n-workflow';
import {
WAIT_TIME_UNLIMITED,
Node,
updateDisplayOptions,
NodeOperationError,
@@ -16,6 +15,7 @@ import {
tryToParseJsonToFormFields,
NodeConnectionType,
WAIT_NODE_TYPE,
WAIT_INDEFINITELY,
} from 'n8n-workflow';
import { formDescription, formFields, formTitle } from '../Form/common.descriptions';
@@ -409,8 +409,7 @@ export class Form extends Node {
}
if (operation !== 'completion') {
const waitTill = new Date(WAIT_TIME_UNLIMITED);
await context.putExecutionToWait(waitTill);
await context.putExecutionToWait(WAIT_INDEFINITELY);
} else {
const staticData = context.getWorkflowStaticData('node');
const completionTitle = context.getNodeParameter('completionTitle', 0, '') as string;

View File

@@ -12,7 +12,7 @@ import {
NodeConnectionType,
NodeOperationError,
SEND_AND_WAIT_OPERATION,
WAIT_TIME_UNLIMITED,
WAIT_INDEFINITELY,
} from 'n8n-workflow';
import type { IEmail } from '../../../../utils/sendAndWait/interfaces';
@@ -270,7 +270,7 @@ export class GmailV2 implements INodeType {
raw: await encodeEmail(email),
});
await this.putExecutionToWait(new Date(WAIT_TIME_UNLIMITED));
await this.putExecutionToWait(WAIT_INDEFINITELY);
return [this.getInputData()];
}

View File

@@ -20,7 +20,7 @@ import {
NodeConnectionType,
NodeOperationError,
SEND_AND_WAIT_OPERATION,
WAIT_TIME_UNLIMITED,
WAIT_INDEFINITELY,
} from 'n8n-workflow';
import moment from 'moment-timezone';
@@ -379,7 +379,7 @@ export class SlackV2 implements INodeType {
createSendAndWaitMessageBody(this),
);
await this.putExecutionToWait(new Date(WAIT_TIME_UNLIMITED));
await this.putExecutionToWait(WAIT_INDEFINITELY);
return [this.getInputData()];
}

View File

@@ -7,7 +7,7 @@ import type {
IDisplayOptions,
IWebhookFunctions,
} from 'n8n-workflow';
import { WAIT_TIME_UNLIMITED, NodeOperationError, NodeConnectionType } from 'n8n-workflow';
import { NodeOperationError, NodeConnectionType, WAIT_INDEFINITELY } from 'n8n-workflow';
import {
authenticationProperty,
@@ -516,7 +516,7 @@ export class Wait extends Webhook {
}
private async configureAndPutToWait(context: IExecuteFunctions) {
let waitTill = new Date(WAIT_TIME_UNLIMITED);
let waitTill = WAIT_INDEFINITELY;
const limitWaitTime = context.getNodeParameter('limitWaitTime', 0);
if (limitWaitTime === true) {