import { type MemorySaver } from '@langchain/langgraph'; import type { Logger } from '@n8n/backend-common'; import type { INodeTypeDescription } from 'n8n-workflow'; import type { AssistantHandler } from './assistant'; import type { SsrfGuard } from './tools/utils/ssrf-guard'; import { type CoordinationLogEntry } from './types/coordination'; import type { BuilderFeatureFlags, StageLLMs } from './workflow-builder-agent'; export interface MultiAgentSubgraphConfig { parsedNodeTypes: INodeTypeDescription[]; stageLLMs: StageLLMs; logger?: Logger; checkpointer?: MemorySaver; autoCompactThresholdTokens?: number; featureFlags?: BuilderFeatureFlags; assistantHandler?: AssistantHandler; ssrf?: SsrfGuard; } export declare function createMultiAgentWorkflowWithSubgraphs(config: MultiAgentSubgraphConfig): import("@langchain/langgraph").CompiledStateGraph<{ messages: import("@langchain/core/messages").BaseMessage, import("@langchain/core/messages").MessageType>[]; workflowJSON: import("./types").SimpleWorkflow; workflowContext: { executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined; nextPhase: string; discoveryContext: import("./types/discovery-types").DiscoveryContext | null; workflowOperations: import("./types").WorkflowOperation[]; coordinationLog: CoordinationLogEntry[]; previousSummary: string; templateIds: number[]; cachedTemplates: import("./types").WorkflowMetadata[]; planOutput: import("./types").PlanOutput | null; mode: "build" | "plan"; planDecision: import("./types").PlanDecision | null; planFeedback: string | null; planPrevious: import("./types").PlanOutput | null; introspectionEvents: import("./tools/introspect.tool").IntrospectionEvent[]; sdkSessionId: string | undefined; approvedDomains: string[]; webFetchCount: number; allDomainsApproved: boolean; }, { messages?: import("@langchain/core/messages").BaseMessage, import("@langchain/core/messages").MessageType>[] | import("@langchain/langgraph").OverwriteValue, import("@langchain/core/messages").MessageType>[]> | undefined; workflowJSON?: import("@langchain/langgraph").OverwriteValue | import("./types").SimpleWorkflow | undefined; workflowContext?: import("@langchain/langgraph").OverwriteValue<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined> | { executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined; nextPhase?: string | import("@langchain/langgraph").OverwriteValue | undefined; discoveryContext?: import("./types/discovery-types").DiscoveryContext | import("@langchain/langgraph").OverwriteValue | null | undefined; workflowOperations?: import("./types").WorkflowOperation[] | import("@langchain/langgraph").OverwriteValue | undefined; coordinationLog?: CoordinationLogEntry[] | import("@langchain/langgraph").OverwriteValue | undefined; previousSummary?: string | import("@langchain/langgraph").OverwriteValue | undefined; templateIds?: number[] | import("@langchain/langgraph").OverwriteValue | undefined; cachedTemplates?: import("./types").WorkflowMetadata[] | import("@langchain/langgraph").OverwriteValue | undefined; planOutput?: import("@langchain/langgraph").OverwriteValue | import("./types").PlanOutput | null | undefined; mode?: "build" | "plan" | import("@langchain/langgraph").OverwriteValue<"build" | "plan"> | undefined; planDecision?: import("@langchain/langgraph").OverwriteValue | import("./types").PlanDecision | null | undefined; planFeedback?: string | import("@langchain/langgraph").OverwriteValue | null | undefined; planPrevious?: import("@langchain/langgraph").OverwriteValue | import("./types").PlanOutput | null | undefined; introspectionEvents?: import("./tools/introspect.tool").IntrospectionEvent[] | import("@langchain/langgraph").OverwriteValue | undefined; sdkSessionId?: string | import("@langchain/langgraph").OverwriteValue | undefined; approvedDomains?: string[] | import("@langchain/langgraph").OverwriteValue | undefined; webFetchCount?: number | import("@langchain/langgraph").OverwriteValue | undefined; allDomainsApproved?: boolean | import("@langchain/langgraph").OverwriteValue | undefined; }, "__start__" | "assistant_subgraph" | "check_state" | "cleanup_dangling" | "clear_error_state" | "compact_messages" | "create_workflow_name" | "delete_messages" | "discovery_subgraph" | "responder" | "route_next_phase" | "supervisor", { messages: import("@langchain/langgraph").BaseChannel, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage, import("@langchain/core/messages").MessageType>[] | import("@langchain/langgraph").OverwriteValue, import("@langchain/core/messages").MessageType>[]>, unknown>; workflowJSON: import("@langchain/langgraph").BaseChannel | import("./types").SimpleWorkflow, unknown>; workflowContext: import("@langchain/langgraph").BaseChannel<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, import("@langchain/langgraph").OverwriteValue<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined> | { executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, unknown>; nextPhase: import("@langchain/langgraph").BaseChannel, unknown>; discoveryContext: import("@langchain/langgraph").BaseChannel | null, unknown>; workflowOperations: import("@langchain/langgraph").BaseChannel, unknown>; coordinationLog: import("@langchain/langgraph").BaseChannel, unknown>; previousSummary: import("@langchain/langgraph").BaseChannel, unknown>; templateIds: import("@langchain/langgraph").BaseChannel, unknown>; cachedTemplates: import("@langchain/langgraph").BaseChannel, unknown>; planOutput: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; mode: import("@langchain/langgraph").BaseChannel<"build" | "plan", "build" | "plan" | import("@langchain/langgraph").OverwriteValue<"build" | "plan">, unknown>; planDecision: import("@langchain/langgraph").BaseChannel | import("./types").PlanDecision | null, unknown>; planFeedback: import("@langchain/langgraph").BaseChannel | null, unknown>; planPrevious: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; introspectionEvents: import("@langchain/langgraph").BaseChannel, unknown>; sdkSessionId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; approvedDomains: import("@langchain/langgraph").BaseChannel, unknown>; webFetchCount: import("@langchain/langgraph").BaseChannel, unknown>; allDomainsApproved: import("@langchain/langgraph").BaseChannel, unknown>; }, { messages: import("@langchain/langgraph").BaseChannel, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage, import("@langchain/core/messages").MessageType>[] | import("@langchain/langgraph").OverwriteValue, import("@langchain/core/messages").MessageType>[]>, unknown>; workflowJSON: import("@langchain/langgraph").BaseChannel | import("./types").SimpleWorkflow, unknown>; workflowContext: import("@langchain/langgraph").BaseChannel<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, import("@langchain/langgraph").OverwriteValue<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined> | { executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, unknown>; nextPhase: import("@langchain/langgraph").BaseChannel, unknown>; discoveryContext: import("@langchain/langgraph").BaseChannel | null, unknown>; workflowOperations: import("@langchain/langgraph").BaseChannel, unknown>; coordinationLog: import("@langchain/langgraph").BaseChannel, unknown>; previousSummary: import("@langchain/langgraph").BaseChannel, unknown>; templateIds: import("@langchain/langgraph").BaseChannel, unknown>; cachedTemplates: import("@langchain/langgraph").BaseChannel, unknown>; planOutput: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; mode: import("@langchain/langgraph").BaseChannel<"build" | "plan", "build" | "plan" | import("@langchain/langgraph").OverwriteValue<"build" | "plan">, unknown>; planDecision: import("@langchain/langgraph").BaseChannel | import("./types").PlanDecision | null, unknown>; planFeedback: import("@langchain/langgraph").BaseChannel | null, unknown>; planPrevious: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; introspectionEvents: import("@langchain/langgraph").BaseChannel, unknown>; sdkSessionId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; approvedDomains: import("@langchain/langgraph").BaseChannel, unknown>; webFetchCount: import("@langchain/langgraph").BaseChannel, unknown>; allDomainsApproved: import("@langchain/langgraph").BaseChannel, unknown>; }, import("@langchain/langgraph").StateDefinition, { assistant_subgraph: import("@langchain/langgraph").UpdateType<{ messages: import("@langchain/langgraph").BaseChannel, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage, import("@langchain/core/messages").MessageType>[] | import("@langchain/langgraph").OverwriteValue, import("@langchain/core/messages").MessageType>[]>, unknown>; workflowJSON: import("@langchain/langgraph").BaseChannel | import("./types").SimpleWorkflow, unknown>; workflowContext: import("@langchain/langgraph").BaseChannel<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, import("@langchain/langgraph").OverwriteValue<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined> | { executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, unknown>; nextPhase: import("@langchain/langgraph").BaseChannel, unknown>; discoveryContext: import("@langchain/langgraph").BaseChannel | null, unknown>; workflowOperations: import("@langchain/langgraph").BaseChannel, unknown>; coordinationLog: import("@langchain/langgraph").BaseChannel, unknown>; previousSummary: import("@langchain/langgraph").BaseChannel, unknown>; templateIds: import("@langchain/langgraph").BaseChannel, unknown>; cachedTemplates: import("@langchain/langgraph").BaseChannel, unknown>; planOutput: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; mode: import("@langchain/langgraph").BaseChannel<"build" | "plan", "build" | "plan" | import("@langchain/langgraph").OverwriteValue<"build" | "plan">, unknown>; planDecision: import("@langchain/langgraph").BaseChannel | import("./types").PlanDecision | null, unknown>; planFeedback: import("@langchain/langgraph").BaseChannel | null, unknown>; planPrevious: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; introspectionEvents: import("@langchain/langgraph").BaseChannel, unknown>; sdkSessionId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; approvedDomains: import("@langchain/langgraph").BaseChannel, unknown>; webFetchCount: import("@langchain/langgraph").BaseChannel, unknown>; allDomainsApproved: import("@langchain/langgraph").BaseChannel, unknown>; }>; check_state: { nextPhase: string; }; cleanup_dangling: { messages: import("@langchain/core/messages").RemoveMessage[]; }; clear_error_state: { coordinationLog: CoordinationLogEntry[]; }; compact_messages: { previousSummary: string; messages: import("@langchain/core/messages").BaseMessage[]; coordinationLog: CoordinationLogEntry[]; }; create_workflow_name: { workflowJSON: import("./types").SimpleWorkflow; }; delete_messages: { messages: import("@langchain/core/messages").RemoveMessage[]; workflowJSON: import("./types").SimpleWorkflow; previousSummary: string; discoveryContext: null; coordinationLog: CoordinationLogEntry[]; workflowOperations: []; }; discovery_subgraph: import("@langchain/langgraph").UpdateType<{ messages: import("@langchain/langgraph").BaseChannel, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage, import("@langchain/core/messages").MessageType>[] | import("@langchain/langgraph").OverwriteValue, import("@langchain/core/messages").MessageType>[]>, unknown>; workflowJSON: import("@langchain/langgraph").BaseChannel | import("./types").SimpleWorkflow, unknown>; workflowContext: import("@langchain/langgraph").BaseChannel<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, import("@langchain/langgraph").OverwriteValue<{ executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined> | { executionSchema?: import("n8n-workflow").NodeExecutionSchema[]; currentWorkflow?: Partial; executionData?: import("n8n-workflow").IRunExecutionData['resultData']; expressionValues?: Record; valuesExcluded?: boolean; pinnedNodes?: string[]; selectedNodes?: import("@n8n/api-types").SelectedNodeContext[]; } | undefined, unknown>; nextPhase: import("@langchain/langgraph").BaseChannel, unknown>; discoveryContext: import("@langchain/langgraph").BaseChannel | null, unknown>; workflowOperations: import("@langchain/langgraph").BaseChannel, unknown>; coordinationLog: import("@langchain/langgraph").BaseChannel, unknown>; previousSummary: import("@langchain/langgraph").BaseChannel, unknown>; templateIds: import("@langchain/langgraph").BaseChannel, unknown>; cachedTemplates: import("@langchain/langgraph").BaseChannel, unknown>; planOutput: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; mode: import("@langchain/langgraph").BaseChannel<"build" | "plan", "build" | "plan" | import("@langchain/langgraph").OverwriteValue<"build" | "plan">, unknown>; planDecision: import("@langchain/langgraph").BaseChannel | import("./types").PlanDecision | null, unknown>; planFeedback: import("@langchain/langgraph").BaseChannel | null, unknown>; planPrevious: import("@langchain/langgraph").BaseChannel | import("./types").PlanOutput | null, unknown>; introspectionEvents: import("@langchain/langgraph").BaseChannel, unknown>; sdkSessionId: import("@langchain/langgraph").BaseChannel | undefined, unknown>; approvedDomains: import("@langchain/langgraph").BaseChannel, unknown>; webFetchCount: import("@langchain/langgraph").BaseChannel, unknown>; allDomainsApproved: import("@langchain/langgraph").BaseChannel, unknown>; }>; responder: { messages?: undefined; coordinationLog: { phase: 'responder'; status: 'completed'; timestamp: number; summary: string; metadata: import("./types/coordination").ResponderMetadata; }[]; introspectionEvents?: undefined; } | { messages: import("@langchain/core/messages").BaseMessage, import("@langchain/core/messages").MessageType>[]; coordinationLog: ({ phase: 'responder'; status: 'in_progress'; timestamp: number; summary: string; metadata: import("./types/coordination").ResponderMetadata; } | { phase: 'responder'; status: 'completed'; timestamp: number; summary: string; metadata: import("./types/coordination").ResponderMetadata; })[]; introspectionEvents: import("./tools/introspect.tool").IntrospectionEvent[]; }; supervisor: { nextPhase: "assistant" | "builder" | "discovery" | "responder"; }; }, unknown, unknown, []>;