n8n
Version:
n8n Workflow Automation Tool
41 lines (40 loc) • 2.9 kB
TypeScript
import type { BuiltAgent, BuiltTool, CredentialProvider } from '@n8n/agents';
import { Logger } from '@n8n/backend-common';
import type { JSONSchema7 } from 'json-schema';
import { type ExecuteAgentData, type ExecuteAgentWorkflowContext, type InlineAgentPayload } from 'n8n-workflow';
import { CredentialsService } from '../../credentials/credentials.service';
import type { AgentRunTelemetryType } from '../../interfaces';
import { ExecutionLevelTracer } from '../../modules/otel/execution-level-tracer';
import { Telemetry } from '../../telemetry';
import { AgentExecutionService } from './agent-execution.service';
import { AgentRunTracingService } from './agent-run-tracing.service';
import { AgentRuntimeReconstructionService } from './agent-runtime-reconstruction.service';
import type { Agent } from './entities/agent.entity';
import { NodeToolAiGatewayService } from './json-config/node-tool-ai-gateway.service';
import { AgentRepository } from './repositories/agent.repository';
export declare class AgentWorkflowExecutionService {
private readonly logger;
private readonly agentRepository;
private readonly agentExecutionService;
private readonly telemetry;
private readonly credentialsService;
private readonly agentRuntimeReconstructionService;
private readonly agentRunTracingService;
private readonly executionLevelTracer;
private readonly nodeToolAiGatewayService;
constructor(logger: Logger, agentRepository: AgentRepository, agentExecutionService: AgentExecutionService, telemetry: Telemetry, credentialsService: CredentialsService, agentRuntimeReconstructionService: AgentRuntimeReconstructionService, agentRunTracingService: AgentRunTracingService, executionLevelTracer: ExecutionLevelTracer, nodeToolAiGatewayService: NodeToolAiGatewayService);
private normalizeWorkflowStreamError;
private applyPerCallAgentExtras;
compileIsolated(agentEntity: Agent, credentialProvider: CredentialProvider, runType: AgentRunTelemetryType, outputSchema?: JSONSchema7, extraTools?: BuiltTool[]): Promise<{
ok: boolean;
agent?: BuiltAgent;
error?: string;
}>;
private compileIsolatedFromSource;
private buildWorkflowExtraTools;
private streamWorkflowAgent;
private buildWorkflowResult;
executeForWorkflow(agentId: string, message: string, executionId: string, threadId: string, projectId: string, telemetryUserId?: string, useDraftVersion?: boolean, outputSchema?: JSONSchema7, workflowContext?: ExecuteAgentWorkflowContext): Promise<ExecuteAgentData>;
executeInlineForWorkflow(inlineAgent: InlineAgentPayload, message: string, executionId: string, threadId: string, projectId: string, telemetryUserId?: string, runType?: AgentRunTelemetryType, outputSchema?: JSONSchema7, workflowContext?: ExecuteAgentWorkflowContext): Promise<ExecuteAgentData>;
private validateInlineAgentConfig;
}