UNPKG

n8n

Version:

n8n Workflow Automation Tool

48 lines (47 loc) 1.97 kB
import { Logger } from '@n8n/backend-common'; import { CredentialsRepository, SharedCredentialsRepository } from '@n8n/db'; import type { INodeCredentialsDetails, INodeExecutionData, INodeParameters } from 'n8n-workflow'; import { NodeTypes } from '../node-types'; export type EphemeralWorkflowToolLike = { projectId: string; nodeType: string; nodeTypeVersion: number; nodeParameters: INodeParameters; credentials?: Record<string, INodeCredentialsDetails> | null; }; export interface InlineNodeExecutionRequest { nodeType: string; nodeTypeVersion: number; nodeParameters: INodeParameters; credentials?: Record<string, string>; credentialDetails?: Record<string, INodeCredentialsDetails>; inputData: INodeExecutionData[]; projectId: string; } export interface NodeExecutionResult { status: 'success' | 'error'; data: INodeExecutionData[]; error?: string; } export declare const AGENT_PROVIDER_NODE_WHITELIST: Set<string>; export declare function isAgentProviderNode(nodeType: string): boolean; export declare function isUsableAsAgentTool(description: { usableAsTool?: unknown; outputs?: unknown; }): boolean; export declare class EphemeralNodeExecutor { private readonly nodeTypes; private readonly credentialsRepository; private readonly sharedCredentialsRepository; private readonly logger; constructor(nodeTypes: NodeTypes, credentialsRepository: CredentialsRepository, sharedCredentialsRepository: SharedCredentialsRepository, logger: Logger); private resolveInlineCredentials; private verifyCredentialDetailsForProject; private validateNodeForExecution; private buildEphemeralContextParts; private executeNodeDirectly; executeInline(request: InlineNodeExecutionRequest): Promise<NodeExecutionResult>; private withSupplyDataTool; private invokeSupplyDataTool; introspectSupplyDataToolSchema(tool: EphemeralWorkflowToolLike): Promise<unknown>; }