feat(HTTP Request Node): Port optimizeResponse from httpRequest tool to standalone node (no-changelog) (#14307)

This commit is contained in:
Charlie Kolb
2025-04-16 08:48:16 +02:00
committed by GitHub
parent 7c1be05845
commit d42e61bc35
10 changed files with 602 additions and 23 deletions

View File

@@ -7,6 +7,7 @@ export const CUSTOM_EXTENSION_ENV = 'N8N_CUSTOM_EXTENSIONS';
export const PLACEHOLDER_EMPTY_EXECUTION_ID = '__UNKNOWN__';
export const PLACEHOLDER_EMPTY_WORKFLOW_ID = '__EMPTY__';
export const HTTP_REQUEST_NODE_TYPE = 'n8n-nodes-base.httpRequest';
export const HTTP_REQUEST_AS_TOOL_NODE_TYPE = 'n8n-nodes-base.httpRequestTool';
export const HTTP_REQUEST_TOOL_NODE_TYPE = '@n8n/n8n-nodes-langchain.toolHttpRequest';
export const RESTRICT_FILE_ACCESS_TO = 'N8N_RESTRICT_FILE_ACCESS_TO';

View File

@@ -28,7 +28,11 @@ import {
NodeOperationError,
} from 'n8n-workflow';
import { HTTP_REQUEST_NODE_TYPE, HTTP_REQUEST_TOOL_NODE_TYPE } from '@/constants';
import {
HTTP_REQUEST_AS_TOOL_NODE_TYPE,
HTTP_REQUEST_NODE_TYPE,
HTTP_REQUEST_TOOL_NODE_TYPE,
} from '@/constants';
import { Memoized } from '@/decorators';
import { InstanceSettings } from '@/instance-settings';
import { Logger } from '@/logging/logger';
@@ -190,7 +194,11 @@ export abstract class NodeExecutionContext implements Omit<FunctionsBase, 'getCr
// Hardcode for now for security reasons that only a single node can access
// all credentials
const fullAccess = [HTTP_REQUEST_NODE_TYPE, HTTP_REQUEST_TOOL_NODE_TYPE].includes(node.type);
const fullAccess = [
HTTP_REQUEST_NODE_TYPE,
HTTP_REQUEST_TOOL_NODE_TYPE,
HTTP_REQUEST_AS_TOOL_NODE_TYPE,
].includes(node.type);
let nodeCredentialDescription: INodeCredentialDescription | undefined;
if (!fullAccess) {