{
  "name": "Send advice from three AI personas via LINE, Gemini, and Google Sheets",
  "nodes": [
    {
      "id": "c4365520-63df-4041-93be-00bea975f4ec",
      "name": "Sticky Note — Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        16
      ],
      "parameters": {
        "width": 712,
        "height": 600,
        "content": "## Overview\nThis workflow lets users send any worry or question to a LINE bot and instantly receive advice from three distinct AI personas — a Fortune Teller 🔮, a Business Coach 💼, and a Best Friend 😊"
      }
    },
    {
      "id": "bcb42662-52bf-46e1-9fa6-6d97409ba4b3",
      "name": "Sticky Note — Section 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        352
      ],
      "parameters": {
        "width": 304,
        "height": 220,
        "content": "## 1. Receive & configure\nWebhook receives the LINE event.\nPaste your credentials in **Set config**."
      }
    },
    {
      "id": "b9e15dcc-ba9a-4d86-9693-66edd4b57d33",
      "name": "Sticky Note — Section 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        336
      ],
      "parameters": {
        "width": 380,
        "height": 220,
        "content": "## 2. Parse & route\nExtracts userId, replyToken, and message text.\nNon-message events (follows, etc.) are skipped immediately."
      }
    },
    {
      "id": "107baccf-bce7-4a35-8e6a-f74556388b22",
      "name": "Sticky Note — Section 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        240
      ],
      "parameters": {
        "width": 560,
        "height": 220,
        "content": "## 3. Generate advice with Gemini\nBuilds a structured prompt and calls Gemini.\nThe response is parsed into three persona fields."
      }
    },
    {
      "id": "50fc75cc-310a-4971-893b-da3d8fadf73e",
      "name": "Sticky Note — Section 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        352
      ],
      "parameters": {
        "width": 560,
        "height": 220,
        "content": "## 4. Log & reply\nSaves the conversation to Google Sheets,\nthen sends a Flex Message carousel back to the user."
      }
    },
    {
      "id": "f2d60e0b-2288-42f7-9c40-0230d58fca46",
      "name": "Receive LINE message",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -240,
        592
      ]
    },
    {
      "id": "cd98f303-bdba-4513-838f-442853931dfe",
      "name": "Set config",
      "type": "n8n-nodes-base.set",
      "position": [
        -16,
        592
      ]
    },
    {
      "id": "8a2f923f-bd00-43f6-9f2f-4fb53eb013da",
      "name": "Parse LINE event",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        592
      ]
    },
    {
      "id": "52c9a62d-b608-4b2c-b2d2-408e758304ba",
      "name": "Skip if no text event",
      "type": "n8n-nodes-base.if",
      "position": [
        432,
        592
      ]
    },
    {
      "id": "ea83a492-fd1b-4ab3-bfa4-c338ff3e5751",
      "name": "Respond OK (skip)",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        640,
        448
      ]
    },
    {
      "id": "7b773bfd-eb46-4e81-b639-275e8dae6f98",
      "name": "Build context",
      "type": "n8n-nodes-base.code",
      "position": [
        640,
        704
      ]
    },
    {
      "id": "c511cf07-85fd-494a-a300-6369c1c5b4f4",
      "name": "Generate advice with Gemini",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        864,
        704
      ]
    },
    {
      "id": "94c799f4-6d24-4a13-ae37-af0959283e51",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        800,
        912
      ]
    },
    {
      "id": "04099137-d571-4624-ba19-0102b7b5e65f",
      "name": "Parse Gemini response",
      "type": "n8n-nodes-base.code",
      "position": [
        1456,
        704
      ]
    },
    {
      "id": "65db7340-2e0b-4c83-be13-4e29fa1bc74c",
      "name": "Save advice to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1680,
        704
      ]
    },
    {
      "id": "a89695d2-32a0-4312-b5b7-c3360b1c50c6",
      "name": "Send Flex Message to LINE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1904,
        704
      ]
    },
    {
      "id": "e3db4e90-555a-4178-b132-38a41242c3a4",
      "name": "Respond OK",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2128,
        704
      ]
    }
  ],
  "connections": {
    "Set config": {
      "main": [
        [
          {
            "node": "Parse LINE event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build context": {
      "main": [
        [
          {
            "node": "Generate advice with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse LINE event": {
      "main": [
        [
          {
            "node": "Skip if no text event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive LINE message": {
      "main": [
        [
          {
            "node": "Set config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Gemini response": {
      "main": [
        [
          {
            "node": "Save advice to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save advice to Sheets": {
      "main": [
        [
          {
            "node": "Send Flex Message to LINE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Skip if no text event": {
      "main": [
        [
          {
            "node": "Respond OK (skip)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Build context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate advice with Gemini",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send Flex Message to LINE": {
      "main": [
        [
          {
            "node": "Respond OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate advice with Gemini": {
      "main": [
        [
          {
            "node": "Parse Gemini response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}