{
  "name": "LINEnotion進行中 copy",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "2ab5b6c4-99a5-41c1-8ef2-6a222d410f38",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        0
      ],
      "id": "d24f6b7c-c552-46cc-b9c7-34c2246f5272",
      "name": "Webhook",
      "webhookId": "2ab5b6c4-99a5-41c1-8ef2-6a222d410f38"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "ce9ab6d6-4c41-41ca-a5a2-cc740d983967",
              "name": "={{ $json.body.events[0].message.id }}",
              "value": "",
              "type": "string"
            },
            {
              "id": "d137a9b8-a0bb-4984-9dab-aadbac82bd8c",
              "name": "body.events[0].message.text",
              "value": "={{ $json.body.events[0].message.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        208,
        0
      ],
      "id": "f5c97a6e-2365-45dd-b77c-ef28b550f6fa",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=あなたはUVLEDグルー製造、硬化用ライトの専門アシスタントです。\n専門的な質問には正確に答えてください。\nUV/LEDに関係ない質問には「現在はブラッシュアップ中でして、UVLEDやマツエクで使用するUVLED用のグルーについてだけAIがご返信させていただいています。この様に私（AI）がお答えできない場合は、管理者の長谷川がのちほど目で確認して対応するはずですので、少々おまちくださいますようお願いいたします。」と1行で答えてください。\n\n## ユーザーからの質問\n{{ $json.body.events[0].message.text }} {{ $json.body.events[0].message.text }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        416,
        0
      ],
      "id": "27aaeee8-cb52-4faa-adaf-3246acb9718e",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        288,
        208
      ],
      "id": "1a5b0463-9585-499f-ad64-2a679f30d5ee",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "LJ5vcEmnL5NoUGfp",
          "name": "OpenAi account 4"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "sendHeaders": true,
        "specifyHeaders": "json",
        "jsonHeaders": "{\n  \"Authorization\": \"Bearer oIXjzVIAbea+sNSnKzdPwyhO5diwQRjH1vkK6Yo2wze9APSmaQUGj0RO46Xi3iTjIOFuvFK5o9z482D8psT0xttA8xU0epF74qTa9FHXSnBEA/MQiC+qcdH1+5w/CGbJrkbNi8RVPivBT89SMgsnyQdB04t89/1O/w1cDnyilFU=\",\n  \"Content-Type\": \"application/json\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "=`{\"replyToken\": \"${{ $node[\"Webhook\"].json.events[0].replyToken }}\",\n  \"messages\": [{\n    \"type\": \"text\",\n    \"text\": \"${{ $node[\"AI Agent\"].json.output }}\"\n  }]\n}`",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        976,
        0
      ],
      "id": "a94d44fc-5f7e-4a15-9ed6-520192e90b3a",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "value": "28807a46368c80c1a894e1acfcf09e5e",
          "mode": "id",
          "__regex": "^([0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12})"
        },
        "title": "={{ $node[\"Edit Fields\"].json.body.events[0].message.text }}",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "回答内容|rich_text",
              "richText": true,
              "text": {
                "text": [
                  {
                    "text": "={{ $node[\"AI Agent\"].json.output }}",
                    "annotationUi": {}
                  }
                ]
              }
            },
            {
              "key": "ユーザーID|rich_text",
              "richText": true,
              "text": {
                "text": [
                  {
                    "text": "={{ $('Webhook').item.json.body.events[0].source.userId }}",
                    "annotationUi": {}
                  }
                ]
              }
            },
            {
              "key": "日時|date",
              "date": "={{$now}}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        768,
        0
      ],
      "id": "8b0c4481-098d-4bc8-a0ff-786b108cfb51",
      "name": "Create a database page",
      "alwaysOutputData": false,
      "credentials": {
        "notionApi": {
          "id": "PYCiXD73vgfnOXjn",
          "name": "Notion account 3"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Create a database page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a database page": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0352c487-4d53-4d61-b5b9-742273509b4d",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "b3465b6d7c6cd1e10b105d8229d0088cd80d791ec9abf15619c31f77671024e0"
  },
  "id": "wB874P70W8FbnBuY",
  "tags": []
}