{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ac9787a4-30a4-4b0c-a436-96216c92c9f1",
      "name": "When User Asks Question",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "public": true,
        "options": {}
      },
      "typeVersion": 1.4
    },
    {
      "id": "ec8d0024-a6a9-4e99-b13a-674bc58e810c",
      "name": "CRM Assistant Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        208,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "5c42efa4-f4da-453b-9fee-ee2814186e7c",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        80,
        208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "3c6433ae-da9b-4bc8-895b-bedcabe92207",
      "name": "Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        224,
        208
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "78ff4f41-2b27-4871-8bbd-f60b464a5a2b",
      "name": "Search Contacts",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        368,
        208
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appXXXXXXXXXXXXXX",
          "cachedResultUrl": "https://airtable.com/appXXXXXXXXXXXXXX",
          "cachedResultName": "Contacts Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblXXXXXXXXXXXXXX",
          "cachedResultUrl": "https://airtable.com/appXXXXXXXXXXXXXX/tblXXXXXXXXXXXXXX",
          "cachedResultName": "Contacts"
        },
        "options": {},
        "operation": "search"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "32ee730c-f4e5-42e3-b0cc-dba03cd495fe",
      "name": "Search Companies",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        480,
        144
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appXXXXXXXXXXXXXX",
          "cachedResultUrl": "https://airtable.com/appXXXXXXXXXXXXXX",
          "cachedResultName": "Companies Database"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblYYYYYYYYYYYYYY",
          "cachedResultUrl": "https://airtable.com/appXXXXXXXXXXXXXX/tblYYYYYYYYYYYYYY",
          "cachedResultName": "Companies"
        },
        "options": {},
        "operation": "search"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "doc-note-1771263655471",
      "name": "Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -150
      ],
      "parameters": {
        "width": 600,
        "height": 854,
        "content": "## Workflow Overview\n\nThis workflow creates an intelligent AI chat agent that can query and retrieve data from your Airtable base using natural language. Simply ask questions about your contacts or companies, and the agent will search the appropriate tables and provide answers based on your data.\n\n### First Setup\n\n**Airtable Connection:**\n1. Create a Personal Access Token at [airtable.com/create/tokens](https://airtable.com/create/tokens)\n2. Add these scopes: `data.records:read`, `data.records:write`, and `schema.bases:read`\n3. Grant access to your bases and save the token\n4. Add the token to n8n as an Airtable credential\n\n**OpenAI Connection:**\nConnect your OpenAI API account credentials in the OpenAI Chat Model node.\n\n### Configuration\n\n**Airtable Tools:**\nReconfigure both Airtable tool nodes to point to your own Airtable base and tables:\n- Update the base URL to your Airtable base\n- Set the appropriate table for Contacts searches\n- Set the appropriate table for Companies searches\n\n**Chat Model:**\nThe workflow uses GPT-4.1-mini by default, but you can select a different OpenAI model in the settings if needed.\n\nOnce published, use the chat interface to ask questions about your data in plain English!"
      },
      "typeVersion": 1
    },
    {
      "id": "contact-note-1771263708644",
      "name": "Creator Contact Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -610
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 440,
        "content": "# Contact Us:\n## Milan @ SmoothWork - [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n![Milan](https://gravatar.com/avatar/95700d17ba300a9f14c1b8cacf933df7720027b3adda9cbe6183d89142925422?r=pg&d=retro&size=100)\n\n\n### We help businesses eliminate busywork by building compact business tools tailored to your process.\n### Contact us for customizing this, or building similar automations.\n\n\ud83d\udce7 hello@smoothwork.ai\n\u25b6\ufe0f [Check us on YouTube](https://www.youtube.com/@vasarmilan)\n\ud83d\udcde [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n\ud83d\udcbc [Add me on Linkedin](https://www.linkedin.com/in/mil%C3%A1n-v%C3%A1s%C3%A1rhelyi-3a9985123/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "video-note-1771324743907",
      "name": "Video Walkthrough",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -90,
        -610
      ],
      "parameters": {
        "width": 420,
        "height": 340,
        "content": "# Video Walkthrough\n[![image.png](https://vasarmilan-public.s3.us-east-1.amazonaws.com/blog_thumbnails/thumbnail_recidrbznaXlmqFUI.jpg)](https://youtu.be/lQh1fuIrBN8)"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Search Contacts": {
      "ai_tool": [
        [
          {
            "node": "CRM Assistant Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search Companies": {
      "ai_tool": [
        [
          {
            "node": "CRM Assistant Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "CRM Assistant Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "CRM Assistant Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "When User Asks Question": {
      "main": [
        [
          {
            "node": "CRM Assistant Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}