import type { BuiltAgent, BuiltTool, CredentialProvider } from '@n8n/agents'; import { Logger } from '@n8n/backend-common'; import { AiConfig } from '@n8n/config'; 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 { AgentRunTracingService } from './agent-run-tracing.service'; import { AgentRuntimeReconstructionService } from './agent-runtime-reconstruction.service'; import { type AgentSandboxPrincipalHash } from './agent-sandbox-principal'; import { AgentTurnExecutionService } from './agent-turn-execution.service'; import type { Agent } from './entities/agent.entity'; import { IntegrationMessageContextService } from './integrations/integration-message-context.service'; import { NodeToolAiGatewayService } from './json-config/node-tool-ai-gateway.service'; import { AgentRepository } from './repositories/agent.repository'; import { type WorkflowAgentStreamObserver } from './workflow-agent-stream'; interface WorkflowSandboxScope { principalHash: AgentSandboxPrincipalHash; } export declare class AgentWorkflowExecutionService { private readonly logger; private readonly agentRepository; private readonly turnExecutionService; private readonly telemetry; private readonly credentialsService; private readonly agentRuntimeReconstructionService; private readonly agentRunTracingService; private readonly executionLevelTracer; private readonly nodeToolAiGatewayService; private readonly aiConfig; private readonly integrationMessageContextService; constructor(logger: Logger, agentRepository: AgentRepository, turnExecutionService: AgentTurnExecutionService, telemetry: Telemetry, credentialsService: CredentialsService, agentRuntimeReconstructionService: AgentRuntimeReconstructionService, agentRunTracingService: AgentRunTracingService, executionLevelTracer: ExecutionLevelTracer, nodeToolAiGatewayService: NodeToolAiGatewayService, aiConfig: AiConfig, integrationMessageContextService: IntegrationMessageContextService); private normalizeWorkflowStreamError; private applyPerCallAgentExtras; compileIsolated(agentEntity: Agent, credentialProvider: CredentialProvider, runType: AgentRunTelemetryType, outputSchema?: JSONSchema7, extraTools?: BuiltTool[], sandboxPrincipalHash?: AgentSandboxPrincipalHash): Promise<{ ok: boolean; agent?: BuiltAgent; error?: string; }>; private compileIsolatedFromSource; private buildWorkflowExtraTools; private consumeWorkflowAgentStream; private streamWorkflowAgent; private buildWorkflowResult; executeForWorkflow(agentId: string, message: string, executionId: string, threadId: string, projectId: string, telemetryUserId?: string, useDraftVersion?: boolean, outputSchema?: JSONSchema7, workflowContext?: ExecuteAgentWorkflowContext, sandboxScope?: WorkflowSandboxScope, streamObserver?: WorkflowAgentStreamObserver): Promise; private executeForWorkflowInternal; executeInlineForWorkflow(inlineAgent: InlineAgentPayload, message: string, executionId: string, threadId: string, projectId: string, telemetryUserId?: string, runType?: AgentRunTelemetryType, outputSchema?: JSONSchema7, workflowContext?: ExecuteAgentWorkflowContext, streamObserver?: WorkflowAgentStreamObserver): Promise; private validateInlineAgentConfig; } export {};