mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
address PR comments
This commit is contained in:
parent
1aabca8319
commit
d407726da4
|
@ -138,6 +138,7 @@ export class WaitTracker {
|
|||
|
||||
const { parentExecution } = fullExecutionData.data;
|
||||
if (parentExecution) {
|
||||
// on child execution completion, resume parent execution
|
||||
void this.activeExecutions.getPostExecutePromise(executionId).then(() => {
|
||||
void this.startExecution(parentExecution.executionId);
|
||||
});
|
||||
|
|
|
@ -48,7 +48,7 @@ import type { Project } from '@/databases/entities/project';
|
|||
import { InternalServerError } from '@/errors/response-errors/internal-server.error';
|
||||
import { NotFoundError } from '@/errors/response-errors/not-found.error';
|
||||
import { UnprocessableRequestError } from '@/errors/response-errors/unprocessable.error';
|
||||
import type { IExecutionDb, IWorkflowDb } from '@/interfaces';
|
||||
import type { IWorkflowDb } from '@/interfaces';
|
||||
import { Logger } from '@/logging/logger.service';
|
||||
import { parseBody } from '@/middlewares';
|
||||
import { OwnershipService } from '@/services/ownership.service';
|
||||
|
@ -549,13 +549,14 @@ export async function executeWebhook(
|
|||
{ executionId },
|
||||
);
|
||||
|
||||
const activeExecutions = Container.get(ActiveExecutions);
|
||||
|
||||
// Get a promise which resolves when the workflow did execute and send then response
|
||||
const executePromise = Container.get(ActiveExecutions).getPostExecutePromise(
|
||||
executionId,
|
||||
) as Promise<IExecutionDb | undefined>;
|
||||
const executePromise = activeExecutions.getPostExecutePromise(executionId);
|
||||
|
||||
const { parentExecution } = runExecutionData;
|
||||
if (parentExecution) {
|
||||
// on child execution completion, resume parent execution
|
||||
void executePromise.then(() => {
|
||||
const waitTracker = Container.get(WaitTracker);
|
||||
void waitTracker.startExecution(parentExecution.executionId);
|
||||
|
|
|
@ -115,14 +115,14 @@ export class BaseExecuteContext extends NodeExecutionContext {
|
|||
): Promise<ExecuteWorkflowData> {
|
||||
const result = await this.additionalData.executeWorkflow(workflowInfo, this.additionalData, {
|
||||
...options,
|
||||
parentWorkflowId: this.workflow.id?.toString(),
|
||||
parentWorkflowId: this.workflow.id,
|
||||
inputData,
|
||||
parentWorkflowSettings: this.workflow.settings,
|
||||
node: this.node,
|
||||
parentCallbackManager,
|
||||
});
|
||||
|
||||
// If a subworkflow goes into the waiting state, then put the parent workflow also into the waiting state
|
||||
// If a sub-workflow execution goes into the waiting state, then put the parent workflow execution also into the waiting state
|
||||
if (result.waitTill) {
|
||||
await this.putExecutionToWait(result.waitTill);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue