{ "id": "a5tCsfMzJPd8WDUj", "meta": { "instanceId": "workflow-63902067", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:46.846118", "updatedAt": "2025-09-29T07:07:46.846130", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "name": "line message api demo", "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "nodes": [ { "id": "2bc1cc31-136c-46a4-a789-476e33c76f3d", "name": "Line : Reply with token", "type": "n8n-nodes-base.httpRequest", "position": [ -540, -460 ], "parameters": { "url": "{{ $env.API_BASE_URL }}", "method": "POST", "options": {}, "jsonBody": "={\n \"replyToken\": \"{{ $('Webhook from Line Message').item.json.body.events[0].replyToken }}\",\n \"messages\": [\n {\n \"type\": \"text\",\n \"text\": \"收到您的訊息 : {{ $('Webhook from Line Message').item.json.body.events[0].message.text }}\"\n }\n ]\n}", "sendBody": true, "specifyBody": "json", "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth" }, "credentials": { "httpHeaderAuth": { "id": "xB2Ip7YKSIDq7BoI", "name": "Line n8n demo auth" } }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "a1d9c986-4712-4d40-955d-40d1b19d74db", "name": "Webhook from Line Message", "type": "n8n-nodes-base.webhook", "position": [ -1020, -440 ], "webhookId": "638c118e-1c98-4491-b6ff-14e2e75380b6", "parameters": { "path": "638c118e-1c98-4491-b6ff-14e2e75380b6", "options": {}, "httpMethod": "POST" }, "typeVersion": 2, "notes": "This webhook node performs automated tasks as part of the workflow." }, { "id": "a0c94852-290f-48b9-8e11-b498ada90c8f", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1100, -620 ], "parameters": { "width": 720, "height": 340, "content": "## Line Message API Reply\n\nReceived Message from user and reply with same text by using reply token \n\nThere are many event types. So we need to determine if the type is message." }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "278aff13-c081-47f0-a1f6-67920642e991", "name": "If Node", "type": "n8n-nodes-base.if", "position": [ -800, -440 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "b63773bb-f010-4018-8142-240c9aaa4570", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $json.body.events[0].type }}", "rightValue": "message" } ] } }, "typeVersion": 2.2, "notes": "This if node performs automated tasks as part of the workflow." }, { "id": "cff2f1d3-b7a4-4940-a1d1-1e5a80d6ea28", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -1100, -200 ], "parameters": { "width": 720, "height": 340, "content": "## Line Message API Send Message\n\nYou need to get the Line UID first.\nEvery user is differnt.\n\nIf you have the Line UID. Then you can push the message to the User." }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "9348fc83-0aeb-4591-85b6-48f556512478", "name": "When clicking ‘Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ -1020, -20 ], "parameters": {}, "typeVersion": 1, "notes": "This manualTrigger node performs automated tasks as part of the workflow." }, { "id": "74db3e1b-9a22-4033-bf04-a8ff485a5d3b", "name": "Edit Fields", "type": "n8n-nodes-base.set", "position": [ -800, -20 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "6278f340-6287-4e89-b774-f6c584954d5b", "name": "line_uid", "type": "string", "value": "Uxxxxxxxxxxxx" } ] } }, "typeVersion": 3.4, "notes": "This set node performs automated tasks as part of the workflow." }, { "id": "c593bd58-8f6a-4689-bb12-e71256ccf6e6", "name": "Line : Push Message", "type": "n8n-nodes-base.httpRequest", "position": [ -560, -20 ], "parameters": { "url": "{{ $env.API_BASE_URL }}", "method": "POST", "options": {}, "jsonBody": "={\n \"to\": \"{{ $json.line_uid }}\",\n \"messages\": [\n {\n \"type\": \"text\",\n \"text\": \"推播測試\"\n }\n ]\n}", "sendBody": true, "specifyBody": "json", "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth" }, "credentials": { "httpHeaderAuth": { "id": "xB2Ip7YKSIDq7BoI", "name": "Line n8n demo auth" } }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." } ], "active": true, "pinData": {}, "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "versionId": "240dc848-8803-4776-b01d-5f10c765f72b", "connections": { "2bc1cc31-136c-46a4-a789-476e33c76f3d": { "main": [ [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-884927f0", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-69998a52", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-457be493", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-1f5b7ee2", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-7a9cfcd2", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-755c1910", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-eb45459e", "type": "main", "index": 0 } ], [ { "node": "error-handler-2bc1cc31-136c-46a4-a789-476e33c76f3d-e45f8578", "type": "main", "index": 0 } ] ] }, "a1d9c986-4712-4d40-955d-40d1b19d74db": { "main": [ [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-fdf78930", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-6f9815ca", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-7098c576", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-70adb87b", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-ff146133", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-50eea36b", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-9af1b164", "type": "main", "index": 0 } ], [ { "node": "error-handler-a1d9c986-4712-4d40-955d-40d1b19d74db-f7d7f812", "type": "main", "index": 0 } ] ] }, "c593bd58-8f6a-4689-bb12-e71256ccf6e6": { "main": [ [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-93587bb8", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-f3c5c53d", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-2ef3fbd6", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-0250bf9f", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-0b34f7a5", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-f08eaf66", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-a94eebce", "type": "main", "index": 0 } ], [ { "node": "error-handler-c593bd58-8f6a-4689-bb12-e71256ccf6e6-9960747e", "type": "main", "index": 0 } ] ] } }, "description": "Automated workflow: line message api demo. This workflow integrates 7 different services: webhook, stickyNote, httpRequest, set, stopAndError. It contains 14 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: line message api demo. This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }