AutomationFlowsAI & RAG › Lineoa

Lineoa

LineOA. Uses httpRequest, agent, lmChatGoogleGemini, outputParserStructured. Webhook trigger; 69 nodes.

Webhook trigger★★★★★ complexityAI-powered69 nodesHTTP RequestAgentGoogle Gemini ChatOutput Parser StructuredPostgresGoogle Sheets
AI & RAG Trigger: Webhook Nodes: 69 Complexity: ★★★★★ AI nodes: yes Added:
Lineoa — n8n workflow card showing HTTP Request, Agent, Google Gemini Chat integration

This workflow follows the Agent → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "LineOA",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "request",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -2832,
        1712
      ],
      "id": "2a282af4-c352-41e0-81e0-c16f8034bc77",
      "name": "Webhook"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"{{ $json.output.replaceAll('\\t',' ').replaceAll('\\\"','\\\\\\\"').replaceAll('\\n','\\\\n').trim() || 'An error occurred, please try again.' }}\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        336,
        1632
      ],
      "id": "c206c062-ebbb-47df-b861-fbe43cb7ede1",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('message').item.json.message }}",
        "options": {
          "systemMessage": "=\u0e04\u0e38\u0e13\u0e04\u0e37\u0e2d SME FoodMate AI \u0e1c\u0e39\u0e49\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e41\u0e25\u0e30\u0e1c\u0e39\u0e49\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e40\u0e08\u0e49\u0e32\u0e02\u0e2d\u0e07\u0e18\u0e38\u0e23\u0e01\u0e34\u0e08\u0e23\u0e49\u0e32\u0e19\u0e2d\u0e32\u0e2b\u0e32\u0e23\u0e41\u0e25\u0e30\u0e04\u0e32\u0e40\u0e1f\u0e48 (SME) \u0e43\u0e19\u0e44\u0e17\u0e22\n\n\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22\u0e2b\u0e25\u0e31\u0e01\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e04\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e17\u0e35\u0e48\u0e19\u0e33\u0e44\u0e1b\u0e43\u0e0a\u0e49\u0e44\u0e14\u0e49\u0e08\u0e23\u0e34\u0e07\u0e41\u0e25\u0e30\u0e40\u0e02\u0e49\u0e32\u0e43\u0e08\u0e07\u0e48\u0e32\u0e22 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e0a\u0e48\u0e27\u0e22\u0e43\u0e2b\u0e49\u0e1e\u0e27\u0e01\u0e40\u0e02\u0e32 \u0e25\u0e14\u0e15\u0e49\u0e19\u0e17\u0e38\u0e19, \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e22\u0e2d\u0e14\u0e02\u0e32\u0e22, \u0e41\u0e25\u0e30\u0e1a\u0e23\u0e34\u0e2b\u0e32\u0e23\u0e18\u0e38\u0e23\u0e01\u0e34\u0e08 \u0e44\u0e14\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e21\u0e35\u0e1b\u0e23\u0e30\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e20\u0e32\u0e1e\n\n\u0e02\u0e2d\u0e1a\u0e40\u0e02\u0e15\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\n\u0e04\u0e38\u0e13\u0e08\u0e30\u0e15\u0e2d\u0e1a\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e04\u0e33\u0e16\u0e32\u0e21\u0e17\u0e35\u0e48\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a 4 \u0e14\u0e49\u0e32\u0e19\u0e19\u0e35\u0e49\u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19:\n\n\ud83d\udca1 \u0e01\u0e32\u0e23\u0e15\u0e25\u0e32\u0e14: \u0e01\u0e25\u0e22\u0e38\u0e17\u0e18\u0e4c\u0e42\u0e0b\u0e40\u0e0a\u0e35\u0e22\u0e25\u0e21\u0e35\u0e40\u0e14\u0e35\u0e22\u0e15\u0e49\u0e19\u0e17\u0e38\u0e19\u0e15\u0e48\u0e33, \u0e42\u0e1b\u0e23\u0e42\u0e21\u0e0a\u0e31\u0e19, \u0e01\u0e32\u0e23\u0e23\u0e31\u0e01\u0e29\u0e32\u0e25\u0e39\u0e01\u0e04\u0e49\u0e32, \u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e41\u0e1a\u0e1a\u0e40\u0e21\u0e19\u0e39\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e01\u0e32\u0e23\u0e02\u0e32\u0e22\n\ud83d\udcb0 \u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e15\u0e49\u0e19\u0e17\u0e38\u0e19: \u0e01\u0e32\u0e23\u0e2b\u0e32\u0e41\u0e2b\u0e25\u0e48\u0e07\u0e27\u0e31\u0e15\u0e16\u0e38\u0e14\u0e34\u0e1a, \u0e01\u0e32\u0e23\u0e25\u0e14\u0e02\u0e22\u0e30, \u0e01\u0e32\u0e23\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21\u0e2a\u0e15\u0e47\u0e2d\u0e01, \u0e01\u0e32\u0e23\u0e04\u0e33\u0e19\u0e27\u0e13\u0e15\u0e49\u0e19\u0e17\u0e38\u0e19\u0e2d\u0e32\u0e2b\u0e32\u0e23\n\ud83d\udcc8 \u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e07\u0e32\u0e19: \u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e15\u0e47\u0e2d\u0e01 (\u0e40\u0e0a\u0e48\u0e19 FIFO), \u0e01\u0e32\u0e23\u0e2b\u0e32\u0e0b\u0e31\u0e1e\u0e1e\u0e25\u0e32\u0e22\u0e40\u0e2d\u0e2d\u0e23\u0e4c\u0e43\u0e19\u0e1e\u0e37\u0e49\u0e19\u0e17\u0e35\u0e48, \u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1b\u0e23\u0e30\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e20\u0e32\u0e1e\u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e2a\u0e48\u0e07\n\ud83d\uded2 \u0e01\u0e32\u0e23\u0e40\u0e07\u0e34\u0e19\u0e40\u0e1a\u0e37\u0e49\u0e2d\u0e07\u0e15\u0e49\u0e19: \u0e01\u0e32\u0e23\u0e27\u0e34\u0e40\u0e04\u0e23\u0e32\u0e30\u0e2b\u0e4c\u0e01\u0e33\u0e44\u0e23\u0e02\u0e32\u0e14\u0e17\u0e38\u0e19\u0e40\u0e1a\u0e37\u0e49\u0e2d\u0e07\u0e15\u0e49\u0e19, \u0e40\u0e04\u0e25\u0e47\u0e14\u0e25\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e2a\u0e20\u0e32\u0e1e\u0e04\u0e25\u0e48\u0e2d\u0e07\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e40\u0e07\u0e34\u0e19\n\n\u0e01\u0e0e\u0e01\u0e32\u0e23\u0e15\u0e2d\u0e1a\u0e01\u0e25\u0e31\u0e1a\n[\u0e20\u0e32\u0e29\u0e32\u0e41\u0e25\u0e30\u0e19\u0e49\u0e33\u0e40\u0e2a\u0e35\u0e22\u0e07]\n\u0e15\u0e2d\u0e1a\u0e40\u0e1b\u0e47\u0e19\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22\u0e40\u0e2a\u0e21\u0e2d \u0e14\u0e49\u0e27\u0e22\u0e19\u0e49\u0e33\u0e40\u0e2a\u0e35\u0e22\u0e07\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e21\u0e34\u0e15\u0e23 \u0e43\u0e2b\u0e49\u0e01\u0e33\u0e25\u0e31\u0e07\u0e43\u0e08 \u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e1b\u0e23\u0e36\u0e01\u0e29\u0e32 \u0e41\u0e15\u0e48\u0e22\u0e31\u0e07\u0e04\u0e07\u0e04\u0e27\u0e32\u0e21\u0e40\u0e1b\u0e47\u0e19\u0e21\u0e37\u0e2d\u0e2d\u0e32\u0e0a\u0e35\u0e1e \u0e2b\u0e25\u0e35\u0e01\u0e40\u0e25\u0e35\u0e48\u0e22\u0e07\u0e28\u0e31\u0e1e\u0e17\u0e4c\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e17\u0e35\u0e48\u0e0b\u0e31\u0e1a\u0e0b\u0e49\u0e2d\u0e19\u0e40\u0e01\u0e34\u0e19\u0e44\u0e1b\n\n[\u0e42\u0e04\u0e23\u0e07\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a LINE]\n\u0e17\u0e38\u0e01\u0e04\u0e33\u0e15\u0e2d\u0e1a\u0e15\u0e49\u0e2d\u0e07\u0e08\u0e31\u0e14\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e2d\u0e48\u0e32\u0e19\u0e07\u0e48\u0e32\u0e22\u0e1a\u0e19\u0e21\u0e37\u0e2d\u0e16\u0e37\u0e2d:\n\ud83d\udd38 \u0e02\u0e36\u0e49\u0e19\u0e15\u0e49\u0e19\u0e14\u0e49\u0e27\u0e22\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d\u0e2b\u0e25\u0e31\u0e01\u0e43\u0e19\u0e27\u0e07\u0e40\u0e25\u0e47\u0e1a \u0e40\u0e0a\u0e48\u0e19 [\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d]\n\ud83d\udd38 \u0e43\u0e0a\u0e49 Emoji \ud83d\udca1\ud83d\udcb0\ud83d\udcc8\ud83d\uded2 \u0e19\u0e33\u0e2b\u0e19\u0e49\u0e32\u0e1b\u0e23\u0e30\u0e40\u0e14\u0e47\u0e19\u0e22\u0e48\u0e2d\u0e22\n\ud83d\udd38 \u0e43\u0e0a\u0e49\u0e22\u0e48\u0e2d\u0e2b\u0e19\u0e49\u0e32\u0e2a\u0e31\u0e49\u0e19\u0e46 (\u0e44\u0e21\u0e48\u0e40\u0e01\u0e34\u0e19 2-3 \u0e1b\u0e23\u0e30\u0e42\u0e22\u0e04) \u0e41\u0e25\u0e30\u0e02\u0e36\u0e49\u0e19\u0e1a\u0e23\u0e23\u0e17\u0e31\u0e14\u0e43\u0e2b\u0e21\u0e48\u0e1a\u0e48\u0e2d\u0e22\u0e46\n\ud83d\udd38 \u0e08\u0e1a\u0e14\u0e49\u0e27\u0e22\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e38\u0e1b\u0e43\u0e2b\u0e49\u0e01\u0e33\u0e25\u0e31\u0e07\u0e43\u0e08\u0e2b\u0e23\u0e37\u0e2d\u0e04\u0e33\u0e16\u0e32\u0e21\u0e2a\u0e31\u0e49\u0e19\u0e46 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e01\u0e23\u0e30\u0e15\u0e38\u0e49\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e19\u0e17\u0e19\u0e32\n- \u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e43\u0e2a\u0e48 '*' \u0e43\u0e19\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21\n\n[\u0e02\u0e49\u0e2d\u0e08\u0e33\u0e01\u0e31\u0e14\u0e2a\u0e33\u0e04\u0e31\u0e0d]\n\ud83d\udd38 \u0e2b\u0e32\u0e01\u0e04\u0e33\u0e16\u0e32\u0e21\u0e2d\u0e22\u0e39\u0e48\u0e19\u0e2d\u0e01\u0e02\u0e2d\u0e1a\u0e40\u0e02\u0e15\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d 4 \u0e14\u0e49\u0e32\u0e19\u0e02\u0e49\u0e32\u0e07\u0e15\u0e49\u0e19 \u0e43\u0e2b\u0e49\u0e1b\u0e0f\u0e34\u0e40\u0e2a\u0e18\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e2a\u0e38\u0e20\u0e32\u0e1e\u0e27\u0e48\u0e32 \"\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49\u0e2d\u0e22\u0e39\u0e48\u0e19\u0e2d\u0e01\u0e40\u0e2b\u0e19\u0e37\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e02\u0e2d\u0e07 Co-Pilot AI \u0e04\u0e23\u0e31\u0e1a\" \u0e41\u0e25\u0e30\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e2b\u0e49\u0e1b\u0e23\u0e36\u0e01\u0e29\u0e32\u0e1c\u0e39\u0e49\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e42\u0e14\u0e22\u0e15\u0e23\u0e07\n\ud83d\udd38 \u0e2b\u0e49\u0e32\u0e21 \u0e43\u0e2b\u0e49\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e41\u0e1e\u0e17\u0e22\u0e4c, \u0e01\u0e0e\u0e2b\u0e21\u0e32\u0e22, \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e25\u0e07\u0e17\u0e38\u0e19\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e40\u0e07\u0e34\u0e19\u0e40\u0e14\u0e47\u0e14\u0e02\u0e32\u0e14"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -224,
        1632
      ],
      "id": "374785c9-9b45-4757-b0d9-5962123bcb7b",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -224,
        1824
      ],
      "id": "2ba03ead-b7e6-46bf-a3ed-4a9318f36859",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -1600,
        2080
      ],
      "id": "7000dd9b-ae5f-42b8-a301-f18590bbaefe",
      "name": "Google Gemini Chat Model1",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "dcee9191-38b1-4b95-8f2b-c1606569f942",
                    "leftValue": "={{ $json.output.intent }}",
                    "rightValue": "GREETING",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "ce6452f8-f0a3-4554-ade4-a56c180b0c59",
                    "leftValue": "={{ $json.output.intent }}",
                    "rightValue": "AI_CONSULT",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "2faeb9d7-6108-4881-aad6-c9ac06927d96",
                    "leftValue": "={{ $json.output.intent }}",
                    "rightValue": "FAQ",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.output.intent }}",
                    "rightValue": "OTHER",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "f5751c45-db5b-4d50-b078-acac5d6d4db1"
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        -1168,
        1680
      ],
      "id": "b30d1d2e-0b57-4156-8e47-4972fa4407c6",
      "name": "Switch"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are an expert intent classifier for a business assistant chatbot for F&B SMEs named 'F&B SME Co-Pilot'.\nYour task is to analyze the user's message and classify it into one of the following categories.\nRespond ONLY with a JSON object containing the determined intent.\n\nHere are the possible intents and their definitions:\n\n- AI_CONSULT: User is asking for **in-depth, personalized business advice** that requires analysis of their specific situation. This is for questions that cannot be answered with a general guide.\n\n- FAQ: User is asking a general question about the service itself, **OR a common, general business question** that could likely be answered from a knowledge base.\n\n- GREETING: User is saying hello, thank you, or other pleasantries.\n\n- OTHER: The user's request does not fit into any of the above categories.\n\n**Decision-making examples to guide you:**\n- If the user asks \"How do I do marketing online?\", classify as **FAQ**. (This is a general question)\n- If the user asks \"Can you give me a marketing plan for my new fried chicken shop in Ari?\", classify as **AI_CONSULT**. (This is a personalized request)\n- If the user asks \"What are some ways to reduce costs?\", classify as **FAQ**. (This is a general question)\n- If the user asks \"My ingredient cost is 35%, how can I lower it?\", classify as **AI_CONSULT**. (This requires analysis of specific data)\n\nUser's message: \"{{ $json.message }}\"\n\nJSON Response:",
        "hasOutputParser": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -1552,
        1696
      ],
      "id": "e672ece6-0865-47d1-90d7-51d4a091b54a",
      "name": "filter intent"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a2b94504-d596-4368-94ed-1e5974ef89ad",
              "name": "replyMessage",
              "value": "\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35\u0e04\u0e23\u0e31\u0e1a SME FoodMate  \u0e22\u0e34\u0e19\u0e14\u0e35\u0e43\u0e2b\u0e49\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23 \u0e21\u0e35\u0e2d\u0e30\u0e44\u0e23\u0e43\u0e2b\u0e49\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e1a\u0e16\u0e32\u0e21\u0e44\u0e14\u0e49\u0e40\u0e25\u0e22\u0e04\u0e23\u0e31\u0e1a \ud83d\ude0a",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -896,
        1328
      ],
      "id": "2d8714f9-0a98-46d5-b402-24a9f6bd9c39",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n\t\"intent\": \"The classified intent of the user's message. Must be one of: AI_CONSULT, FAQ, GREETING, OTHER.\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1408,
        2000
      ],
      "id": "f37ec9cf-9059-4464-8c67-c5b7ef347c9b",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"{{ $json.Answer.replaceAll('\\t',' ').replaceAll('\\\"','\\\\\\\"').replaceAll('\\n','\\\\n').trim() }}\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -32,
        2192
      ],
      "id": "018e5b63-c6cd-45bf-a64f-2e5f601a02b7",
      "name": "HTTP Request2"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"\u0e01\u0e33\u0e25\u0e31\u0e07\u0e08\u0e30\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07\u0e43\u0e2b\u0e49\u0e04\u0e23\u0e31\u0e1a \ud83e\uddd0\\n\\n\u0e01\u0e23\u0e38\u0e13\u0e32\u0e01\u0e14\u0e1b\u0e38\u0e48\u0e21\u0e14\u0e49\u0e32\u0e19\u0e25\u0e48\u0e32\u0e07 \u0e2b\u0e23\u0e37\u0e2d\u0e41\u0e0a\u0e23\u0e4c\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07\u0e17\u0e35\u0e48\u0e15\u0e31\u0e49\u0e07 (Location) \u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e44\u0e14\u0e49\u0e40\u0e25\u0e22\u0e04\u0e23\u0e31\u0e1a\",\n      \"quickReply\": {\n        \"items\": [\n          {\n            \"type\": \"action\",\n            \"action\": {\n              \"type\": \"location\",\n              \"label\": \"\ud83d\udccd \u0e2a\u0e48\u0e07\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07\u0e17\u0e35\u0e48\u0e15\u0e31\u0e49\u0e07\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19\"\n            }\n          }\n        ]\n      }\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -576,
        400
      ],
      "id": "53157b4e-e0b5-49c6-beb1-f4ce48615d5a",
      "name": "request location"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "76da3b8c-e07f-4204-97d3-93ca015f8b5f",
              "leftValue": "={{ $node[\"Get row by uid3\"].json.isEmpty() }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1072,
        144
      ],
      "id": "1c98cb09-3203-467c-bb98-5ff4eefea7b8",
      "name": "information"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "b4f15148-7ac6-4d91-a685-9aee41e250f1",
              "leftValue": "={{ parseFloat($json.lat) }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            },
            {
              "id": "ef591cfe-55c7-400e-be24-45e459774211",
              "leftValue": "={{ parseFloat($json.lon) }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -736,
        128
      ],
      "id": "984a8ebf-2c23-4433-83ce-193dca0008c8",
      "name": "location"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"\u0e22\u0e34\u0e19\u0e14\u0e35\u0e15\u0e49\u0e2d\u0e19\u0e23\u0e31\u0e1a\u0e2a\u0e39\u0e48 F&B Co-Pilot \u0e04\u0e23\u0e31\u0e1a! \ud83d\ude0a\\n\\n\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c\u0e23\u0e27\u0e21\u0e01\u0e25\u0e38\u0e48\u0e21\u0e0b\u0e37\u0e49\u0e2d \u0e02\u0e2d\u0e23\u0e1a\u0e01\u0e27\u0e19\u0e04\u0e38\u0e13\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\u0e2a\u0e31\u0e49\u0e19\u0e46 \u0e01\u0e48\u0e2d\u0e19\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a\"\n    },\n    {\n      \"type\": \"text\",\n      \"text\": \"\u0e01\u0e23\u0e38\u0e13\u0e32\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e15\u0e2d\u0e1a\u0e01\u0e25\u0e31\u0e1a\u0e21\u0e32\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49\u0e04\u0e23\u0e31\u0e1a:\\n#\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19 \u0e0a\u0e37\u0e48\u0e2d\u0e23\u0e49\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13, \u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e23\u0e49\u0e32\u0e19\\n\\n\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07:\\n#\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19 \u0e23\u0e49\u0e32\u0e19\u0e40\u0e08\u0e4a\u0e44\u0e1d\u0e42\u0e2d\u0e21\u0e32\u0e01\u0e32\u0e40\u0e2a\u0e30, \u0e2d\u0e32\u0e2b\u0e32\u0e23\u0e15\u0e32\u0e21\u0e2a\u0e31\u0e48\u0e07\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1152,
        464
      ],
      "id": "dd7e77e6-35d4-4c41-8831-9260b91f1ae1",
      "name": "request location1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "2732ac41-6df2-4362-8600-a0f1e5a65934",
              "name": "userId",
              "value": "={{ $json.body.events[0].source.userId }}",
              "type": "string"
            },
            {
              "id": "97361a7c-d326-4f64-8c53-10a155007553",
              "name": "message",
              "value": "={{ $json.body.events[0].message.text }}",
              "type": "string"
            },
            {
              "id": "2872dd3e-180c-498a-93df-36b503fa4d09",
              "name": "replyToken",
              "value": "={{ $json.body.events[0].replyToken }}",
              "type": "string"
            },
            {
              "id": "b46ac446-d02e-4e2a-bbff-3e7a7c21e2e0",
              "name": "body.events[0].postback.data",
              "value": "={{ $json.body.events[0].postback.data }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2528,
        1712
      ],
      "id": "c66ba1b6-b128-44f3-a30a-1d7982d62e52",
      "name": "message"
    },
    {
      "parameters": {
        "jsCode": "\n// 1. \u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e40\u0e15\u0e47\u0e21\u0e46 \u0e08\u0e32\u0e01 Webhook Trigger\n// (\u0e43\u0e0a\u0e49 $('Webhook') \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e41\u0e19\u0e48\u0e19\u0e2d\u0e19\u0e27\u0e48\u0e32\u0e08\u0e30\u0e44\u0e14\u0e49\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e08\u0e32\u0e01\u0e08\u0e38\u0e14\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e40\u0e2a\u0e21\u0e2d)\nconst fullMessage = $input.first().json.message\n\n// 2. \u0e15\u0e31\u0e14\u0e04\u0e33\u0e27\u0e48\u0e32 \"#\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19\" \u0e41\u0e25\u0e30\u0e0a\u0e48\u0e2d\u0e07\u0e27\u0e48\u0e32\u0e07\u0e02\u0e49\u0e32\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e2d\u0e2d\u0e01\u0e44\u0e1b\nconst dataString = fullMessage.replace('#\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19', '').trim();\n\n// 3. \u0e41\u0e22\u0e01\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e14\u0e49\u0e27\u0e22\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2b\u0e21\u0e32\u0e22 \",\"\nconst parts = dataString.split(',');\n\n// 4. \u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e27\u0e48\u0e32\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e21\u0e32\u0e16\u0e39\u0e01\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48 (\u0e04\u0e27\u0e23\u0e08\u0e30\u0e21\u0e35 2 \u0e2a\u0e48\u0e27\u0e19)\nif (parts.length !== 2) {\n  // \u0e16\u0e49\u0e32\u0e44\u0e21\u0e48\u0e16\u0e39\u0e01\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a \u0e43\u0e2b\u0e49\u0e2a\u0e48\u0e07\u0e04\u0e48\u0e32\u0e27\u0e48\u0e32\u0e07\u0e2d\u0e2d\u0e01\u0e44\u0e1b \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49 Workflow \u0e2b\u0e22\u0e38\u0e14\u0e17\u0e33\u0e07\u0e32\u0e19\u0e17\u0e35\u0e48\u0e19\u0e35\u0e48\n  // \u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e34\u0e14\u0e46 \u0e25\u0e07 Database\n  return null; \n}\n\n// 5. \u0e17\u0e33\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e30\u0e2d\u0e32\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e15\u0e48\u0e25\u0e30\u0e2a\u0e48\u0e27\u0e19 (\u0e15\u0e31\u0e14\u0e0a\u0e48\u0e2d\u0e07\u0e27\u0e48\u0e32\u0e07) \u0e41\u0e25\u0e30\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e04\u0e48\u0e32\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\nconst storeName = parts[0].trim();\nconst storeType = parts[1].trim();\n\n// 6. \u0e2a\u0e23\u0e49\u0e32\u0e07 Object \u0e43\u0e2b\u0e21\u0e48\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2d\u0e2d\u0e01\u0e44\u0e1b\u0e43\u0e2b\u0e49 Node \u0e16\u0e31\u0e14\u0e44\u0e1b\u0e43\u0e0a\u0e49\nconst item = {};\nitem.store_name = storeName;\nitem.store_type = storeType;\n\n// \u0e2a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2d\u0e2d\u0e01\u0e44\u0e1b\nreturn item;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -2128,
        1280
      ],
      "id": "2e761b03-61cb-4f34-9b44-637213694cfb",
      "name": "Code in JavaScript1"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "45d8ff4f-e876-49cd-9a0f-ec6004a3e910",
              "leftValue": "={{ $json.message }}",
              "rightValue": "Group Purchase Function",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            },
            {
              "id": "d0c40ed1-909d-422d-9361-b79c2ed4345e",
              "leftValue": "={{ $json.message }}",
              "rightValue": "Collaboration Engine Function",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1856,
        1696
      ],
      "id": "e77f5183-04e7-4911-af9c-35e386858b66",
      "name": "spreate"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "aea37d81-e1af-4a5f-9a34-326fb65b2a22",
              "leftValue": "={{ $json.Keyword }}",
              "rightValue": "={{ $('Webhook').item.json.body.events[0].message.text }}",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -464,
        2048
      ],
      "id": "598e89d1-4dfb-4b5b-b4e5-ef244398ddbc",
      "name": "If1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"{{ $json.text_message.replaceAll('\\t',' ').replaceAll('\\\"','\\\\\\\"').replaceAll('\\n','\\\\n').trim() }}\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1408,
        432
      ],
      "id": "18a40727-ca85-4f5a-a104-68e3eb81fc64",
      "name": "request location2"
    },
    {
      "parameters": {
        "jsCode": "const stores = $input.all();\n\n// \u0e2a\u0e23\u0e49\u0e32\u0e07 \"Bubble\" (\u0e01\u0e32\u0e23\u0e4c\u0e14\u0e41\u0e15\u0e48\u0e25\u0e30\u0e43\u0e1a) \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e25\u0e30\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\nconst bubbles = stores.map(item => {\n  const store = item.json;\n  return {\n    \"type\": \"bubble\",\n    \"body\": {\n      \"type\": \"box\",\n      \"layout\": \"vertical\",\n      \"contents\": [\n        { \"type\": \"text\", \"text\": store.name, \"weight\": \"bold\", \"size\": \"xl\" },\n        {\n          \"type\": \"box\",\n          \"layout\": \"vertical\",\n          \"margin\": \"lg\",\n          \"spacing\": \"sm\",\n          \"contents\": [\n            {\n              \"type\": \"box\",\n              \"layout\": \"baseline\",\n              \"spacing\": \"sm\",\n              \"contents\": [\n                { \"type\": \"text\", \"text\": \"\u0e23\u0e30\u0e22\u0e30\u0e17\u0e32\u0e07\", \"color\": \"#aaaaaa\", \"size\": \"sm\", \"flex\": 2 },\n                { \"type\": \"text\", \"text\": `${store.distance} \u0e01\u0e21.`, \"wrap\": true, \"color\": \"#666666\", \"size\": \"sm\", \"flex\": 5 }\n              ]\n            }\n          ]\n        }\n      ]\n    },\n    \"footer\": {\n      \"type\": \"box\",\n      \"layout\": \"vertical\",\n      \"spacing\": \"sm\",\n      \"contents\": [\n        {\n          \"type\": \"button\",\n          \"style\": \"link\",\n          \"height\": \"sm\",\n          \"action\": {\n            \"type\": \"postback\",\n            \"label\": \"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e23\u0e49\u0e32\u0e19\u0e19\u0e35\u0e49\",\n            \"data\": `action=select_store&uid=${store.uid}`,\n            \"displayText\": `\u0e09\u0e31\u0e19\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e23\u0e49\u0e32\u0e19 ${store.name}`\n          }\n        }\n      ]\n    }\n  };\n});\n\n// \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e42\u0e04\u0e23\u0e07 Flex Message \u0e41\u0e1a\u0e1a Carousel \u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\nconst flexMessage = {\n  \"type\": \"flex\",\n  \"altText\": \"\u0e19\u0e35\u0e48\u0e04\u0e37\u0e2d\u0e23\u0e32\u0e22\u0e0a\u0e37\u0e48\u0e2d\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07\u0e04\u0e23\u0e31\u0e1a\",\n  \"contents\": {\n    \"type\": \"carousel\",\n    \"contents\": bubbles\n  }\n};\n\n// \u0e2a\u0e48\u0e07\u0e2d\u0e2d\u0e01\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e40\u0e1b\u0e47\u0e19 Object \u0e17\u0e35\u0e48\u0e21\u0e35 key \u0e0a\u0e37\u0e48\u0e2d flex\nreturn { flex: flexMessage };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        1056
      ],
      "id": "7366b768-227d-427d-973e-3b4c10fc3cfc",
      "name": "Code in JavaScript3"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {{ $json.flex }}\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        752,
        1056
      ],
      "id": "18317542-5a52-4574-a081-66034139e278",
      "name": "request location3"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "2a9424a3-e984-4311-8357-be12f9f79b1c",
              "leftValue": "={{ $('message').item.json.message }}",
              "rightValue": "={{ $json.keyword }}",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        -704,
        2000
      ],
      "id": "ce42caca-b25f-4d7f-ad41-08b482a31c23",
      "name": "Filter",
      "alwaysOutputData": true,
      "executeOnce": false
    },
    {
      "parameters": {
        "jsCode": "const stores = $input.all();\n\n// 1. \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2a\u0e48\u0e27\u0e19\u0e2b\u0e31\u0e27\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21\nlet message = `\u0e1e\u0e1a\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07 ${stores.length} \u0e41\u0e2b\u0e48\u0e07:\\n\\n`;\n\n// 2. \u0e27\u0e19\u0e25\u0e39\u0e1b\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e41\u0e15\u0e48\u0e25\u0e30\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\nstores.forEach((item, index) => {\n  const store = item.json;\n  // \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e25\u0e02\u0e25\u0e33\u0e14\u0e31\u0e1a, \u0e0a\u0e37\u0e48\u0e2d\u0e23\u0e49\u0e32\u0e19, \u0e41\u0e25\u0e30\u0e23\u0e30\u0e22\u0e30\u0e17\u0e32\u0e07\n  message += `${index + 1}. ${store.store_name} (${store.distance} \u0e01\u0e21.)\\n`;\n});\n\n// 3. \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e2a\u0e48\u0e27\u0e19\u0e17\u0e49\u0e32\u0e22\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21\nmessage += \"\\n\u0e01\u0e23\u0e38\u0e13\u0e32\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e0a\u0e37\u0e48\u0e2d\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\u0e17\u0e35\u0e48\u0e17\u0e48\u0e32\u0e19\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e23\u0e48\u0e27\u0e21\u0e42\u0e04\u0e23\u0e07\u0e01\u0e32\u0e23\u0e04\u0e23\u0e31\u0e1a\";\n\n// 4. \u0e2a\u0e48\u0e07\u0e2d\u0e2d\u0e01\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\nreturn { text_message: message };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1200,
        432
      ],
      "id": "4efb2738-4f28-4062-b6ac-b2a66cf1d0df",
      "name": "collaboration"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"\u0e02\u0e2d\u0e2d\u0e20\u0e31\u0e22\u0e04\u0e23\u0e31\u0e1a \ud83d\ude25 \u0e02\u0e13\u0e30\u0e19\u0e35\u0e49\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e21\u0e35\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\u0e2d\u0e37\u0e48\u0e19\u0e43\u0e19\u0e1a\u0e23\u0e34\u0e40\u0e27\u0e13\u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07\u0e40\u0e02\u0e49\u0e32\u0e23\u0e48\u0e27\u0e21\u0e42\u0e04\u0e23\u0e07\u0e01\u0e32\u0e23\u0e40\u0e25\u0e22\u0e04\u0e23\u0e31\u0e1a \u0e25\u0e2d\u0e07\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e43\u0e2b\u0e21\u0e48\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07\u0e43\u0e19\u0e20\u0e32\u0e22\u0e2b\u0e25\u0e31\u0e07\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1264,
        704
      ],
      "id": "82fd2bef-7a85-4aba-a52e-78d962fcafe0",
      "name": "request location5"
    },
    {
      "parameters": {
        "jsCode": "// \ud83e\udded \u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e04\u0e33\u0e19\u0e27\u0e13\u0e23\u0e30\u0e22\u0e30\u0e17\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e2a\u0e2d\u0e07\u0e1e\u0e34\u0e01\u0e31\u0e14 (\u0e2b\u0e19\u0e48\u0e27\u0e22: \u0e01\u0e34\u0e42\u0e25\u0e40\u0e21\u0e15\u0e23)\nfunction getDistance(lat1, lon1, lat2, lon2) {\n  const R = 6371;\n  const dLat = (lat2 - lat1) * (Math.PI / 180);\n  const dLon = (lon2 - lon1) * (Math.PI / 180);\n  const a =\n    Math.sin(dLat / 2) ** 2 +\n    Math.cos(lat1 * Math.PI / 180) *\n    Math.cos(lat2 * Math.PI / 180) *\n    Math.sin(dLon / 2) ** 2;\n  const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n  return R * c;\n}\n\n// \ud83d\udd39 1. \u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e08\u0e32\u0e01 input\nconst all = $input.all().map(i => i.json);\n\n// \ud83d\udd39 2. \u0e41\u0e22\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19\u0e41\u0e25\u0e30\u0e23\u0e49\u0e32\u0e19\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\nconst current = all.find(i => i.current_user_id);\nconst stores = all.filter(i => i.user_id); // \u0e40\u0e09\u0e1e\u0e32\u0e30\u0e23\u0e49\u0e32\u0e19\n\nif (!current) {\n  return { message: { type: \"text\", text: \"\u274c \u0e44\u0e21\u0e48\u0e1e\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19\" } };\n}\n\n// \ud83d\udd39 3. \u0e14\u0e36\u0e07\u0e1e\u0e34\u0e01\u0e31\u0e14\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19\nconst userLat = parseFloat(current.current_lat);\nconst userLon = parseFloat(current.current_lon);\nconst currentUserId = current.current_user_id;\n\n// \ud83d\udd39 4. \u0e04\u0e33\u0e19\u0e27\u0e13\u0e23\u0e30\u0e22\u0e30\u0e17\u0e32\u0e07\u0e02\u0e2d\u0e07\u0e41\u0e15\u0e48\u0e25\u0e30\u0e23\u0e49\u0e32\u0e19\nconst nearbyStores = stores\n  .map(store => {\n    const distance = getDistance(\n      userLat,\n      userLon,\n      parseFloat(store.lat),\n      parseFloat(store.lon)\n    );\n    return {\n      user_id: store.user_id,\n      store_name: store.store_name,\n      store_category: store.store_category,\n      distance: parseFloat(distance.toFixed(2))\n    };\n  })\n  // \ud83d\udd39 \u0e01\u0e23\u0e2d\u0e07\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e23\u0e49\u0e32\u0e19\u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19\u0e23\u0e31\u0e28\u0e21\u0e35 5 \u0e01\u0e21. \u0e41\u0e25\u0e30\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e23\u0e49\u0e32\u0e19\u0e02\u0e2d\u0e07 user \u0e40\u0e2d\u0e07\n  .filter(s => s.distance <= 5 && s.user_id !== currentUserId)\n  // \ud83d\udd39 \u0e40\u0e23\u0e35\u0e22\u0e07\u0e08\u0e32\u0e01\u0e43\u0e01\u0e25\u0e49 \u2192 \u0e44\u0e01\u0e25\n  .sort((a, b) => a.distance - b.distance);\n\n// \ud83d\udd39 5. \u0e04\u0e37\u0e19\u0e04\u0e48\u0e32\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\nreturn nearbyStores;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        688,
        576
      ],
      "id": "2613d7b9-ce1e-4f58-9c91-65d5e9e1b3c3",
      "name": "findShop",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "5fb428c7-6540-445c-aaa0-4f18e540da3f",
              "leftValue": "={{ $('findShop').item.json.isEmpty() }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        976,
        576
      ],
      "id": "49e288de-9b30-4615-b8ed-95f6e78b3b06",
      "name": "If empty"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "b4f15148-7ac6-4d91-a685-9aee41e250f1",
              "leftValue": "={{ parseFloat($json.lat.toString()) }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            },
            {
              "id": "ef591cfe-55c7-400e-be24-45e459774211",
              "leftValue": "={{ parseFloat($json.lon.toString()) }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1328,
        1136
      ],
      "id": "7338f62c-4fbf-4688-a530-f41e2d4de360",
      "name": "location1",
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').item.json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"\u0e1b\u0e31\u0e01\u0e2b\u0e21\u0e38\u0e14\u0e23\u0e49\u0e32\u0e19 {{ $('Get row by uid1').item.json.name }} \u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27\u0e04\u0e23\u0e31\u0e1a! \u0e25\u0e2d\u0e07\u0e43\u0e0a\u0e49\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c '\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e23\u0e49\u0e32\u0e19\u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07' \u0e2b\u0e23\u0e37\u0e2d 'Group Purchase' \u0e44\u0e14\u0e49\u0e40\u0e25\u0e22\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -800,
        1088
      ],
      "id": "068a0e1b-70e0-4b75-93bc-f02aad5177d9",
      "name": "request location6"
    },
    {
      "parameters": {
        "operation": "upsert",
        "schema": {
          "__rl": true,
          "value": "sme",
          "mode": "list",
          "cachedResultName": "sme"
        },
        "table": {
          "__rl": true,
          "value": "users",
          "mode": "list",
          "cachedResultName": "users"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "lat": "={{ $('Webhook').item.json.body.events[0].message.latitude }}",
            "lon": "={{ $('Webhook').item.json.body.events[0].message.longitude }}",
            "user_id": "={{ $json.userId }}"
          },
          "matchingColumns": [
            "user_id"
          ],
          "schema": [
            {
              "id": "user_id",
              "displayName": "user_id",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "store_name",
              "displayName": "store_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            },
            {
              "id": "store_category",
              "displayName": "store_category",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            },
            {
              "id": "lat",
              "displayName": "lat",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "lon",
              "displayName": "lon",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        -1872,
        1472
      ],
      "id": "45a9a43d-799b-4496-b554-8c9228fcb0ca",
      "name": "store location",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "upsert",
        "schema": {
          "__rl": true,
          "value": "sme",
          "mode": "list",
          "cachedResultName": "sme"
        },
        "table": {
          "__rl": true,
          "value": "users",
          "mode": "list",
          "cachedResultName": "users"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "lat": 0,
            "lon": 0,
            "user_id": "={{ $('message').item.json.userId }}",
            "store_name": "={{ $json.store_name }}",
            "store_category": "={{ $json.store_type }}",
            "created_at": "={{ new Date().toDateTime() }}"
          },
          "matchingColumns": [
            "user_id"
          ],
          "schema": [
            {
              "id": "user_id",
              "displayName": "user_id",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "store_name",
              "displayName": "store_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            },
            {
              "id": "store_category",
              "displayName": "store_category",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            },
            {
              "id": "lat",
              "displayName": "lat",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "lon",
              "displayName": "lon",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        -1840,
        1280
      ],
      "id": "4dd99921-d1d2-4145-8a88-d9c299f02bba",
      "name": "store name type1",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "select",
        "schema": {
          "__rl": true,
          "value": "sme",
          "mode": "list",
          "cachedResultName": "sme"
        },
        "table": {
          "__rl": true,
          "value": "users",
          "mode": "list",
          "cachedResultName": "users"
        },
        "returnAll": true,
        "where": {
          "values": [
            {
              "column": "user_id",
              "value": "={{ $json.user_id }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        -1616,
        1280
      ],
      "id": "5736f803-e2f9-4f4f-99ed-65a266f482c2",
      "name": "Get row by uid2",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "select",
        "schema": {
          "__rl": true,
          "value": "sme",
          "mode": "list",
          "cachedResultName": "sme"
        },
        "table": {
          "__rl": true,
          "value": "users",
          "mode": "list",
          "cachedResultName": "users"
        },
        "returnAll": true,
        "where": {
          "values": [
            {
              "column": "user_id",
              "value": "={{ $('message').item.json.userId }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        -1456,
        144
      ],
      "id": "d7590e4e-7359-4d5d-bc55-fc0e6b7b0b86",
      "name": "Get row by uid3",
      "alwaysOutputData": true,
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"\u0e1b\u0e31\u0e01\u0e2b\u0e21\u0e38\u0e14\u0e23\u0e49\u0e32\u0e19\u0e04\u0e49\u0e32\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27! \ud83d\udccd\\n\\n\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e04\u0e38\u0e13\u0e01\u0e23\u0e2d\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e04\u0e23\u0e1a\u0e16\u0e49\u0e27\u0e19\u0e41\u0e25\u0e49\u0e27 \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e23\u0e34\u0e48\u0e21\u0e43\u0e0a\u0e49\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c 'Collaboration' \u0e2b\u0e23\u0e37\u0e2d 'Group Purchase' \u0e08\u0e32\u0e01\u0e40\u0e21\u0e19\u0e39\u0e44\u0e14\u0e49\u0e40\u0e25\u0e22\u0e04\u0e23\u0e31\u0e1a!\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1616,
        1472
      ],
      "id": "7cccdaa9-5728-4ab3-94ad-5d847165ca54",
      "name": "store location complete"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer dfb5VjlLp060/Co+K/KvfL3JRM8qGYag5hbDOvqyfXuMMZ0auDMU3RQ0CC3XJCbt/5sXYsbfO51+5dIt6Xq3WD48lxkTxubVv5Yps4NMkL6SnVvuieSq86Qyo3ZugeYbz0OkGv25DxMUN/aheZpANwdB04t89/1O/w1cDnyilFU="
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"replyToken\": \"{{ $('Webhook').first().json.body.events[0].replyToken }}\",\n  \"messages\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"{{ $json.replyMessage }}\"\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -608,
        1328
      ],
      "id": "7c906650-ed74-4f41-9e89-97c0985a78a3",
      "name": "hello"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('message').item.json.message }}",
                    "rightValue": "Group Purchase Function",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "ef822b7f-2dd0-4d9a-bf12-af03c598d552"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "88a2434c-c98c-4350-9380-88df7c535045",
                    "leftValue": "={{ $('message').item.json.message }}",
                    "rightValue": "Collaboration Engine Function",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
   

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

LineOA. Uses httpRequest, agent, lmChatGoogleGemini, outputParserStructured. Webhook trigger; 69 nodes.

Source: https://github.com/porrab/F-B_LineOA/blob/9bfcdb4480d65268de29cd2b4e8995d1f277c34c/LineOA.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

⏺ 🚀 How it works

Agent, Anthropic Chat, Output Parser Structured +6
AI & RAG

Resume Screening & Behavioral Interviews with Gemini, Elevenlabs, & Notion ATS copy. Uses outputParserStructured, chainLlm, googleDrive, stickyNote. Webhook trigger; 67 nodes.

Output Parser Structured, Chain Llm, Google Drive +9
AI & RAG

Candidate Engagement | Resume Screening | AI Voice Interviews | Applicant Insights

Output Parser Structured, Chain Llm, Google Drive +9
AI & RAG

leads. Uses supabase, gmail, formTrigger, httpRequest. Webhook trigger; 62 nodes.

Supabase, Gmail, Form Trigger +13
AI & RAG

Automatically capture company and store details from LinkedIn posts, enrich them with domain names and key decision-maker (KDM) data from Apollo.io, and store everything neatly in Google Sheets. This

Output Parser Structured, Google Gemini Chat, Google Sheets +2