AutomationFlowsAI & RAG › AI-Powered Line Bot with Azure OpenAI

AI-Powered Line Bot with Azure OpenAI

Original n8n title: Line Bot

line_bot. Uses lmChatAzureOpenAi, agent, httpRequest. Webhook trigger; 11 nodes.

Webhook trigger★★★★☆ complexityAI-powered11 nodesLm Chat Azure Open AiAgentHTTP Request
AI & RAG Trigger: Webhook Nodes: 11 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → HTTP Request 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": "Line Bot",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "line-webhook",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        0
      ],
      "id": "f17f101c-4f04-4528-8a45-ca16d225a509",
      "name": "Webhook"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.body.events[0].message.text }}",
        "options": {
          "systemMessage": "\u0e04\u0e38\u0e13\u0e1c\u0e39\u0e49\u0e0a\u0e48\u0e27\u0e22\u0e15\u0e2d\u0e1a\u0e04\u0e33\u0e16\u0e32\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e01\u0e32\u0e23\u0e15\u0e48\u0e32\u0e07 \u0e46 \u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 event data \u0e16\u0e49\u0e32\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e16\u0e32\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27 event data \u0e43\u0e2b\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e2d\u0e07 event \u0e19\u0e31\u0e49\u0e19 \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49 date \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e2b\u0e47\u0e19\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e15\u0e32\u0e21\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e01\u0e32\u0e23\u0e19\u0e31\u0e49\u0e19\u0e0b\u0e36\u0e48\u0e07\u0e40\u0e01\u0e47\u0e1a\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a MM/dd/yyyy"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        208,
        0
      ],
      "id": "750e6820-ae02-4891-a37b-f90bf0612212",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        144,
        208
      ],
      "id": "81b6c454-5825-408e-aac6-181808eb46e3",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.body.events[0].source.userId }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        272,
        208
      ],
      "id": "212b21a6-b49c-441c-9f0e-f724c4893b8d",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1qSYvLmeNfZnUTQSB_hpbK1rnzUvdn_-cnyr3dsv78CM",
          "mode": "list",
          "cachedResultName": "events",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qSYvLmeNfZnUTQSB_hpbK1rnzUvdn_-cnyr3dsv78CM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qSYvLmeNfZnUTQSB_hpbK1rnzUvdn_-cnyr3dsv78CM/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        416,
        208
      ],
      "id": "31f61c3f-12e5-45f2-9c14-95473795e41c",
      "name": "Event Data",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer zJ4d34kbTLbYYLe+zQgsM1NA2+HXsmrZdO6B+PoqzLFhJksiR50/+bckxpKbOZq/jkWXIoldP5bzRPmGJnr4HDUiL6tjfrWYJpnR7W0blMeb9A9o0nn7OkdPb4+1a3TnfyHQSVLjGjTB9BiLeMOvTgdB04t89/1O/w1cDnyilFU="
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n\"replyToken\":{{ $('Webhook').item.json.body.events[0].replyToken.toJsonString() }},\n\"messages\":[\n{\"type\":\"text\",\n\"text\":{{ $json.output.toJsonString() }}}\n]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        560,
        0
      ],
      "id": "9497f933-951e-4c5d-9ccd-323400fe7ba8",
      "name": "HTTP Request"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Event Data": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "cd27ba10-0f3d-4a94-be06-9cb2894f9cf5",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "mvaXswLxz2N0D3QB",
  "tags": []
}
Pro

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

How this works

This workflow enables seamless interaction with LINE messaging by processing incoming messages via a webhook and generating intelligent responses powered by Azure OpenAI, delivering quick and context-aware replies to users on the LINE platform. It's ideal for developers or businesses building chatbots for customer support, notifications, or engagement on LINE, saving time on manual responses and enhancing user experience through AI-driven conversations. The key step involves the AI Agent node, which analyses the message content and crafts a tailored reply using the lmChatAzureOpenAI integration before sending it back via HTTP Request.

Use this workflow when integrating AI into LINE bots for real-time, scalable messaging without custom coding from scratch, particularly for handling queries or automating replies in apps like e-commerce or services. Avoid it for non-messaging tasks or if you lack Azure OpenAI access, as it relies on that for intelligence. Common variations include adding database nodes for conversation history or swapping Azure for other AI providers to fit different setups.

About this workflow

line_bot. Uses lmChatAzureOpenAi, agent, httpRequest. Webhook trigger; 11 nodes.

Source: https://github.com/KuiMing/n8n_agent/blob/4539f71ab276171ae8646a1e35db343a23c7d9e8/n8n/line_bot.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

This template is for teams that use GitLab merge requests and want a practical AI-assisted review workflow in n8n. It is useful for engineering teams that want faster first-pass reviews, consistent re

HTTP Request, Agent, Lm Chat Azure Open Ai +1
AI & RAG

Chatbot AI. Uses httpRequest, agent, lmChatAzureOpenAi, stickyNote. Webhook trigger; 14 nodes.

HTTP Request, Agent, Lm Chat Azure Open Ai
AI & RAG

Are you looking to create a counseling chatbot that provides emotional support and mental health guidance through the LINE messaging platform ? This guide will walk you through connecting LINE with po

HTTP Request, Agent, Lm Chat Azure Open Ai
AI & RAG

Build_Your_Own_Counseling_Chatbot_on_LINE_to_Support_Mental_Health_Conversations. Uses httpRequest, agent, lmChatAzureOpenAi. Webhook trigger; 14 nodes.

HTTP Request, Agent, Lm Chat Azure Open Ai
AI & RAG

VEP WAPP. Uses openAi, lmChatOpenAi, toolCalculator, agent. Webhook trigger; 100 nodes.

OpenAI, OpenAI Chat, Tool Calculator +7