{
  "name": "Read palm lines and send AI reports via LINE, Gemini, Gmail and Calendar",
  "nodes": [
    {
      "id": "ecf2bdc5-9f23-4f25-90f6-b243f3b33ad7",
      "name": "Sticky Note — Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1392,
        -736
      ],
      "parameters": {
        "width": 644,
        "height": 680,
        "content": "## 🔮 Palm Reading Bot — Overview\n\n### How it works\nThis workflow turns your LINE account into an AI-powered palm reading bot. When a user sends a palm photo via LINE, the image is downloaded and analy"
      }
    },
    {
      "id": "3ca2e7f6-2740-4126-997a-a646877ee45d",
      "name": "Sticky Note — Trigger section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        176
      ],
      "parameters": {
        "width": 340,
        "height": 200,
        "content": "## 1️⃣ Trigger & config\n\nReceives the LINE webhook POST and immediately sets all credentials and event data into named fields for easy reference downstream."
      }
    },
    {
      "id": "4731322d-918f-449c-9a6b-34fbb3697729",
      "name": "Sticky Note — Image check section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -256
      ],
      "parameters": {
        "width": 340,
        "height": 200,
        "content": "## 2️⃣ Image check\n\nOnly image messages are supported. Text or sticker messages are caught here and receive a friendly prompt asking the user to send a photo of their palm instead."
      }
    },
    {
      "id": "47fcf89b-38c7-4c87-8ca6-e175a6b1676a",
      "name": "Sticky Note — AI analysis section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -352
      ],
      "parameters": {
        "width": 340,
        "height": 200,
        "content": "## 3️⃣ AI analysis\n\nThe palm image is fetched from LINE's content API and passed to Google Gemini. The prompt asks for a LINE-ready short summary, a full line-by-line reading, and three lucky date sug"
      }
    },
    {
      "id": "485b33ad-9be9-4b13-aeb6-18d83a462d29",
      "name": "Sticky Note — Output section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -480
      ],
      "parameters": {
        "width": 340,
        "height": 200,
        "content": "## 4️⃣ Multi-channel output\n\nAfter parsing the Gemini response, three actions run in parallel:\n- Short summary → LINE reply\n- Full report → Gmail HTML email\n- Lucky dates → Google Calendar events"
      }
    },
    {
      "id": "f5e404ac-3783-436d-8271-4be167696fc4",
      "name": "Receive LINE webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -928,
        0
      ]
    },
    {
      "id": "e5ff02ca-3b1c-475d-9e34-13883f505c81",
      "name": "Set config variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -704,
        0
      ]
    },
    {
      "id": "194e3e36-2d22-494e-a055-c61003b59815",
      "name": "Check if message is image",
      "type": "n8n-nodes-base.if",
      "position": [
        -480,
        0
      ]
    },
    {
      "id": "2aec9fc6-0155-4642-8b58-96c52fe80158",
      "name": "Download image from LINE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -256,
        -112
      ]
    },
    {
      "id": "a241333c-071c-4473-a6c2-9655ed11e8c5",
      "name": "Analyze palm lines with Gemini",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -80,
        -112
      ]
    },
    {
      "id": "c798fb24-5309-4d4d-9b14-f13c73a11970",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -32,
        64
      ]
    },
    {
      "id": "ef61e224-1106-4441-9eaa-fc065bbed42b",
      "name": "Parse Gemini response",
      "type": "n8n-nodes-base.set",
      "position": [
        192,
        -112
      ]
    },
    {
      "id": "cc4f6eea-8813-484e-84df-bf8cbcf88fc3",
      "name": "Reply to LINE with summary",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        416,
        -240
      ]
    },
    {
      "id": "78153381-a5df-4d11-baa1-c8c0fb9fe7e6",
      "name": "Send detailed report via Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        416,
        -80
      ]
    },
    {
      "id": "990021c1-c0e2-4276-97c3-aa01ad1417fb",
      "name": "Register lucky days in Google Calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        416,
        80
      ]
    },
    {
      "id": "33cd1525-cdc7-43b9-8e39-7f06d77b2147",
      "name": "Reply with error for non-image message",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -256,
        128
      ]
    },
    {
      "id": "fd8a87d7-b279-48a6-9fe6-51986616cead",
      "name": "Respond to webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        640,
        -80
      ]
    }
  ],
  "connections": {
    "Receive LINE webhook": {
      "main": [
        [
          {
            "node": "Set config variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set config variables": {
      "main": [
        [
          {
            "node": "Check if message is image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Gemini response": {
      "main": [
        [
          {
            "node": "Reply to LINE with summary",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send detailed report via Gmail",
            "type": "main",
            "index": 0
          },
          {
            "node": "Register lucky days in Google Calendar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download image from LINE": {
      "main": [
        [
          {
            "node": "Analyze palm lines with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze palm lines with Gemini",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check if message is image": {
      "main": [
        [
          {
            "node": "Download image from LINE",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply with error for non-image message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply to LINE with summary": {
      "main": [
        [
          {
            "node": "Respond to webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze palm lines with Gemini": {
      "main": [
        [
          {
            "node": "Parse Gemini response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send detailed report via Gmail": {
      "main": [
        [
          {
            "node": "Respond to webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Register lucky days in Google Calendar": {
      "main": [
        [
          {
            "node": "Respond to webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}