Prompt: Design a workflow using @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmChatOpenAi to ai agent to chat with you search console data, using openai and postgres

Response:
# Workflow Architecture

**Purpose**: Database + Webhooks

**Key Components**:
- Total Nodes: 30
- Node Types: @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmChatOpenAi, n8n-nodes-base.executeWorkflowTrigger, n8n-nodes-base.switch, @n8n/n8n-nodes-langchain.toolWorkflow, @n8n/n8n-nodes-langchain.memoryPostgresChat, n8n-nodes-base.webhook, n8n-nodes-base.stickyNote, n8n-nodes-base.aggregate

**Logic Flow**:
1. **Trigger**: n8n-nodes-base.executeWorkflowTrigger - Initiates the workflow
4. **Actions**: @n8n/n8n-nodes-langchain.memoryPostgresChat

## Complete Workflow JSON

```json
{
  "id": "PoiRk5w0xd1ysq4U",
  "meta": {
    "instanceId": "b9faf72fe0d7c3be94b3ebff0778790b50b135c336412d28fd4fca2cbbf8d1f5",
    "templateCredsSetupCompleted": true
  },
  "name": "AI Agent to chat with you Search Console Data, using OpenAI and Postgres",
  "tags": [],
  "nodes": [
    {
      "id": "9ee6710b-19b7-4bfd-ac2d-0fe1e2561f1d",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        1796,
        220
      ],
      "parameters": {
        "tableName": "insights_chat_histories"
      },
      "credentials": {
        "postgres": {
          "id": "",
          "name": "Postgres"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "eb9f07e9-ded1-485c-9bf3-cf223458384a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1356,
        240
      ],
      "parameters": {
        "model": "gpt-4o",
        "options": {
          "maxTokens": 16000
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "",
          "name": "OpenAi"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1d3d6fb7-a171-4590-be42-df7eb0c208ed",
      "name": "Set fields",
      "type": "n8n-nodes-base.set",
      "position": [
        940,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9f47b322-e42f-42d7-93eb-a57d22adb849",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.body?.chatInput || $json.chatInput }}"
            },
            {
              "id": "73ec4dd0-e986-4f60-9dca-6aad2f86bdeb",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json.body?.sessionId || $json.sessionId }}"
            },
            {
              "id": "4b688c46-b60f-4f0a-83d8-e283f2d7055c",
              "name": "date_message",
              "type": "string",
              "value": "={{ $now.format('yyyy-MM-dd') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "92dc5e8b-5140-49be-8713-5749b7e2d46b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        407.32142857142867,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 347.9910714285712,
        "height": 516.8973214285712,
        "content": "## Webhook - ChatInput\n\nThis webhook serves as the endpoint for receiving `ChatInput` data. Ensure that you include:\n- `chatInput` – the content you wish to send (😉)\n- `sessionId` – a unique identifier for the session\n\nIf you're using an interface such as **Open WebUI**, the `sessionId` will be generated automatically."
      },
      "typeVersion": 1
    },
    {
      "id": "ca9f3732-9b62-4f44-b970-77d5d470ec76",
      "name": "Webhook - ChatInput",
      "type": "n8n-nodes-base.webhook",
      "position": [
        500,
        -20
      ],
      "webhookId": "a6820b65-76cf-402b-a934-0f836dee6ba0",
      "parameters": {
        "path": "a6820b65-76cf-402b-a934-0f836dee6ba0/chat",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode",
        "authentication": "basicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "",
          "name": "basic-auth"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "9d684873-6dfe-4709-928d-293b187dfb30",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 347.9910714285712,
        "height": 516.8973214285712,
        "content": "## Set fields\n\nThis node sets three fields:\n- `chatInput`: retrieved from the previous webhook node\n- `sessionId`: retrieved from the previous webhook node\n- `date_message`: formatted within this node. This will be used later to help the AI agent determine the date range for retrieving Search Console data."
      },
      "typeVersion": 1
    },
    {
      "id": "8750215a-1e33-4ac8-a6da-95efa8ffed65",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2600,
        -20
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "1b879496-5c0f-4bd5-b4cb-18df2662aef2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 1154.2857142857138,
        "height": 516.8973214285712,
        "content": "## AI Agent - Tools Agent\n\nThis AI Agent is configured with a system prompt that instructs it to:\n- On the first user message, **retrieve available Search Console properties** and offer the user the option to **fetch data from these properties**\n- Based on the user’s natural language input, **construct an API call** to the selected Search Console property and retrieve the requested data\n- Present the data in a **markdown-formatted table**\n\nThe AI Agent has a friendly tone and is designed to **confirm the user’s data requirements accurately** before executing any API requests.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c44c6402-9ddd-4a7b-bc5a-b6c3679a3f68",
      "name": "Call Search Console Tool",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        2196,
        220
      ],
      "parameters": {
        "name": "SearchConsoleRequestTool",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "PoiRk5w0xd1ysq4U",
          "cachedResultName": "My workflow 10"
        },
        "description": "Call this tool when you need to get the website_list or custom_insights",
        "jsonSchemaExample": ""
      },
      "typeVersion": 1.2
    },
    {
      "id": "b1701a89-c5b3-47fb-99d5-4896a6d5c7a2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1234,
        220
      ],
      "parameters": {
        "color": 6,
        "width": 328.9664285714292,
        "height": 468.13107142857154,
        "content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - OpenAI Chat Model\n\nThis sub-node utilizes the selected **OpenAI Chat Model**. You can replace it with any LLM that **supports tool calling**.\n\n### ⚠ Choose Your Model\nIn this template, the **default model is `gpt-4o`**, a **costly option**. If you'd like a more **affordable alternative**, select `gpt4-o-mini`, though note that responses may occasionally be of slightly lower quality compared to `gpt-4o`."
      },
      "typeVersion": 1
    },
    {
      "id": "cd1a7cec-5845-47b1-a2c8-d3b458a02eb0",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1656,
        220
      ],
      "parameters": {
        "color": 6,
        "width": 328.9664285714292,
        "height": 468.13107142857154,
        "content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - Postgres Chat Memory\n\nConnect your **Postgres credentials** and specify a **table name** to store the chat history. In this template, the default table name is `insights_chat_histories`, and the **context window length is set to 5**.\n\n**👋 Tip:** If you don’t have a Postgres database, you can quickly **set one up with [Supabase](https://supabase.com/)**.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "290a07d1-c7ed-434d-9851-2a2dcdd35bdf",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2076,
        220
      ],
      "parameters": {
        "color": 6,
        "width": 328.9664285714292,
        "height": 468.13107142857154,
        "content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - Call Search Console Tool\n\nThis **tool is used by the AI Agent** to:\n- Retrieve the **list of accessible properties in Search Console**\n- **Fetch Search Console data** based on the user’s natural language request\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "07805c90-7ba5-44d0-b6eb-5a65efb0f8be",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 347.9910714285712,
        "height": 516.8973214285712,
        "content": "## Respond to Webhook\n\nThis node is used to send a response back to the user.\n\n**👋 Tip:** `intermediateSteps` are configured, allowing you to use raw data fetched from Search Console to **create charts or other visualizations** if desired.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9a927a40-45e4-4fd5-ab3e-b77578469f82",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        800
      ],
      "parameters": {
        "color": 7,
        "width": 370.3910714285712,
        "height": 492.3973214285712,
        "content": "## Tool Call Trigger\n\nThis **node is triggered when the AI Agent needs to retrieve the `website_list`** (accessible Search Console properties) or **`custom_insights`** based on user data.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c54a4653-0f09-46b0-bd20-68919b96e154",
      "name": "Tool calling",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        500,
        1080
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "cc7303ee-1afa-4859-83e7-3af0e963a0f1",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1300,
        1080
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "custom_insights",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a30fe6a6-7d0a-4f14-8492-ae021ddc8ec6",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.request_type }}",
                    "rightValue": "custom_insights"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "website_list",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1b7d6039-6474-4a73-b157-584743a9d7f0",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{$json.request_type}}",
                    "rightValue": "website_list"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "6860ff98-4050-4f64-b8c1-a153e3388df0",
      "name": "Set fields - Consruct API CALL",
      "type": "n8n-nodes-base.set",
      "position": [
        920,
        1080
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "06373437-8288-4171-9f98-e8a417220dd4",
              "name": "request_type",
              "type": "string",
              "value": "={{ $json.query.parseJson().request_type }}"
            },
            {
              "id": "da45c0c5-05f6-4107-81aa-8c08c972d9bf",
              "name": "start_date",
              "type": "string",
              "value": "={{ $json.query.parseJson().startDate }}"
            },
            {
              "id": "59d55034-c612-43d7-9700-4cacdb630ec2",
              "name": "end_date",
              "type": "string",
              "value": "={{ $json.query.parseJson().endDate }}"
            },
            {
              "id": "4c2478c0-7f96-4d3d-a632-089307dc989e",
              "name": "dimensions",
              "type": "string",
              "value": "={{ $json.query.parseJson().dimensions }}"
            },
            {
              "id": "eceefbf9-44e5-4617-96ea-58aca2a29618",
              "name": "rowLimit",
              "type": "number",
              "value": "={{ $json.query.parseJson().rowLimit }}"
            },
            {
              "id": "4e18386e-8548-4385-b620-43efbb11cd63",
              "name": "startRow",
              "type": "number",
              "value": "={{ $json.query.parseJson().startRow}}"
            },
            {
              "id": "a9323a7b-08b4-4015-b3d7-632bcdf56f4e",
              "name": "property",
              "type": "string",
              "value": "={{ encodeURIComponent($json.query.parseJson().property) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0a2dfb28-17ee-477f-b9ea-f1d8e05e3745",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        800
      ],
      "parameters": {
        "color": 7,
        "width": 370.3910714285712,
        "height": 492.3973214285712,
        "content": "## Set Fields - Construct API Call\n\nThis node configures fields based on the JSON sent by the AI agent:\n- The `request_type` field determines the route: `website_list` (to retrieve the list of websites) or `custom_insights` (to get insights from Search Console)\n- Additional fields are set to construct the API call, following the **[Search Console API Documentation](https://developers.google.com/webmaster-tools/v1/searchanalytics/query?hl=en)**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e6ef5c28-01e4-4a0b-9081-b62ec28be635",
      "name": "Set fields - Create searchConsoleDataArray",
      "type": "n8n-nodes-base.set",
      "position": [
        2180,
        980
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2cffd36f-72bd-4535-8427-a88028ea0c4c",
              "name": "searchConsoleData",
              "type": "array",
              "value": "={{ $json.rows }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "abc80061-a794-4e1d-a055-bd88ea5c93eb",
      "name": "Set fields - Create searchConsoleDataArray 2",
      "type": "n8n-nodes-base.set",
      "position": [
        2180,
        1340
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2cffd36f-72bd-4535-8427-a88028ea0c4c",
              "name": "searchConsoleData",
              "type": "array",
              "value": "={{ $json.siteEntry }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "24981eea-980e-4e07-9036-d0042c5b2fbe",
      "name": "Search Console - Get Custom Insights",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1620,
        980
      ],
      "parameters": {
        "url": "=https://www.googleapis.com/webmasters/v3/sites/{{ $json.property }}/searchAnalytics/query",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n \"startDate\": \"{{ $json.start_date }}\",\n \"endDate\": \"{{ $json.end_date }}\",\n \"dimensions\": {{ $json.dimensions }},\n \"rowLimit\": {{ $json.rowLimit }},\n \"startRow\": 0,\n \"dataState\":\"all\"\n}",
        "sendBody": true,
        "sendQuery": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "oAuth2Api",
        "queryParameters": {
          "parameters": [
            {}
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "oAuth2Api": {
          "id": "",
          "name": "search-console"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "645ff407-857d-4629-926b-5cfc52cfa8ba",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        800
      ],
      "parameters": {
        "color": 7,
        "width": 370.3910714285712,
        "height": 364.3185243941325,
        "content": "## Search Console - Get Custom Insights\n\nThis node **performs the API call to retrieve data from Search Console**.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "15aa66e2-f288-4c86-8dad-47e22aa9104f",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        1180
      ],
      "parameters": {
        "color": 7,
        "width": 370.3910714285712,
        "height": 334.24982142857124,
        "content": "## Search Console - Get List of Properties\n\nThis node **performs the API call to retrieve the list of accessible properties from Search Console**.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cd804a52-833a-451a-8e0c-f640210ee2c4",
      "name": "## Search Console - Get List of Properties",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1620,
        1340
      ],
      "parameters": {
        "url": "=https://www.googleapis.com/webmasters/v3/sites",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "oAuth2Api",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "oAuth2Api": {
          "id": "",
          "name": "search-console"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3eac4df1-00ac-4262-b520-3a7e218c7e57",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2040,
        800
      ],
      "parameters": {
        "color": 7,
        "width": 370.3910714285712,
        "height": 725.1298214285712,
        "content": "## Set Fields - Create `searchConsoleDataArray`\n\nThese nodes **create an array based on the response from the Search Console API**.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "86db5800-a735-4749-a800-63d78908610b",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2520,
        800
      ],
      "parameters": {
        "color": 7,
        "width": 370.3910714285712,
        "height": 722.6464176100125,
        "content": "## Array Aggregation - Response to AI Agent\n\nThese nodes **aggregate the array from the previous** step and send it back to the AI Agent through the field named output as `response`.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "aefbacc7-8dfc-4655-bc4d-f0498c823711",
      "name": "Array aggregation - response to AI Agent",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2640,
        980
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "response"
      },
      "typeVersion": 1
    },
    {
      "id": "e5334c72-981c-4375-ae8e-9a3a0457880b",
      "name": "Array aggregation - response to AI Agent1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2660,
        1340
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "response"
      },
      "typeVersion": 1
    },
    {
      "id": "2e93a798-6c26-4d34-a553-ba01b64ca3fe",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -398.45627799387194,
        -320
      ],
      "parameters": {
        "width": 735.5589746610085,
        "height": 1615.4504601771982,
        "content": "# AI Agent to Chat with Your Search Console Data\n\nThis **AI Agent enables you to interact with your Search Console data** through a **chat interface**. Each node is **documented within the template**, providing sufficient information for setup and usage. You will also need to **configure Search Console OAuth credentials**.\n\nFollow this **[n8n documentation](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-generic/#configure-your-oauth-consent-screen)** to set up the OAuth credentials.\n\n## Important Notes\n\n### Correctly Configure Scopes for Search Console API Calls\n- It’s essential to **configure the scopes correctly** in your Google Search Console API OAuth2 credentials. Incorrect **configuration can cause issues with the refresh token**, requiring frequent reconnections. Below is the configuration I use to **avoid constant re-authentication**:\n![Search Console API oAuth2 config 1](https://i.imgur.com/vVLM7gG.png)\n![Search Console API oAuth2 config 2](https://i.imgur.com/naT1NaX.png)\n\nOf course, you'll need to add your **client_id** and **client_secret** from the **Google Cloud Platform app** you created to access your Search Console data.\n\n### Configure Authentication for the Webhook\n\nSince the **webhook will be publicly accessible**, don’t forget to **set up authentication**. I’ve used **Basic Auth**, but feel free to **choose the method that best meets your security requirements**.\n\n## 🤩💖 Example of awesome things you can do with this AI Agent\n![Example of chat with this AI Agent](https://i.imgur.com/jbfsYvT.png)\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fa630aa9-3c60-4b27-9477-aaeb79c7f37d",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1676,
        -20
      ],
      "parameters": {
        "text": "=user_message : {{ $json.chatInput }}\ndate_message : {{ $json.date_message }}",
        "options": {
          "systemMessage": "=Assist users by asking natural, conversational questions to understand their data needs and building a custom JSON API request to retrieve Search Console data. Handle assumptions internally, confirming them with the user in a friendly way. Avoid technical jargon and never imply that the user is directly building an API request.\n\nPre-Step: Retrieve the Website List\nImportant: Initial Action: Before sending your first message to the user, retrieve the list of connected Search Console properties.\n\nTool Call for Website List:\n\nTool name: SearchConsoleRequestTool\nRequest:\n{\n \"request_type\": \"website_list\" // Always include `request_type` in the API call.\n}\nUsage: Use this list to personalize your response in the initial interaction.\nStep-by-Step Guide\nStep 1: Initial Interaction and Introduction\nGreeting:\n\n\"Hi there! I’m here to help you gain valuable insights from your Search Console data. Whether you're interested in a specific time frame, performance breakdown by pages, queries, or other dimensions, I've got you covered.\n\nI can help you retrieve data for these websites:\n\nhttps://example1.com\nhttps://example2.com\nhttps://example3.com\nWhich of these properties would you like to analyze?\"\nStep 2: Handling User Response for Property Selection\nAction: When the user selects a property, use the property URL exactly as listed (e.g., \"https://example.com\") when constructing the API call.\n\nStep 3: Understanding the User's Needs\nAcknowledgment and Setting Defaults:\n\nIf the user expresses a general need (e.g., \"I want the last 3 months of page performance\"), acknowledge their request and set reasonable defaults.\n\nExample Response:\n\n\"Great! I'll gather the top 300 queries from the last 3 months for https://example.com. If you'd like more details or adjustments, just let me know.\"\n\nFollow-up Questions:\n\nConfirming Dimensions: If the user doesn’t specify dimensions, ask:\n\n\"For this analysis, I’ll look at page performance. Does that sound good, or would you like to include other details like queries, devices, or other dimensions?\"\n\nNumber of Results: If the user hasn’t specified the number of results, confirm:\n\n\"I can show you the top 100 results. Let me know if you'd like more or fewer!\"\n\nStep 4: Gathering Specific Inputs (If Necessary)\nAction: If the user provides specific needs, capture and confirm them naturally.\n\nExample Response:\n\n\"Perfect, I’ll pull the data for [specified date range], focusing on [specified dimensions]. Anything else you’d like me to include?\"\n\nImplicit Defaults:\n\nDate Range: Assume \"last 3 months\" if not specified.\nRow Limit: Default to 100, adjustable based on user input.\nStep 5: Confirming Input with the User\nAction: Summarize the request to ensure accuracy.\n\nExample Response:\n\n\"Here’s what I’m preparing: data for https://example.com, covering the last 3 months, focusing on the top 100 queries. Let me know if you’d like to adjust anything!\"\n\nStep 6: Constructing the JSON for Custom Insights\nAction: Build the API call based on the conversation.\n\n{\n \"property\": \"<USER_PROVIDED_PROPERTY_URL>\", // Use the exact property URL.\n \"request_type\": \"custom_insights\",\n \"startDate\": \"<ASSUMED_OR_USER_SPECIFIED_START_DATE>\",\n \"endDate\": \"<ASSUMED_OR_USER_SPECIFIED_END_DATE>\",\n \"dimensions\": [\"<IMPLIED_OR_USER_SPECIFIED_DIMENSIONS>\"], // Array of one or more: \"page\", \"query\", \"searchAppearance\", \"device\", \"country\"\n \"rowLimit\": 300 // Default or user-specified limit.\n}\nStep 7: Presenting the Data\nWhen Retrieving Custom Insights:\n\nImportant: Display all retrieved data in an easy-to-read markdown table format.\nStep 8: Error Handling\nAction: Provide clear, user-friendly error messages when necessary.\n\nExample Response:\n\n\"Hmm, there seems to be an issue retrieving the data. Let’s review what we have or try a different approach.\"\n\nAdditional Notes\nProactive Assistance: Offer suggestions based on user interactions, such as adding dimensions or refining details.\nTone: Maintain a friendly and helpful demeanor throughout the conversation.",
          "returnIntermediateSteps": true
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "abda3766-7d18-46fb-83e7-c2343ff26385",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Search Console - Get Custom Insights",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "## Search Console - Get List of Properties",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tool calling": {
      "main": [
        [
          {
            "node": "Set fields - Consruct API CALL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - ChatInput": {
      "main": [
        [
          {
            "node": "Set fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Call Search Console Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Set fields - Consruct API CALL": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Console - Get Custom Insights": {
      "main": [
        [
          {
            "node": "Set fields - Create searchConsoleDataArray",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "## Search Console - Get List of Properties": {
      "main": [
        [
          {
            "node": "Set fields - Create searchConsoleDataArray 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields - Create searchConsoleDataArray": {
      "main": [
        [
          {
            "node": "Array aggregation - response to AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields - Create searchConsoleDataArray 2": {
      "main": [
        [
          {
            "node": "Array aggregation - response to AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```

AI Agent to chat with you Search Console Data, using OpenAI and Postgres


Prompt: How would you build: Ai Agent With Ollama For Current Weather And Wiki?

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 10
- Node Types: @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.memoryBufferWindow, @n8n/n8n-nodes-langchain.manualChatTrigger, @n8n/n8n-nodes-langchain.toolWikipedia, n8n-nodes-base.stickyNote, @n8n/n8n-nodes-langchain.toolHttpRequest, @n8n/n8n-nodes-langchain.lmChatOllama

**Logic Flow**:
1. **Trigger**: @n8n/n8n-nodes-langchain.manualChatTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "meta": {
    "instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a",
    "templateId": "2931",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "100f23d3-cbe9-458a-9ef1-7cc5fcba8f3c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        540
      ],
      "parameters": {
        "width": 300,
        "height": 205,
        "content": "### The conversation history(last 20 messages) is stored in a buffer memory"
      },
      "typeVersion": 1
    },
    {
      "id": "b48f989f-deb9-479c-b163-03f098d00c9c",
      "name": "On new manual Chat Message",
      "type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
      "position": [
        380,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "add8e8df-6b2a-4cbd-84e7-3b006733ef7d",
      "name": "Wikipedia",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        1180,
        640
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a97454a8-001d-4986-9cb5-83176229ea70",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        540
      ],
      "parameters": {
        "width": 300,
        "height": 205,
        "content": "### Tools which agent can use to accomplish the task"
      },
      "typeVersion": 1
    },
    {
      "id": "52b57e72-8cc9-4865-9a00-d03b2e7f1b92",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        160
      ],
      "parameters": {
        "width": 422,
        "height": 211,
        "content": "### Conversational agent will utilise available tools to answer the prompt. "
      },
      "typeVersion": 1
    },
    {
      "id": "8f0653ab-376b-40b9-b876-e608defdeb89",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        740,
        600
      ],
      "parameters": {
        "contextWindowLength": 20
      },
      "typeVersion": 1
    },
    {
      "id": "13237945-e143-4f65-b034-785f5ebde5bb",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        680,
        240
      ],
      "parameters": {
        "text": "={{ $json.input }}",
        "options": {
          "systemMessage": "=You are a helpful assistant, with weather tool and wiki tool. find out the latitude and longitude information of a location then use the weather tool for current weather and weather forecast. For general info, use the wiki tool."
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "ee06c0f4-b2de-4257-9735-3ec228f2b794",
      "name": "Weather HTTP Request",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        1020,
        620
      ],
      "parameters": {
        "url": "https://api.open-meteo.com/v1/forecast",
        "sendQuery": true,
        "parametersQuery": {
          "values": [
            {
              "name": "latitude"
            },
            {
              "name": "longitude"
            },
            {
              "name": "forecast_days",
              "value": "1",
              "valueProvider": "fieldValue"
            },
            {
              "name": "hourly",
              "value": "temperature_2m",
              "valueProvider": "fieldValue"
            }
          ]
        },
        "toolDescription": "Fetch current temperature for given coordinates."
      },
      "notesInFlow": true,
      "typeVersion": 1.1
    },
    {
      "id": "3e5608c8-281d-47e0-af9d-77707530fd6b",
      "name": "Ollama Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        520,
        620
      ],
      "parameters": {
        "model": "llama3.2:latest",
        "options": {}
      },
      "credentials": {
        "ollamaApi": {
          "id": "xHuYe0MDGOs9IpBW",
          "name": "Local Ollama service"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b3d794f4-37b5-46c8-9d7d-ad1087006ce5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        140
      ],
      "parameters": {
        "color": 4,
        "height": 240,
        "content": "### In System Message, add the following.\n\n\"You are a helpful assistant, with weather tool and wiki tool. find out the latitude and longitude information of a location then use the weather tool for current weather and weather forecast. For general info, use the wiki tool.\""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Wikipedia": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Weather HTTP Request": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "On new manual Chat Message": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```

AI Agent with Ollama for current weather and wiki


Prompt: How would you build: Hr Focused Automation Pipeline With Ai?

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 18
- Node Types: n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmChatOpenAi, @n8n/n8n-nodes-langchain.chainSummarization, n8n-nodes-base.extractFromFile, n8n-nodes-base.stickyNote, @n8n/n8n-nodes-langchain.outputParserStructured, @n8n/n8n-nodes-langchain.chainLlm, n8n-nodes-base.formTrigger, @n8n/n8n-nodes-langchain.informationExtractor, n8n-nodes-base.googleDrive

**Logic Flow**:
1. **Trigger**: n8n-nodes-base.formTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "id": "t1P14FvfibKYCh3E",
  "meta": {
    "instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
    "templateCredsSetupCompleted": true
  },
  "name": "HR-focused automation pipeline with AI",
  "tags": [],
  "nodes": [
    {
      "id": "b1092f93-502c-4af0-962e-2b69311b92a3",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -520,
        -200
      ],
      "webhookId": "2a87705d-8ba1-41f1-80ef-85f364ce253e",
      "parameters": {
        "options": {},
        "formTitle": "Send CV",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name",
              "placeholder": "Name",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email",
              "placeholder": "Email",
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "CV",
              "requiredField": true,
              "acceptFileTypes": ".pdf"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "77edfe2a-4c6a-48c8-8dc9-b275491be090",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -160,
        -200
      ],
      "parameters": {
        "options": {},
        "operation": "pdf",
        "binaryPropertyName": "CV"
      },
      "typeVersion": 1
    },
    {
      "id": "ebf2e194-3515-4c0a-8745-790b63bf336f",
      "name": "Qualifications",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        160,
        -100
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
        },
        "attributes": {
          "attributes": [
            {
              "name": "Educational qualification",
              "required": true,
              "description": "Summary of your academic career. Focus on your high school and university studies. Summarize in 100 words maximum and also include your grade if applicable."
            },
            {
              "name": "Job History",
              "required": true,
              "description": "Work history summary. Focus on your most recent work experiences. Summarize in 100 words maximum"
            },
            {
              "name": "Skills",
              "required": true,
              "description": "Extract the candidate’s technical skills. What software and frameworks they are proficient in. Make a bulleted list."
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4f40404c-1d47-4bde-9b4b-16367cf11e4f",
      "name": "Summarization Chain",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        900,
        -220
      ],
      "parameters": {
        "options": {
          "summarizationMethodAndPrompts": {
            "values": {
              "prompt": "=Write a concise summary of the following:\n\nCity: {{ $json.output.city }}\nBirthdate: {{ $json.output.birthdate }}\nEducational qualification: {{ $json.output[\"Educational qualification\"] }}\nJob History: {{ $json.output[\"Job History\"] }}\nSkills: {{ $json.output.Skills }}\n\nUse 100 words or less. Be concise and conversational.",
              "combineMapPrompt": "=Write a concise summary of the following:\n\nCity: {{ $json.output.city }}\nBirthdate: {{ $json.output.birthdate }}\nEducational qualification: {{ $json.output[\"Educational qualification\"] }}\nJob History: {{ $json.output[\"Job History\"] }}\nSkills: {{ $json.output.Skills }}\n\nUse 100 words or less. Be concise and conversational."
            }
          }
        }
      },
      "typeVersion": 2
    },
    {
      "id": "9f9c5f16-1dc2-4928-aef8-284daeb6be51",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        660,
        -220
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3
    },
    {
      "id": "51bd14cc-2c54-4f72-b162-255f7e277aff",
      "name": "Profile Wanted",
      "type": "n8n-nodes-base.set",
      "position": [
        1300,
        -220
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a3d049b0-5a70-4e7b-a6f2-81447da5282a",
              "name": "profile_wanted",
              "type": "string",
              "value": "We are a web agency and we are looking for a full-stack web developer who knows how to use PHP, Python and Javascript. He has experience in the sector and lives in Northern Italy."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4a120e5d-b849-4a29-b7f3-12c653552367",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1960,
        -220
      ],
      "parameters": {
        "columns": {
          "value": {
            "CITY": "={{ $('Merge').item.json.output.city }}",
            "DATA": "={{ $now.format('dd/LL/yyyy') }}",
            "NAME": "={{ $('On form submission').item.json.Nome }}",
            "VOTE": "={{ $json.output.vote }}",
            "EMAIL": "={{ $('On form submission').item.json.Email }}",
            "SKILLS": "={{ $('Merge').item.json.output.Skills }}",
            "TELEFONO": "={{ $('Merge').item.json.output.telephone }}",
            "SUMMARIZE": "={{ $('Summarization Chain').item.json.response.text }}",
            "EDUCATIONAL": "={{ $('Merge').item.json.output[\"Educational qualification\"] }}",
            "JOB HISTORY": "={{ $('Merge').item.json.output[\"Job History\"] }}",
            "DATA NASCITA": "={{ $('Merge').item.json.output.birthdate }}",
            "CONSIDERATION": "={{ $json.output.consideration }}"
          },
          "schema": [
            {
              "id": "DATA",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DATA",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "NAME",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "NAME",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "PHONE",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "PHONE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CITY",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "CITY",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "EMAIL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "EMAIL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DATA NASCITA",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DATA NASCITA",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "EDUCATIONAL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "EDUCATIONAL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "JOB HISTORY",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "JOB HISTORY",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SKILLS",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SKILLS",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SUMMARIZE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SUMMARIZE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "VOTE",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "VOTE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CONSIDERATION",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "CONSIDERATION",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE/edit?usp=drivesdk",
          "cachedResultName": "Ricerca WebDev"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "JYR6a64Qecd6t8Hb",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "a154d8a5-9f85-45bb-b082-f702c13c3507",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1720,
        -20
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"vote\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"consideration\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "037ac851-7885-4b78-ac75-dfa0ebb6003d",
      "name": "HR Expert",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1560,
        -220
      ],
      "parameters": {
        "text": "=Profilo ricercato:\n{{ $json.profile_wanted }}\n\nCandidato:\n{{ $('Summarization Chain').item.json.response.text }}",
        "messages": {
          "messageValues": [
            {
              "message": "Sei un esperto HR e devi capire se il candidato è in linea con il profilo ricercato dall'azienda.\n\nDevi dare un voto da 1 a 10 dove 1 significa che il candidato non è in linea con quanto richiesto mentre 10 significa che è il candidato ideale perchè rispecchia in toto il profilo cercato.\n\nInoltre nel campo \"consideration\" motiva il perchè hai dato quel voto. "
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "ed5744c4-df06-4a01-a103-af4dd470d482",
      "name": "Personal Data",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        160,
        -280
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
        },
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"telephone\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"city\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"birthdate\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1
    },
    {
      "id": "181c1249-b05c-4c35-8cac-5f9738cc1fe6",
      "name": "Upload CV",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -160,
        -380
      ],
      "parameters": {
        "name": "=CV-{{ $now.format('yyyyLLdd') }}-{{ $json.CV[0].filename }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1tzeSpx4D3EAGXa3Wg-gqGbdaUk6LIZTV",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1tzeSpx4D3EAGXa3Wg-gqGbdaUk6LIZTV",
          "cachedResultName": "CV"
        },
        "inputDataFieldName": "CV"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "HEy5EuZkgPZVEa9w",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d31ee1c4-e4be-41d9-8f36-e6fb797ced8e",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        920,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "CDX6QM4gLYanh0P4",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0290cb72-a581-4aff-8b5d-1aa63e0a630f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -680
      ],
      "parameters": {
        "color": 3,
        "width": 540,
        "content": "## HR Expert \nThis workflow automates the process of handling job applications by extracting relevant information from submitted CVs, analyzing the candidate's qualifications against a predefined profile, and storing the results in a Google Sheet"
      },
      "typeVersion": 1
    },
    {
      "id": "361084ff-9735-4a56-8988-be573391838b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -460
      ],
      "parameters": {
        "width": 300,
        "height": 420,
        "content": "The CV is uploaded to Google Drive and converted so that it can be processed\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4b6f004f-c77b-4522-99d4-737a68f6cfac",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        -380
      ],
      "parameters": {
        "width": 360,
        "height": 440,
        "content": "The essential information for evaluating the candidate is collected in two different chains"
      },
      "typeVersion": 1
    },
    {
      "id": "73e11af9-65e3-4fcd-bb99-8a3f212ce9fb",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        -300
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "Summary of relevant information useful for classifying the candidate"
      },
      "typeVersion": 1
    },
    {
      "id": "606711d1-8e6d-44b3-91ac-c047d8a4054f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        -300
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "Characteristics of the profile sought by the company that intends to hire the candidate"
      },
      "typeVersion": 1
    },
    {
      "id": "89c3210c-c599-41dc-97a3-bf8df2beb751",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        -300
      ],
      "parameters": {
        "width": 360,
        "height": 240,
        "content": "Candidate evaluation with vote and considerations of the HR agent relating the profile sought with the candidate's skills"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "594728c0-b842-404d-8810-c6f7f3f4631d",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Summarization Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "ai_languageModel": [
        [
          {
            "node": "Qualifications",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Summarization Chain",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "HR Expert",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Personal Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "HR Expert": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload CV": {
      "main": [
        []
      ]
    },
    "Personal Data": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Profile Wanted": {
      "main": [
        [
          {
            "node": "HR Expert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qualifications": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Qualifications",
            "type": "main",
            "index": 0
          },
          {
            "node": "Personal Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload CV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarization Chain": {
      "main": [
        [
          {
            "node": "Profile Wanted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "HR Expert",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
```


Prompt: Create an n8n automation that handles data processing + webhooks

Response:
# Workflow Architecture

**Purpose**: Data Processing + Webhooks

**Key Components**:
- Total Nodes: 17
- Node Types: @n8n/n8n-nodes-langchain.vectorStoreQdrant, @n8n/n8n-nodes-langchain.lmChatOpenAi, @n8n/n8n-nodes-langchain.chainRetrievalQa, @n8n/n8n-nodes-langchain.manualChatTrigger, @n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter, @n8n/n8n-nodes-langchain.embeddingsOpenAi, n8n-nodes-base.webhook, n8n-nodes-base.stickyNote, n8n-nodes-base.manualTrigger, @n8n/n8n-nodes-langchain.retrieverVectorStore

**Logic Flow**:
1. **Trigger**: @n8n/n8n-nodes-langchain.manualChatTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "id": "tMiRJYDrXzpKysTX",
  "meta": {
    "instanceId": "2723a3a635131edfcb16103f3d4dbaadf3658e386b4762989cbf49528dccbdbd",
    "templateId": "1960"
  },
  "name": "Stock Q&A Workflow",
  "tags": [],
  "nodes": [
    {
      "id": "ec3b86be-4113-4fd5-8365-02adb67693e9",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1960,
        720
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "fOF5kro9BJ6KMQ7n",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "42fd8020-3861-4d0f-a7a2-70e2c35f0bed",
      "name": "On new manual Chat Message",
      "type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
      "disabled": true,
      "position": [
        1620,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a9b48d04-691e-4537-90f8-d7a4aa6153af",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1560,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 903.0896125323785,
        "height": 733.5099670584011,
        "content": "## Step 2: Setup the Q&A \n### The incoming message from the webhook is queried from the Supabase Vector Store. The response is provided in the response webhook. "
      },
      "typeVersion": 1
    },
    {
      "id": "472b4800-745a-4337-9545-163247f7e9ae",
      "name": "Retrieval QA Chain",
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "position": [
        1880,
        240
      ],
      "parameters": {
        "query": "={{ $json.body.input }}"
      },
      "typeVersion": 1
    },
    {
      "id": "e58bd82d-abc6-44ed-8e93-ec5436126d66",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2280,
        240
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "={{ $json.response.text }}"
      },
      "typeVersion": 1
    },
    {
      "id": "04bbf01e-8269-47c7-897d-4ea94a1bd1c0",
      "name": "Vector Store Retriever",
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "position": [
        2020,
        440
      ],
      "parameters": {
        "topK": 5
      },
      "typeVersion": 1
    },
    {
      "id": "feee6d68-2e0d-4d40-897e-c1d833a13bf2",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1620,
        420
      ],
      "webhookId": "679f4afb-189e-4f04-9dc0-439eec2ec5f1",
      "parameters": {
        "path": "19f5499a-3083-4783-93a0-e8ed76a9f742",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1b8d251f-7069-4d7d-b6d6-4bfa683d4ad1",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        280,
        260
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b746a7a4-ed94-4332-bf7b-65aadcf54130",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        580,
        260
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "list",
          "value": "1LZezppYrWpMStr4qJXtoIX-Dwzvgehll",
          "cachedResultUrl": "https://drive.google.com/file/d/1LZezppYrWpMStr4qJXtoIX-Dwzvgehll/view?usp=drivesdk",
          "cachedResultName": "crowdstrike.pdf"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "1tsDIpjUaKbXy0be",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "83a7d470-f934-436d-ba3f-1ae7c776f5a5",
      "name": "Binary to Document",
      "type": "@n8n/n8n-nodes-langchain.documentBinaryInputLoader",
      "position": [
        860,
        480
      ],
      "parameters": {
        "loader": "pdfLoader",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "b52b4a90-99a1-49cc-a6f0-7551d6754496",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        860,
        640
      ],
      "parameters": {
        "options": {},
        "chunkSize": 3000,
        "chunkOverlap": 200
      },
      "typeVersion": 1
    },
    {
      "id": "b525e130-2029-4f55-a603-1fdc05a19c17",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1160,
        480
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "fOF5kro9BJ6KMQ7n",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5358c53f-55f9-431d-8956-c6bae7ad25bc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 772.0680602743597,
        "height": 732.3675002130781,
        "content": "## Step 1: Upserting the PDF\n### Fetch file from Google Drive, split it into chunks and insert into Supabase index\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fb91e2da-0eeb-47a5-aa49-65bf56986857",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        940,
        260
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "qdrantCollection": {
          "__rl": true,
          "mode": "id",
          "value": "=crowd"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "U5CpjAgFeXziP3I1",
          "name": "QdrantApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "89e14837-d1fc-4b1e-9ebc-7cf3e7fd9a70",
      "name": "Qdrant Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        1980,
        600
      ],
      "parameters": {
        "qdrantCollection": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.body.company }}"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "U5CpjAgFeXziP3I1",
          "name": "QdrantApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c619245b-5ea0-4354-974d-21ec6b8efa93",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1880,
        460
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "fOF5kro9BJ6KMQ7n",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e4aa780d-8069-4308-a61f-82ed876af71a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 710.9124489067698,
        "height": 726.4452519516944,
        "content": "## Start here: Step-by Step Youtube Tutorial :star:\n\n[![Building an AI Crew to Analyze Financial Data with CrewAI and n8n](https://img.youtube.com/vi/pMvizUx5n1g/sddefault.jpg)](https://www.youtube.com/watch?v=pMvizUx5n1g)\n"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {},
  "versionId": "463aec94-26a6-436d-8732-fc01d637c6ae",
  "connections": {
    "Webhook1": {
      "main": [
        [
          {
            "node": "Retrieval QA Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Retrieval QA Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Binary to Document": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Retrieval QA Chain": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store1": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Retriever",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Retriever": {
      "ai_retriever": [
        [
          {
            "node": "Retrieval QA Chain",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "On new manual Chat Message": {
      "main": [
        [
          {
            "node": "Retrieval QA Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Binary to Document",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
```


Prompt: Build a workflow for: Ai Customer Feedback Sentiment Analysis

Response:
# Workflow Architecture

**Purpose**: General Automation

**Key Components**:
- Total Nodes: 9
- Node Types: n8n-nodes-base.merge, n8n-nodes-base.stickyNote, n8n-nodes-base.formTrigger, n8n-nodes-base.googleSheets, n8n-nodes-base.openAi

**Logic Flow**:
1. **Trigger**: n8n-nodes-base.formTrigger - Initiates the workflow

## Complete Workflow JSON

```json
{
  "meta": {
    "instanceId": "82a17fa4a0b8e81bf77e5ab999d980f392150f2a9541fde626dc5f74857b1f54"
  },
  "nodes": [
    {
      "id": "4ea39a4f-d8c1-438f-9738-bfbb906a3d7a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        1020
      ],
      "parameters": {
        "width": 253,
        "height": 342,
        "content": "## Send customer feedback to OpenAI for sentiment analysis"
      },
      "typeVersion": 1
    },
    {
      "id": "6962ea41-7d15-4932-919f-21ac94fa1269",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1960,
        1180
      ],
      "parameters": {
        "width": 253,
        "height": 342,
        "content": "## Add new feedback to google sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "4c8a8984-2d8e-4139-866b-6f3536aced07",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        1600
      ],
      "parameters": {
        "width": 1407,
        "height": 254,
        "content": "## Instructions\n1. Connect Google sheets\n2. Connect your OpenAi account (api key + org Id)\n3. Create a customer feedback form, use an existing one or use the one below as example. \nAll set!\n\n\n- Here is the example google sheet being used in this workflow: https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit?usp=sharing. You can download it to your account."
      },
      "typeVersion": 1
    },
    {
      "id": "d43a9574-626d-4817-87ba-d99bdd6f41dc",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        1160
      ],
      "parameters": {
        "width": 253,
        "height": 342,
        "content": "## Feedback form is submitted"
      },
      "typeVersion": 1
    },
    {
      "id": "76dab2dc-935f-416e-91aa-5a1b7017ec1b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        1180
      ],
      "parameters": {
        "width": 253,
        "height": 342,
        "content": "## Merge form data and OpenAI result"
      },
      "typeVersion": 1
    },
    {
      "id": "9772eac1-8df2-4305-9b2c-265d3c5a9a4a",
      "name": "Add customer feedback to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2020,
        1320
      ],
      "parameters": {
        "columns": {
          "value": {
            "Category": "={{ $json['What is your feedback about?'] }}",
            "Sentiment": "={{ $json.text }}",
            "Timestamp": "={{ $json.submittedAt }}",
            "Entered by": "=Form",
            "Customer Name": "={{ $json.Name }}",
            "Customer contact": "={{ $json['How do we get in touch with you?'] }}",
            "Customer Feedback": "={{ $json['Your feedback'] }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Feedback",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer Feedback",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer contact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer contact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Entered by",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Entered by",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Urgent?",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Urgent?",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit?usp=drivesdk",
          "cachedResultName": "CustomerFeedback"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "3",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "12084971-c81b-4a0e-814e-120867562642",
      "name": "Merge sentiment with form content",
      "type": "n8n-nodes-base.merge",
      "position": [
        1680,
        1320
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combinationMode": "multiplex"
      },
      "typeVersion": 2.1
    },
    {
      "id": "235edf5b-7724-4712-8dc5-d8327a0620b8",
      "name": "Classify feedback with OpenAI",
      "type": "n8n-nodes-base.openAi",
      "position": [
        1280,
        1180
      ],
      "parameters": {
        "prompt": "=Classify the sentiment in the following customer feedback: {{ $json['Your feedback'] }}",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "s2iucY0IctjYNbrb",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "af4b22aa-0925-40b1-a9ac-298f9745a98e",
      "name": "Submit form with customer feedback",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        860,
        1340
      ],
      "webhookId": "e7bf682e-48e8-40de-9815-cd180cdd1480",
      "parameters": {
        "options": {
          "formSubmittedText": "Your response has been recorded"
        },
        "formTitle": "Customer Feedback",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "What is your feedback about?",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Product"
                  },
                  {
                    "option": "Service"
                  },
                  {
                    "option": "Other"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Your feedback",
              "requiredField": true
            },
            {
              "fieldLabel": "How do we get in touch with you?"
            }
          ]
        },
        "formDescription": "Please give feedback about our company orproducts."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Classify feedback with OpenAI": {
      "main": [
        [
          {
            "node": "Merge sentiment with form content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge sentiment with form content": {
      "main": [
        [
          {
            "node": "Add customer feedback to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submit form with customer feedback": {
      "main": [
        [
          {
            "node": "Classify feedback with OpenAI",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge sentiment with form content",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}
```