{
  "id": "cPpV55c1w997tleT",
  "name": "AI Location Scout Assistant",
  "tags": [],
  "nodes": [
    {
      "id": "819e5931-70f9-41cf-904d-051465896438",
      "name": "Chat Trigger",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -288,
        512
      ],
      "parameters": {
        "public": true,
        "options": {
          "loadPreviousSession": "memory"
        }
      },
      "typeVersion": 1.4
    },
    {
      "id": "1fe1d346-07e7-4a24-9324-65aa6e7cf1a8",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -288,
        768
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "db066d89-1ec6-4965-9778-c7d872151bc4",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        144,
        512
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "googleMapsApiKey",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Google Maps API Key__>"
            },
            {
              "id": "id-2",
              "name": "slackChannelId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack Channel ID__>"
            },
            {
              "id": "id-3",
              "name": "googleSheetId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Google Sheet ID__>"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "aedef6fe-1d42-48dc-acce-efdf2ffeb49b",
      "name": "Google Maps Places Search",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        544,
        512
      ],
      "parameters": {
        "url": "https://maps.googleapis.com/maps/api/place/textsearch/json",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $json.chatInput }}"
            },
            {
              "name": "key",
              "value": "={{ $('Workflow Configuration').first().json.googleMapsApiKey }}"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c3666e77-6f7a-4ba2-bce6-9183f068b947",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1600,
        512
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "3e70e3d7-9e99-4361-977b-465dd8384d6a",
      "name": "AI Location Analyzer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2256,
        576
      ],
      "parameters": {
        "text": "=\u5834\u6240\u540d: {{ $json.name }}\n\u4f4f\u6240: {{ $json.formatted_address }}\n\u30ab\u30c6\u30b4\u30ea: {{ $json.types }}\n\u8a55\u4fa1: {{ $json.rating }}",
        "options": {
          "systemMessage": "\u3042\u306a\u305f\u306f\u30d7\u30ed\u306e\u6620\u50cf\u76e3\u7763\u3067\u3059\u3002\u6e21\u3055\u308c\u305f\u5834\u6240\u60c5\u5831\u3092\u3082\u3068\u306b\u3001\u64ae\u5f71\u30b9\u30dd\u30c3\u30c8\u3068\u3057\u3066\u306e\u9b45\u529b\u309250\u6587\u5b57\u4ee5\u5185\u3067\u9b45\u529b\u7684\u306b\u7d39\u4ecb\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
        },
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "0113a3c7-3ed8-45f8-8396-20875f93a49a",
      "name": "Append to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2656,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "\u4f4f\u6240": "={{ $('Loop Over Items').item.json.formatted_address }}",
            "\u5834\u6240\u540d": "={{ $('Loop Over Items').item.json.name }}",
            "\u8a55\u4fa1(\u661f)": "={{ $('Loop Over Items').item.json.rating }}",
            "GoogleMap\u30ea\u30f3\u30af": "=https://www.google.com/maps/place/?q=place_id:{{ $('Loop Over Items').item.json.place_id }}",
            "AI\u76e3\u7763\u306e\u30b3\u30e1\u30f3\u30c8": "={{ $json.output }}"
          },
          "schema": [
            {
              "id": "\u5834\u6240\u540d",
              "required": false,
              "displayName": "\u5834\u6240\u540d",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u4f4f\u6240",
              "required": false,
              "displayName": "\u4f4f\u6240",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u8a55\u4fa1(\u661f)",
              "required": false,
              "displayName": "\u8a55\u4fa1(\u661f)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI\u76e3\u7763\u306e\u30b3\u30e1\u30f3\u30c8",
              "required": false,
              "displayName": "AI\u76e3\u7763\u306e\u30b3\u30e1\u30f3\u30c8",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "GoogleMap\u30ea\u30f3\u30af",
              "required": false,
              "displayName": "GoogleMap\u30ea\u30f3\u30af",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "\u5834\u6240\u540d"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "f32c93c7-9079-4f92-a1b0-aa6ac33dccde",
      "name": "Send Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        1952,
        432
      ],
      "parameters": {
        "text": "=\ud83c\udfac \u30ed\u30b1\u30cf\u30f3\u30ea\u30b9\u30c8\u4f5c\u6210\u5b8c\u4e86\uff01\n\n\u30ad\u30fc\u30ef\u30fc\u30c9: {{ $('Chat Trigger').first().json.chatInput }}\n\n\u30b7\u30fc\u30c8\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044: https://docs.google.com/spreadsheets/d/{{ $('Workflow Configuration').first().json.googleSheetId }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.slackChannelId }}"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.3
    },
    {
      "id": "a6801250-d2b3-43e9-b9ab-21c84e7fa369",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        1248,
        512
      ],
      "parameters": {
        "maxItems": 2
      },
      "typeVersion": 1
    },
    {
      "id": "fe7d6534-f05e-4bb8-a881-9b1152ac8487",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2256,
        832
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "04f042ad-8f04-47fe-ac8c-ddeda94a7b3c",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        896,
        512
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "results"
      },
      "typeVersion": 1
    },
    {
      "id": "5d15f757-b4a1-4248-a946-87dd29be6d5e",
      "name": "Main Sticky",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        320
      ],
      "parameters": {
        "width": 563,
        "height": 678,
        "content": "## \ud83c\udfac AI Location Scout Assistant\nThis workflow acts as your personal film location scout. It searches for locations via Google Maps, analyzes them using AI for cinematic potential, saves details to Google Sheets, and notifies you on Slack.\n\n### How it works\n1. **Chat Input:** Enter a keyword (e.g., \"Cyberpunk streets in Tokyo\").\n2. **Search:** Queries Google Places API.\n3. **AI Analysis:** An AI agent writes a \"Director's Commentary\" for each spot.\n4. **Save & Notify:** Saves to Sheets and alerts Slack.\n\n### Setup steps\n1. **Google Cloud:** Enable \"Places API (New)\" and get an API Key.\n2. **Google Sheets:** Create a sheet with headers: `\u5834\u6240\u540d`, `\u4f4f\u6240`, `\u8a55\u4fa1(\u661f)`, `AI\u76e3\u7763\u306e\u30b3\u30e1\u30f3\u30c8`, `GoogleMap\u30ea\u30f3\u30af`.\n3. **Config Node:** Update the `Workflow Configuration` node with your API Key, Sheet ID, and Slack Channel ID."
      },
      "typeVersion": 1
    },
    {
      "id": "f2face15-b514-48db-9e25-1bae6ac667f5",
      "name": "Config Group",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 768,
        "height": 676,
        "content": "## 1. Input & Configuration\nCaptures user chat commands and sets global variables (API Keys, IDs) to be used throughout the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "fe0210f1-b005-4d50-9878-d1dc9182ff66",
      "name": "Search Group",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 1044,
        "height": 684,
        "content": "## 2. Search & Data Prep\nQueries the Google Places API based on your keyword, splits the results, and limits the count to manage costs."
      },
      "typeVersion": 1
    },
    {
      "id": "3bd3d2ee-6ce6-43d6-a9b7-f8b421da6e8b",
      "name": "Process Group",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 1364,
        "height": 680,
        "content": "## 3. AI Analysis & Output\nLoops through each location. The AI Agent generates a creative description, saves data to Google Sheets, and sends a final notification to Slack."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "cc9a0949-fee8-4f84-b40d-d950e0c65a96",
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Chat Trigger",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Location Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Location Analyzer": {
      "main": [
        [
          {
            "node": "Append to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Location Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Google Maps Places Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append to Google Sheets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Maps Places Search": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}