/** * JSON to AST Parser * * Converts n8n workflow JSON to intermediate AST representation */ import { N8nWorkflow, WorkflowAST } from '../types.js'; /** * Parse n8n workflow JSON to AST */ export declare class JsonToAstParser { /** * Parse workflow JSON to AST */ parse(workflow: N8nWorkflow): WorkflowAST; /** * Normalize workflow tags from API responses. * * n8n API responses may expose tags either as strings or as objects * containing id/name fields depending on the caller and endpoint. */ private parseTags; /** * Parse single node */ private parseNode; /** * Parse connections from n8n format to AST format * * n8n format: * { * "Node A": { * "main": [ * [{ node: "Node B", type: "main", index: 0 }] * ], * "ai_languageModel": [ * [{ node: "Agent", type: "ai_languageModel", index: 0 }] * ] * } * } * * AST format: * [ * { from: { node: "NodeA", output: 0 }, to: { node: "NodeB", input: 0 } } * ] * * NOTE: AI connections (ai_*) are extracted separately via extractAIDependencies() */ private parseConnections; /** * Extract AI dependencies from connections and populate node aiDependencies * * AI dependencies are connections like: * - ai_languageModel: The LLM model for an agent * - ai_memory: Memory buffer for an agent * - ai_outputParser: Output parser for structured responses * - ai_tool: Tools available to an agent (array) * - ai_agent: Agent sub-node * - ai_chain: Chain sub-node * - ai_document: Document loaders (array) * - ai_textSplitter: Text splitter sub-node * - ai_embedding: Embedding model sub-node * - ai_retriever: Retriever sub-node for RAG * - ai_reranker: Reranker sub-node * - ai_vectorStore: Vector store sub-node */ private extractAIDependencies; } //# sourceMappingURL=json-to-ast.d.ts.map