{
  "name": "Build your own counseling chatbot on LINE to support mental health conversations",
  "nodes": [
    {
      "id": "6eec6665-eea6-4aaa-8ae5-2fc7bf0c4746",
      "name": "Loading Animation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -520,
        340
      ]
    },
    {
      "id": "72ff06e5-e1d8-47e7-be15-888ec9171c72",
      "name": "ReplyMessage - Not supported",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        100,
        760
      ]
    },
    {
      "id": "3a4eb71f-033d-4aff-a4fd-2ed14ea80c6c",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        40,
        80
      ]
    },
    {
      "id": "7a92aeaf-3496-410f-a6fd-4be5172b650e",
      "name": "Azure OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        80,
        200
      ]
    },
    {
      "id": "36df34d5-4232-40c8-b0ca-de7e30807adc",
      "name": "ReplyMessage - Line",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        920,
        80
      ]
    },
    {
      "id": "c3e227dd-3306-4259-ad7a-c1911c3c5176",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        680
      ],
      "parameters": {
        "width": 320,
        "height": 260,
        "content": "For non-text, we do not process and just provide user that it's not supported right now"
      }
    },
    {
      "id": "fba0b833-896e-4332-97e5-fa09a3838191",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        280
      ],
      "parameters": {
        "width": 340,
        "height": 560,
        "content": "**Webhook from Line**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nYou need to set-up this webhook at Line Manager or Line Developer Console\n\nYou'll need to copy Webhook URL from this node to put in Line Console\n\nAlso, don't for"
      }
    },
    {
      "id": "f58d7af5-70c4-412a-a8f6-6cfceaf65ade",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        280
      ],
      "parameters": {
        "width": 340,
        "height": 560,
        "content": "**Line Loading Animation**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThis node is to only give ... loading animation back in Line.\n\nIt seems stupid but it actually tells user that the workflow is running and you are not left "
      }
    },
    {
      "id": "7c67d79d-e2b8-453c-8adc-cb66e6ef290c",
      "name": "Line Chatbot",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -900,
        340
      ]
    },
    {
      "id": "a44319cf-d985-4bbf-be99-ac479406c369",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        0
      ],
      "parameters": {
        "width": 320,
        "height": 600,
        "content": "**Reply Message**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nYou can send anything with reply-token without using your broadcast quota.\n\nTo use header auth: \n- select generic > header auth\n- add new \n- name = Authorization"
      }
    },
    {
      "id": "1cfa159b-57c6-424a-a9e2-4b237a0bcbb5",
      "name": "Check Message Type IsText?",
      "type": "n8n-nodes-base.if",
      "position": [
        -220,
        340
      ]
    },
    {
      "id": "48363222-487e-4d4a-a424-4406aacc7f74",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        0
      ],
      "parameters": {
        "width": 320,
        "height": 320,
        "content": "The output from AI-Agent is not properly formatted for JSON to send via reply. So you need to edit it a bit\n"
      }
    },
    {
      "id": "d7b7d3ca-c685-4a02-8b73-a5b24aa663d4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 320,
        "height": 620,
        "content": "**Chat Model (LLM)**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTo use chat LLM, you need to have AI Agent or LLM Chain. Then you can connect the model to the node.\n- edit system prompt on the mother node. \n- edit model"
      }
    },
    {
      "id": "8cb1b56a-15dd-4936-b343-c2350b2a6a48",
      "name": "Format Reply",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        80
      ]
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Format Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Reply": {
      "main": [
        [
          {
            "node": "ReplyMessage - Line",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Line Chatbot": {
      "main": [
        [
          {
            "node": "Loading Animation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loading Animation": {
      "main": [
        [
          {
            "node": "Check Message Type IsText?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check Message Type IsText?": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ReplyMessage - Not supported",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}