{
  "name": "LINE・Claude・Gmailで在庫と来店の問い合わせに返信案を作り、承認してから送る",
  "nodes": [
    {
      "id": "c4664533-cfa4-4a0a-8148-d019c6e15cd2",
      "name": "LINEから受信",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        320
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "line-shop",
        "responseMode": "onReceived",
        "options": {
          "rawBody": true
        }
      },
      "webhookId": "25eb7853-9850-4e95-9aca-2c0cfb1d1ae9"
    },
    {
      "id": "0213b038-22b8-414d-807d-e30ccbdfe9a6",
      "name": "署名を計算",
      "type": "n8n-nodes-base.crypto",
      "typeVersion": 2,
      "position": [
        224,
        320
      ],
      "parameters": {
        "action": "hmac",
        "binaryData": true,
        "binaryPropertyName": "data",
        "type": "SHA256",
        "encoding": "base64",
        "dataPropertyName": "computedSignature"
      }
    },
    {
      "id": "2557200e-9d97-4148-96de-f48250f9ab1e",
      "name": "署名が一致？",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        448,
        320
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "leftValue": "={{ $json.computedSignature }}",
              "rightValue": "={{ $json.headers['x-line-signature'] }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      }
    },
    {
      "id": "1a01dd47-e47a-42e9-9691-a05594508aa0",
      "name": "イベントを1件ずつに",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        672,
        224
      ],
      "parameters": {
        "fieldToSplitOut": "body.events"
      }
    },
    {
      "id": "af10df07-4aa5-4b76-8874-86924bea5e67",
      "name": "同じイベントを捨てる",
      "type": "n8n-nodes-base.removeDuplicates",
      "typeVersion": 2,
      "position": [
        896,
        224
      ],
      "parameters": {
        "operation": "removeItemsSeenInPreviousExecutions",
        "logic": "removeItemsWithAlreadySeenKeyValues",
        "dedupeValue": "={{ $json.webhookEventId }}"
      }
    },
    {
      "id": "885a14cf-9b9a-4918-9112-1f9246e48163",
      "name": "問い合わせを整える",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1120,
        224
      ],
      "parameters": {
        "mode": "manual",
        "includeOtherFields": false,
        "assignments": {
          "assignments": [
            {
              "id": "u",
              "name": "userId",
              "value": "={{ $json.source.userId }}",
              "type": "string"
            },
            {
              "id": "r",
              "name": "replyToken",
              "value": "={{ $json.replyToken }}",
              "type": "string"
            },
            {
              "id": "t",
              "name": "messageType",
              "value": "={{ $json.type === 'message' ? $json.message.type : $json.type }}",
              "type": "string"
            },
            {
              "id": "m",
              "name": "messageId",
              "value": "={{ $json.message?.id ?? \"\" }}",
              "type": "string"
            },
            {
              "id": "x",
              "name": "text",
              "value": "={{ $json.message?.text ?? \"\" }}",
              "type": "string"
            }
          ]
        }
      }
    },
    {
      "id": "f006cbab-3e12-4178-9431-a09c489f26eb",
      "name": "テキストと画像だけ",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        1344,
        224
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "leftValue": "={{ $json.messageType }}",
              "rightValue": "text",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "leftValue": "={{ $json.messageType }}",
              "rightValue": "image",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "or"
        }
      }
    },
    {
      "id": "892e22fb-b89c-4cdf-ba9c-22f34d35bb90",
      "name": "受付の返事をする",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        1568,
        224
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/reply",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ replyToken: $json.replyToken, messages: [{ type: \"text\", text: \"お問い合わせありがとうございます。担当者が内容を確認して、このトークで改めてご返信いたします。\" }] }) }}"
      }
    },
    {
      "id": "41c2a04e-82e3-4b6b-a762-f988699c3c81",
      "name": "テキストか画像か",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        1792,
        224
      ],
      "parameters": {
        "mode": "rules",
        "rules": {
          "values": [
            {
              "outputKey": "text",
              "renameOutput": true,
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "leftValue": "={{ $(\"問い合わせを整える\").item.json.messageType }}",
                    "rightValue": "text",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "outputKey": "image",
              "renameOutput": true,
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "leftValue": "={{ $(\"問い合わせを整える\").item.json.messageType }}",
                    "rightValue": "image",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        }
      }
    },
    {
      "id": "599df852-75af-459a-8ee0-6a24fff98e40",
      "name": "テキストの問い合わせ",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        2592,
        0
      ],
      "parameters": {
        "mode": "manual",
        "includeOtherFields": false,
        "assignments": {
          "assignments": [
            {
              "id": "i",
              "name": "inquiry",
              "value": "={{ $(\"問い合わせを整える\").item.json.text }}",
              "type": "string"
            }
          ]
        }
      }
    },
    {
      "id": "34ca8b21-e5ef-4484-b495-4e43082c1abb",
      "name": "問い合わせ文",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        2816,
        224
      ],
      "parameters": {}
    },
    {
      "id": "520de3e9-e682-4fde-b472-e49f7ea8a7ad",
      "name": "画像を取得",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        2016,
        256
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api-data.line.me/v2/bot/message/{{ $(\"問い合わせを整える\").item.json.messageId }}/content",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "data"
            }
          }
        }
      }
    },
    {
      "id": "8d51ac36-3ccc-43fa-a511-bf36198df746",
      "name": "写真の内容を読む",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.9,
      "position": [
        2240,
        256
      ],
      "parameters": {
        "promptType": "define",
        "text": "この写真に写っている家具について、種類（ソファ、テーブル、チェア、照明、ラグ、収納 のどれか）、色、素材、大きさの印象を日本語で2〜3文で書いてください。家具が写っていなければ「家具は写っていません」とだけ書いてください。",
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "messageType": "imageBinary",
              "binaryImageDataKey": "data"
            }
          ]
        }
      }
    },
    {
      "id": "1eb01da3-5e49-473a-8587-513765321cb2",
      "name": "Claude Haiku 4.5",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.5,
      "position": [
        2320,
        480
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-haiku-4-5-20251001",
          "cachedResultName": "Claude Haiku 4.5"
        }
      }
    },
    {
      "id": "808fe097-429b-4213-8ce9-85138f5f1925",
      "name": "画像の問い合わせ",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        2592,
        256
      ],
      "parameters": {
        "mode": "manual",
        "includeOtherFields": false,
        "assignments": {
          "assignments": [
            {
              "id": "i",
              "name": "inquiry",
              "value": "=写真が送られてきました。写真の内容: {{ $json.text }}\nこの商品の在庫があるかを知りたいお問い合わせです。",
              "type": "string"
            }
          ]
        }
      }
    },
    {
      "id": "3fedac77-468b-447c-8920-f51d2e1f9cb2",
      "name": "署名が合わないので捨てる",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        672,
        416
      ],
      "parameters": {}
    },
    {
      "id": "cd2e7142-2a55-423d-a04a-6633c7a7dce5",
      "name": "用件を分類",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "typeVersion": 1.1,
      "position": [
        3040,
        224
      ],
      "parameters": {
        "inputText": "={{ $json.inquiry }}",
        "categories": {
          "categories": [
            {
              "category": "在庫の問い合わせ",
              "description": "商品の在庫、価格、サイズ、取り扱いの有無についての質問。写真の商品があるかの質問も含む"
            },
            {
              "category": "来店予約",
              "description": "店舗に来店する日時の相談や予約"
            }
          ]
        },
        "options": {
          "fallback": "other"
        }
      }
    },
    {
      "id": "b0efd643-3128-4443-84cb-e0df2e84c3ff",
      "name": "商品の種類を抽出",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "typeVersion": 1.2,
      "position": [
        3392,
        32
      ],
      "parameters": {
        "text": "={{ $(\"問い合わせ文\").item.json.inquiry }}",
        "schemaType": "fromAttributes",
        "attributes": {
          "attributes": [
            {
              "name": "category",
              "type": "string",
              "required": true,
              "description": "問い合わせの商品の種類。ソファ、テーブル、チェア、照明、ラグ、収納 のいずれか。当てはまらなければ その他"
            }
          ]
        }
      }
    },
    {
      "id": "5883634f-f3f5-4da3-a616-382bb334a6db",
      "name": "在庫を検索",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        3744,
        32
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "matchType": "allConditions",
        "filters": {
          "conditions": [
            {
              "keyName": "category",
              "condition": "eq",
              "keyValue": "={{ $json.output.category }}"
            }
          ]
        },
        "returnAll": true
      },
      "alwaysOutputData": true
    },
    {
      "id": "0108d41f-be01-4206-aaf2-14878bc8f984",
      "name": "検索結果をまとめる",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        3968,
        32
      ],
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "products"
      }
    },
    {
      "id": "270c3248-3433-4828-99cd-b10b63e70a90",
      "name": "在庫の返信案を作る",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.9,
      "position": [
        4192,
        32
      ],
      "parameters": {
        "promptType": "define",
        "text": "=お客様からのLINE:\n{{ $(\"問い合わせ文\").item.json.inquiry }}\n\n在庫（JSON）:\n{{ JSON.stringify($json.products) }}",
        "messages": {
          "messageValues": [
            {
              "type": "SystemMessagePromptTemplate",
              "message": "あなたは家具・インテリアの店のスタッフです。お客様のLINEへの返信を日本語で書いてください。在庫・価格・入荷予定は在庫の結果だけを根拠にし、結果に無い商品は「取り扱いがない」と伝えてください。在庫が0の商品は在庫切れと伝え、noteに入荷予定があれば添えてください。\n\n守ること:\n- 調べた結果に書かれていることだけを書く。配送、納期、割引、取り置きなど、結果に無いことは約束しない。分からないことは「担当者から改めてご連絡いたします」と書く\n- LINEのトークなので短く書く。宛名と署名は書かない\n- プレーンテキストで書く。** や # などの記号を使わない\n- 「データ」「SKU」「システム」などの社内の言葉と、商品コードを書かない\n- 「お問い合わせありがとうございます。」で始める\n\n本文だけを出力してください。"
            }
          ]
        }
      }
    },
    {
      "id": "ed4a0f98-5a8b-42d3-bd3f-ce412c883f39",
      "name": "返信案",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        4544,
        32
      ],
      "parameters": {}
    },
    {
      "id": "d437cb1a-a2f4-4f27-9235-b857c4b595fb",
      "name": "来店希望を抽出",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "typeVersion": 1.2,
      "position": [
        3392,
        224
      ],
      "parameters": {
        "text": "=今日は {{ $now.setZone('Asia/Tokyo').toFormat('yyyy-MM-dd') }}（{{ $now.setZone('Asia/Tokyo').setLocale('ja').toFormat('cccc') }}）です。\n\n{{ $(\"問い合わせ文\").item.json.inquiry }}",
        "schemaType": "fromAttributes",
        "attributes": {
          "attributes": [
            {
              "name": "desired_date",
              "type": "string",
              "required": true,
              "description": "来店を希望する日付。YYYY-MM-DD 形式"
            },
            {
              "name": "time_preference",
              "type": "string",
              "description": "希望の時間帯。HH:MM、午前、午後、指定なし のいずれか"
            }
          ]
        }
      }
    },
    {
      "id": "057d1ffe-4a84-40ed-a8fd-e62e0f6650fa",
      "name": "空き枠を検索",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        3744,
        224
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "matchType": "allConditions",
        "filters": {
          "conditions": [
            {
              "keyName": "slot_date",
              "condition": "eq",
              "keyValue": "={{ $json.output.desired_date }}"
            }
          ]
        },
        "returnAll": true
      },
      "alwaysOutputData": true
    },
    {
      "id": "4114655b-093f-43f4-a04e-709042dce8d3",
      "name": "枠をまとめる",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        3968,
        224
      ],
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "slots"
      }
    },
    {
      "id": "c574e499-8faa-48f4-b5a6-b03c772063a8",
      "name": "予約の返信案を作る",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.9,
      "position": [
        4192,
        224
      ],
      "parameters": {
        "promptType": "define",
        "text": "=お客様からのLINE:\n{{ $(\"問い合わせ文\").item.json.inquiry }}\n\n希望: {{ JSON.stringify($(\"来店希望を抽出\").item.json.output) }}\n\nその日の来店枠（JSON）:\n{{ JSON.stringify($json.slots) }}",
        "messages": {
          "messageValues": [
            {
              "type": "SystemMessagePromptTemplate",
              "message": "あなたは家具・インテリアの店のスタッフです。来店の相談への返信を日本語で書いてください。来店枠は与えられた結果だけを根拠にし、booked が capacity 未満の枠だけが空いています。枠が1件も無い日は来店を受け付けていません。空きがあれば候補の時間を案内し、ご希望の時間をこのトークで返信してもらえれば予約を確定すると伝えてください。このメッセージの時点では予約は確定していません。\n\n守ること:\n- 調べた結果に書かれていることだけを書く。配送、納期、割引、取り置きなど、結果に無いことは約束しない。分からないことは「担当者から改めてご連絡いたします」と書く\n- LINEのトークなので短く書く。宛名と署名は書かない\n- プレーンテキストで書く。** や # などの記号を使わない\n- 「データ」「SKU」「システム」などの社内の言葉と、商品コードを書かない\n- 「お問い合わせありがとうございます。」で始める\n\n本文だけを出力してください。"
            }
          ]
        }
      }
    },
    {
      "id": "f8e7db70-a599-4004-805d-b543ba8acc95",
      "name": "スタッフに知らせる",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        3456,
        416
      ],
      "parameters": {
        "resource": "message",
        "operation": "send",
        "sendTo": "staff@example.com",
        "subject": "[LINE] 要対応のお問い合わせ",
        "emailType": "text",
        "message": "=在庫・来店以外のお問い合わせがLINEに届きました。LINE Official Account Manager のチャットから対応してください。\n\n{{ $(\"問い合わせ文\").item.json.inquiry }}",
        "options": {
          "appendAttribution": false
        }
      },
      "webhookId": "808d3339-1fde-414f-b88a-b4c22355596e"
    },
    {
      "id": "fe9b32ec-048c-454d-984f-2a52869b71a5",
      "name": "スタッフに承認を頼む",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        4768,
        32
      ],
      "parameters": {
        "resource": "message",
        "operation": "sendAndWait",
        "sendTo": "staff@example.com",
        "subject": "[LINE] 返信案の承認",
        "message": "=お客様からのLINE:\n{{ $(\"問い合わせ文\").item.json.inquiry }}\n\n--- 返信案 ---\n{{ $json.text }}\n\n承認すると、この返信案がそのままお客様のLINEに送られます。",
        "responseType": "approval",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "approveLabel": "送る",
            "disapproveLabel": "送らない"
          }
        },
        "options": {
          "appendAttribution": false,
          "limitWaitTime": {
            "values": {
              "limitType": "afterTimeInterval",
              "resumeAmount": 24,
              "resumeUnit": "hours"
            }
          }
        }
      },
      "webhookId": "b1ccd3a8-ed82-4fd0-a98e-529c5057f5fd"
    },
    {
      "id": "11980509-2adc-48fa-a0f3-c25a1b6d32f9",
      "name": "お客様に送る",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        5216,
        32
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.line.me/v2/bot/message/push",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ to: $(\"問い合わせを整える\").item.json.userId, messages: [{ type: \"text\", text: $(\"返信案\").item.json.text }] }) }}"
      }
    },
    {
      "id": "66939273-fdbd-41f1-a9f1-ea9bb7c64a51",
      "name": "送らない",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        5216,
        224
      ],
      "parameters": {}
    },
    {
      "id": "2ccd8c1d-3508-48ed-a9bc-b0e71a6d90a5",
      "name": "承認の結果",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        4992,
        32
      ],
      "parameters": {
        "mode": "rules",
        "rules": {
          "values": [
            {
              "outputKey": "送る",
              "renameOutput": true,
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "leftValue": "={{ String($json.data?.approved) }}",
                    "rightValue": "true",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "outputKey": "送らない",
              "renameOutput": true,
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "leftValue": "={{ String($json.data?.approved) }}",
                    "rightValue": "false",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "期限切れ"
        }
      }
    },
    {
      "id": "3e0ca9b9-d877-48d4-9918-cea881ffa1dd",
      "name": "期限切れを知らせる",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        5216,
        416
      ],
      "parameters": {
        "resource": "message",
        "operation": "send",
        "sendTo": "staff@example.com",
        "subject": "[LINE] 承認されないまま期限が切れました",
        "emailType": "text",
        "message": "=返信案が承認されないまま期限が切れたので、お客様には受付の返事しか届いていません。LINE Official Account Manager のチャットから対応してください。\n\nお客様からのLINE:\n{{ $(\"問い合わせ文\").item.json.inquiry }}\n\n--- 送られなかった返信案 ---\n{{ $(\"返信案\").item.json.text }}",
        "options": {
          "appendAttribution": false
        }
      },
      "webhookId": "57223a1b-d945-433f-b3cc-e8288ba8e075"
    },
    {
      "id": "834af5ea-1d3e-48bb-85f3-1b225eb3398a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -480,
        0
      ],
      "parameters": {
        "color": 4,
        "width": 420,
        "height": 640,
        "content": "## 取り込んだら最初にやること\n1. 認証情報を作り、各ノードで選ぶ\n   - **Header Auth**：Name `Authorization`、Value `Bearer ` ＋ チャネルアクセストークン（受付の返事をする・画像を取得・お客様に送る）\n   - **Crypto**：Secret にチャネルシークレット（署名を計算）\n   - **Anthropic**（Claude Haiku 4.5）と **Gmail**（3つのGmailノード）\n2. Data Table を2つ作り（shop_products と shop_visit_slots。列は配布ページを参照）、「在庫を検索」「空き枠を検索」で選ぶ\n3. Gmailノード3つの宛先 staff@example.com を、スタッフのアドレスに書き換える\n4. Publish し、Webhook の Production URL を LINE Developers の Webhook URL に入れる（外から https で届く必要があります）\n5. LINE Official Account Manager の応答設定で、Webhook をオン、応答メッセージをオフにする\n6. 承認ボタンをスマホから押すなら、n8n の WEBHOOK_URL を外から開けるURLにする（既定は localhost を向きます）\n\n**お客様に返信案が届くのは、スタッフがメールで「送る」を押したときだけです。** 受付の返事だけは自動で即時に送ります。承認待ちは24時間で切れ、切れたらスタッフにメールが届きます。"
      }
    }
  ],
  "connections": {
    "LINEから受信": {
      "main": [
        [
          {
            "node": "署名を計算",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "署名を計算": {
      "main": [
        [
          {
            "node": "署名が一致？",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "署名が一致？": {
      "main": [
        [
          {
            "node": "イベントを1件ずつに",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "署名が合わないので捨てる",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "イベントを1件ずつに": {
      "main": [
        [
          {
            "node": "同じイベントを捨てる",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "同じイベントを捨てる": {
      "main": [
        [
          {
            "node": "問い合わせを整える",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "問い合わせを整える": {
      "main": [
        [
          {
            "node": "テキストと画像だけ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "テキストと画像だけ": {
      "main": [
        [
          {
            "node": "受付の返事をする",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "受付の返事をする": {
      "main": [
        [
          {
            "node": "テキストか画像か",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "テキストか画像か": {
      "main": [
        [
          {
            "node": "テキストの問い合わせ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "画像を取得",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "テキストの問い合わせ": {
      "main": [
        [
          {
            "node": "問い合わせ文",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "問い合わせ文": {
      "main": [
        [
          {
            "node": "用件を分類",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "画像を取得": {
      "main": [
        [
          {
            "node": "写真の内容を読む",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "写真の内容を読む": {
      "main": [
        [
          {
            "node": "画像の問い合わせ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Claude Haiku 4.5": {
      "ai_languageModel": [
        [
          {
            "node": "写真の内容を読む",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "用件を分類",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "商品の種類を抽出",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "在庫の返信案を作る",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "来店希望を抽出",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "予約の返信案を作る",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "画像の問い合わせ": {
      "main": [
        [
          {
            "node": "問い合わせ文",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "用件を分類": {
      "main": [
        [
          {
            "node": "商品の種類を抽出",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "来店希望を抽出",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "スタッフに知らせる",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "商品の種類を抽出": {
      "main": [
        [
          {
            "node": "在庫を検索",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "在庫を検索": {
      "main": [
        [
          {
            "node": "検索結果をまとめる",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "検索結果をまとめる": {
      "main": [
        [
          {
            "node": "在庫の返信案を作る",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "在庫の返信案を作る": {
      "main": [
        [
          {
            "node": "返信案",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "返信案": {
      "main": [
        [
          {
            "node": "スタッフに承認を頼む",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "来店希望を抽出": {
      "main": [
        [
          {
            "node": "空き枠を検索",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "空き枠を検索": {
      "main": [
        [
          {
            "node": "枠をまとめる",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "枠をまとめる": {
      "main": [
        [
          {
            "node": "予約の返信案を作る",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "予約の返信案を作る": {
      "main": [
        [
          {
            "node": "返信案",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "スタッフに承認を頼む": {
      "main": [
        [
          {
            "node": "承認の結果",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "承認の結果": {
      "main": [
        [
          {
            "node": "お客様に送る",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "送らない",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "期限切れを知らせる",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Asia/Tokyo"
  },
  "pinData": {}
}
