/** * N8N Integration - Webhook triggers and workflow export for n8n */ export interface N8NConfig { baseUrl?: string; apiKey?: string; webhookPath?: string; } export interface N8NWebhookPayload { event: string; data: Record; timestamp: string; source: string; } export interface N8NWorkflowNode { id: string; name: string; type: string; position: [number, number]; parameters: Record; credentials?: Record; } export interface N8NWorkflowConnection { node: string; type: string; index: number; } export interface N8NWorkflow { name: string; nodes: N8NWorkflowNode[]; connections: Record; settings?: Record; } /** * N8N Integration class */ export declare class N8NIntegration { private config; constructor(config?: N8NConfig); /** * Trigger a webhook */ triggerWebhook(webhookId: string, payload: Record): Promise<{ success: boolean; response?: any; error?: string; }>; /** * Create a webhook payload for agent events */ createAgentEventPayload(event: string, agentId: string, data: Record): N8NWebhookPayload; /** * Export PraisonAI workflow to n8n format */ exportWorkflow(name: string, steps: Array<{ name: string; type: 'agent' | 'tool' | 'condition'; config?: Record; }>): N8NWorkflow; /** * Map PraisonAI step type to n8n node type */ private mapStepTypeToN8N; /** * Map step parameters to n8n format */ private mapStepParameters; /** * Generate n8n workflow JSON string */ exportWorkflowJSON(name: string, steps: Array<{ name: string; type: 'agent' | 'tool' | 'condition'; config?: Record; }>): string; /** * Import n8n workflow and convert to PraisonAI format */ importWorkflow(n8nWorkflow: N8NWorkflow): Array<{ name: string; type: string; config: Record; }>; /** * Map n8n node type to PraisonAI step type */ private mapN8NTypeToStep; /** * Create a webhook listener (for local development) */ createWebhookListener(port: number, handler: (payload: N8NWebhookPayload) => Promise): Promise<{ close: () => void; }>; } /** * Create an n8n integration instance */ export declare function createN8NIntegration(config?: N8NConfig): N8NIntegration; /** * Quick function to trigger an n8n webhook */ export declare function triggerN8NWebhook(webhookId: string, payload: Record, config?: N8NConfig): Promise<{ success: boolean; response?: any; error?: string; }>;