mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Offload manual executions to workers (#11284)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user