diff --git a/packages/cli/src/webhooks/__tests__/engine-v2-webhooks.test.ts b/packages/cli/src/webhooks/__tests__/engine-v2-webhooks.test.ts index b8015b54dca..93f0793249e 100644 --- a/packages/cli/src/webhooks/__tests__/engine-v2-webhooks.test.ts +++ b/packages/cli/src/webhooks/__tests__/engine-v2-webhooks.test.ts @@ -1,7 +1,6 @@ import type { StepSlots } from '@n8n/engine'; -import type { EngineConfig } from '@n8n/config'; import type { INode, WebhookResponseMode } from 'n8n-workflow'; -import { UserError, WorkflowOperationError } from 'n8n-workflow'; +import { WorkflowOperationError } from 'n8n-workflow'; import { mock } from 'vitest-mock-extended'; import { EngineDataPlaneProxyService } from '@/services/engine-data-plane-proxy.service'; @@ -13,18 +12,16 @@ const engineV2Webhooks = new EngineV2Webhooks( mock(), mock(), mock(), - mock(), ); describe('EngineV2Webhooks.assertSupported', () => { - const assertSupported = (mode: EngineConfig['mode'], responseMode: WebhookResponseMode) => { + const assertSupported = (responseMode: WebhookResponseMode) => { const proxy = mock(); proxy.isAvailable.mockReturnValue(true); const webhooks = new EngineV2Webhooks( mock(), mock(), proxy, - mock({ mode }), ); webhooks.assertSupported({ @@ -38,21 +35,14 @@ describe('EngineV2Webhooks.assertSupported', () => { }); }; - it.each(['lastNode', 'responseNode'] as const)( - 'rejects %s responses with a remote data plane', + // The engine mode no longer reaches this check, so these modes pass with a + // remote data plane and in-process alike. + it.each(['onReceived', 'lastNode', 'responseNode'] as const)( + 'allows %s responses in every engine mode', (responseMode) => { - expect(() => assertSupported('remote', responseMode)).toThrow(UserError); - expect(() => assertSupported('remote', responseMode)).toThrow('remote data plane'); + expect(() => assertSupported(responseMode)).not.toThrow(); }, ); - - it('allows onReceived with a remote data plane', () => { - expect(() => assertSupported('remote', 'onReceived')).not.toThrow(); - }); - - it.each(['lastNode', 'responseNode'] as const)('allows %s in-process', (responseMode) => { - expect(() => assertSupported('in-process', responseMode)).not.toThrow(); - }); }); describe('EngineV2Webhooks.toRun', () => { diff --git a/packages/cli/src/webhooks/engine-v2-webhooks.ts b/packages/cli/src/webhooks/engine-v2-webhooks.ts index 43907eb5bd7..a4103a8d710 100644 --- a/packages/cli/src/webhooks/engine-v2-webhooks.ts +++ b/packages/cli/src/webhooks/engine-v2-webhooks.ts @@ -1,4 +1,3 @@ -import { EngineConfig } from '@n8n/config'; import { Service } from '@n8n/di'; import type { INode, @@ -73,7 +72,6 @@ export class EngineV2Webhooks { private readonly dispatcher: EngineV2Dispatcher, private readonly payloadGuard: EngineV2PayloadGuard, private readonly proxy: EngineDataPlaneProxyService, - private readonly engineConfig: EngineConfig, ) {} /** Whether this webhook run starts on the engine v2 data plane. */ @@ -133,11 +131,6 @@ export class EngineV2Webhooks { `Engine v2 does not support the '${responseMode}' response mode yet. Respond immediately instead.`, ); } - if (this.engineConfig.mode === 'remote' && responseMode !== 'onReceived') { - throw new UserError( - `Engine v2 does not support the '${responseMode}' response mode with a remote data plane yet. Respond immediately instead.`, - ); - } } /** Converts the data plane's answer to the shape the v1 response path reads. */