From 7f8b943c1ae805807134205eae8ebb24cef5511e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 30 May 2025 12:37:18 +0200 Subject: [PATCH] fix(core): Support `helpers.request` in task runners (#15859) --- packages/@n8n/task-runner/src/runner-types.ts | 3 +++ .../task-runners/task-managers/__tests__/task-manager.test.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/@n8n/task-runner/src/runner-types.ts b/packages/@n8n/task-runner/src/runner-types.ts index e4e76189e2..7b13e8fe70 100644 --- a/packages/@n8n/task-runner/src/runner-types.ts +++ b/packages/@n8n/task-runner/src/runner-types.ts @@ -119,6 +119,9 @@ export const EXPOSED_RPC_METHODS = [ // httpRequest(opts: IHttpRequestOptions): Promise 'helpers.httpRequest', + + // (deprecated) request(uriOrObject: string | IRequestOptions, options?: IRequestOptions): Promise; + 'helpers.request', ]; /** Helpers that exist but that we are not exposing to the Code Node */ diff --git a/packages/cli/src/task-runners/task-managers/__tests__/task-manager.test.ts b/packages/cli/src/task-runners/task-managers/__tests__/task-manager.test.ts index 3066f25cfd..226f491908 100644 --- a/packages/cli/src/task-runners/task-managers/__tests__/task-manager.test.ts +++ b/packages/cli/src/task-runners/task-managers/__tests__/task-manager.test.ts @@ -30,6 +30,7 @@ describe('TaskRequester', () => { ['helpers.setBinaryDataBuffer', [{ data: '123' }, Buffer.from('data').toJSON()]], ['helpers.binaryToString', [Buffer.from('data').toJSON(), 'utf8']], ['helpers.httpRequest', [{ url: 'http://localhost' }]], + ['helpers.request', [{ url: 'http://localhost' }]], ])('should handle %s rpc call', async (methodName, args) => { const executeFunctions = set({}, methodName.split('.'), jest.fn());