{
  "openruna_format": "flow-graph-v1",
  "title": "AI Agent to chat with you Search Console Data, using OpenAI and Postgres",
  "slug": "ai-agent-to-chat-with-you-search-console-data-using-openai-and-postgres",
  "source_filename": "1252_Webhook_Respondtowebhook_Automation_Webhook.json",
  "nodes": [
    {
      "id": "Postgres Chat Memory",
      "name": "Postgres Chat Memory",
      "integration": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "kind": "action"
    },
    {
      "id": "OpenAI Chat Model",
      "name": "OpenAI Chat Model",
      "integration": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "kind": "action"
    },
    {
      "id": "Set fields",
      "name": "Set fields",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Webhook - ChatInput",
      "name": "Webhook - ChatInput",
      "integration": "webhook",
      "kind": "trigger"
    },
    {
      "id": "Respond to Webhook",
      "name": "Respond to Webhook",
      "integration": "respondToWebhook",
      "kind": "action"
    },
    {
      "id": "Call Search Console Tool",
      "name": "Call Search Console Tool",
      "integration": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "kind": "action"
    },
    {
      "id": "Tool calling",
      "name": "Tool calling",
      "integration": "executeWorkflow",
      "kind": "trigger"
    },
    {
      "id": "Switch",
      "name": "Switch",
      "integration": "switch",
      "kind": "logic"
    },
    {
      "id": "Set fields - Consruct API CALL",
      "name": "Set fields - Consruct API CALL",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Set fields - Create searchConsoleDataArray",
      "name": "Set fields - Create searchConsoleDataArray",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Set fields - Create searchConsoleDataArray 2",
      "name": "Set fields - Create searchConsoleDataArray 2",
      "integration": "set",
      "kind": "logic"
    },
    {
      "id": "Search Console - Get Custom Insights",
      "name": "Search Console - Get Custom Insights",
      "integration": "httpRequest",
      "kind": "action"
    },
    {
      "id": "## Search Console - Get List of Properties",
      "name": "## Search Console - Get List of Properties",
      "integration": "httpRequest",
      "kind": "action"
    },
    {
      "id": "Array aggregation - response to AI Agent",
      "name": "Array aggregation - response to AI Agent",
      "integration": "aggregate",
      "kind": "logic"
    },
    {
      "id": "Array aggregation - response to AI Agent1",
      "name": "Array aggregation - response to AI Agent1",
      "integration": "aggregate",
      "kind": "logic"
    },
    {
      "id": "AI Agent",
      "name": "AI Agent",
      "integration": "@n8n/n8n-nodes-langchain.agent",
      "kind": "action"
    }
  ],
  "edges": [
    {
      "from": "Switch",
      "to": "Search Console - Get Custom Insights"
    },
    {
      "from": "Switch",
      "to": "## Search Console - Get List of Properties"
    },
    {
      "from": "AI Agent",
      "to": "Respond to Webhook"
    },
    {
      "from": "Set fields",
      "to": "AI Agent"
    },
    {
      "from": "Tool calling",
      "to": "Set fields - Consruct API CALL"
    },
    {
      "from": "Webhook - ChatInput",
      "to": "Set fields"
    },
    {
      "from": "Set fields - Consruct API CALL",
      "to": "Switch"
    },
    {
      "from": "Search Console - Get Custom Insights",
      "to": "Set fields - Create searchConsoleDataArray"
    },
    {
      "from": "## Search Console - Get List of Properties",
      "to": "Set fields - Create searchConsoleDataArray 2"
    },
    {
      "from": "Set fields - Create searchConsoleDataArray",
      "to": "Array aggregation - response to AI Agent"
    },
    {
      "from": "Set fields - Create searchConsoleDataArray 2",
      "to": "Array aggregation - response to AI Agent1"
    }
  ]
}