feat(core): Offload manual executions to workers (#11284)

This commit is contained in:
Iván Ovejero
2025-01-03 10:43:05 +01:00
committed by GitHub
parent b6230b63f2
commit 9432aa0b00
23 changed files with 287 additions and 61 deletions

View File

@@ -37,10 +37,12 @@ import {
FORM_NODE_TYPE,
NodeOperationError,
} from 'n8n-workflow';
import assert from 'node:assert';
import { finished } from 'stream/promises';
import { Container } from 'typedi';
import { ActiveExecutions } from '@/active-executions';
import config from '@/config';
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';
@@ -531,6 +533,15 @@ export async function executeWebhook(
});
}
if (
config.getEnv('executions.mode') === 'queue' &&
process.env.OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS === 'true' &&
runData.executionMode === 'manual'
) {
assert(runData.executionData);
runData.executionData.isTestWebhook = true;
}
// Start now to run the workflow
executionId = await Container.get(WorkflowRunner).run(
runData,