Intercom対話コメント

上級

これはTicket Management, AI Summarization分野の自動化ワークフローで、22個のノードを含みます。主にIf, Code, Merge, Webhook, SplitOutなどのノードを使用。 Intercom、GPT、Google Sheetsを使用したサポート品質評価の自動化

前提条件
  • HTTP Webhookエンドポイント(n8nが自動生成)
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Sheets API認証情報
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "U8L7ojJGYnPXUZZm",
  "meta": {
    "instanceId": "5f48daf3a0baf541941ac99dac87a58469ec38ada0698ec3f47e71ef7e50b0ff",
    "templateCredsSetupCompleted": true
  },
  "name": "Intercom Conversation Reviews",
  "tags": [],
  "nodes": [
    {
      "id": "3a663159-b082-440d-b15f-81a4f246e8c2",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        720,
        420
      ],
      "webhookId": "a716761a-b062-4f93-9734-04fdc83e9a9a",
      "parameters": {
        "path": "a716761a-b062-4f93-9734-04fdc83e9a9a",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "82fb7f3c-137f-4d28-8764-4b71ecca18d4",
      "name": "HTTPリクエスト",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        940,
        420
      ],
      "parameters": {
        "url": "=https://api.intercom.io/conversations/{{ $json.body.data.item.id }}?display_as=plaintext' ",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "intercomApi"
      },
      "credentials": {
        "intercomApi": {
          "id": "Tx85thcOrnYamj7m",
          "name": "Intercom account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "42d3660f-ef89-4b05-92b7-8efbe1d5a9d4",
      "name": "AIエージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2480,
        120
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "I manage a customer support team based in India. I want to evaluate how our agents handle live chat conversations. \n\nThe goal is to improve response speed, clarity, urgency handling, tone, ownership, and problem resolution.\n\nYou are to act like a human QA reviewer — not an AI. \n\nProvide straight, coaching-style feedback in simple, easy-to-understand language that agents can learn and act on.\n\nConversation mostly have involvement of AI replies in the name of \"Alisha ( AI Bot ) from Saleshandy\" initially and then if not solved real human team member participate. \n\n🧠 Tone Reminder\nUse a friendly, coaching tone — never sound like a complaint. The goal is to help the agent grow, not to shame them.\n\n🔧 GPT Feedback Instructions\n\n✅ Be factual, crisp, and direct\n\n✅ Avoid technical or fancy words\n\n✅ Use exact sentences from the chat to highlight mistakes\n\n✅ Suggest a clear and improved reply\n\n✅ Explain the impact and what the agent should do instead\n\n✅ Use the agent’s first name (from the transcript) — never say “agent” or mention AI\n\n✅ Adjust tone and expectations if the customer was angry, confused, or seemed in a hurry\n\n✅ Our support hours are from 10:00 AM to 2:30 AM IST\n\n✅ If team member has not participated in the conversation, mention the rating is for AI bot i.e Alisa. \n\n✅ Ensure the feedback is easy to read:\n- Use proper line breaks and spacing\n- Keep sentences short and clear (ideally under 20 words)\n- Use bullets or emojis where helpful\n- Avoid large blocks of text\n\n\nFedback formate\n\nResponse Time: (Fast / Okay / Slow)\n\nWas the reply quick or delayed? Include the customer's wait time if available.\n\nClarity of Answers: (Clear / Confusing / Incomplete)\n\nWas the explanation simple and understandable?\n\nTone & Behavior: (Polite / Robotic / Rude)\n\nDid the agent sound human, helpful, and respectful?\n\nUrgency Handling: (Handled Well / Ignored / Unaware)\n\nDid the agent notice urgency and respond accordingly?\n\nOwnership & Accountability: (Strong / Weak / Avoiding)\n\nDid the agent take responsibility or deflect the issue?\n\nDid They Solve the Problem? (Yes / Partially / No)\n\nWas the issue resolved or clearly guided?\n\nGive conversation start date & end date in seperate lines (follow yyyy-mm-dd formate)\n\nOverall Score: (1 to 5)\n\nScoring Guide\n5 – Excellent (All aspects handled well with ownership)\n4 – Good (Minor gaps, customer likely satisfied)\n3 – Average (Some confusion, but no major damage)\n2 – Poor (Multiple issues, customer likely frustrated)\n1 – Unacceptable (Neglected, robotic, or disrespectful)\n\n\nOutput Format Requirements:\n\n⚠️ Return output as a pure JSON array, no extra keys, no string wrapping, no markdown, no triple backticks.\n\nDo NOT wrap the JSON in any extra string or code block.\n\n🔁 Only return the array.\n✅ No markdown formatting\n✅ No output: key\n✅ No escaping of quotes\n✅ No explanation\n✅ No wrapping in a string\n\nSample below:\n\n[\n    {\n        \"Response Time\": \"Fast\",\n        \"Clarity of Answers\": \"Confusing\",\n        \"Tone & Behavior\": \"Polite\",\n        \"Urgency Handling\": \"Ignored\",\n        \"Ownership & Accountability\": \"Weak\",\n        \"Did They Solve the Problem?\": \"No\",\n        \"Start Date\": \"2025-07-07\",\n        \"End Date\": \"2025-07-07\",\n        \"Overall Score\": 2\n    }\n]"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "b71a3cfd-e33a-4bbe-8e14-d6b25aed76aa",
      "name": "OpenAIチャットモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2568,
        340
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "CAQP7fWZtZcilByu",
          "name": "Dhruv's OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0dec2602-4e2d-43d4-b494-094f9a3c5e29",
      "name": "分割",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1380,
        570
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "conversation_parts"
      },
      "typeVersion": 1
    },
    {
      "id": "b5a0fd7a-c73c-44b6-bbda-86daf62dc1aa",
      "name": "コード",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        570
      ],
      "parameters": {
        "jsCode": "// Start from items[1], since items[0] only has metadata\nconst conversationParts = items[1].json;\n\nconst output = [];\n\nfor (const key in conversationParts) {\n  const part = conversationParts[key];\n\n  if (part && part.part_type === 'comment') {\n    output.push({\n      json: part,\n      pairedItem: {\n        item: 1, // link to items[1], where the data came from\n      },\n    });\n  }\n}\n\nreturn output;\n"
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "0ba2ff75-4ee6-4db8-8aef-8d7bbfc56ccd",
      "name": "分割1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1820,
        570
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "body, created_at, author.type, author.name, author.email"
      },
      "typeVersion": 1
    },
    {
      "id": "963b2239-32af-4cb0-a130-e3b067b6fe7e",
      "name": "コード1",
      "type": "n8n-nodes-base.code",
      "position": [
        2040,
        570
      ],
      "parameters": {
        "jsCode": "function formatTimestamp(unixTime) {\n  const date = new Date(unixTime * 1000);\n  return date.toISOString().replace('T', ' ').split('.')[0]; // \"YYYY-MM-DD HH:mm:ss\"\n}\n\nlet combinedText = items.map(item => {\n  const body = item.json.body || '';\n  const author = item.json[\"author.name\"] || 'Unknown';\n  const role = item.json[\"author.type\"] || 'unknown';\n  const timestamp = item.json.created_at ? formatTimestamp(item.json.created_at) : 'Unknown time';\n\n  const cleanBody = body.replace(/<[^>]*>/g, '').trim();\n\n  let speaker = 'Unknown';\n  if (role === 'user') {\n    speaker = 'User';\n  } else if (role === 'bot') {\n    speaker = 'Bot';\n  } else if (role === 'admin') {\n    speaker = 'Admin';\n  }\n\n  return `[${timestamp}] ${speaker} (${author}): ${cleanBody}`;\n}).join('\\n\\n');\n\nreturn [\n  {\n    json: {\n      conversation: combinedText\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e51d2ee7-fd29-4535-88be-94bbaf5083dd",
      "name": "コード2",
      "type": "n8n-nodes-base.code",
      "position": [
        2856,
        220
      ],
      "parameters": {
        "jsCode": "const raw = $json[\"output\"];\nreturn JSON.parse(raw);\n"
      },
      "typeVersion": 2
    },
    {
      "id": "d15b437b-e2a3-4fcc-a167-7bcc1c1ac8ff",
      "name": "分割2",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1820,
        170
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "source.body, source.delivered_as, source.author.name, source.author.email, "
      },
      "typeVersion": 1
    },
    {
      "id": "a4d0c944-d7d3-4fa2-8549-24e0895f9ecd",
      "name": "コード3",
      "type": "n8n-nodes-base.code",
      "position": [
        2040,
        170
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n  const data = item.json;\n\n  // Remove HTML tags from body if needed\n  const plainBody = data[\"source.body\"]\n    ? data[\"source.body\"].replace(/<[^>]*>/g, '').trim()\n    : '';\n\n  const name = data[\"source.author.name\"] || 'Unknown';\n  const email = data[\"source.author.email\"] || 'unknown@example.com';\n\n  return {\n    json: {\n      conversationinitiatied: `${name} (${email}): ${plainBody}`\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f8e6b7dc-9a3d-4ffa-ace0-dc2da6dd5534",
      "name": "マージ",
      "type": "n8n-nodes-base.merge",
      "position": [
        2260,
        220
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "9afa1edb-2693-4705-b1af-ac5b56beea2c",
      "name": "AIエージェント1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2480,
        620
      ],
      "parameters": {
        "text": "={{ $json.conversation }}",
        "options": {
          "systemMessage": "Analyze the following conversation transcript.\n\nYour tasks:\n\nCount the number of messages sent by each role: Bot, User, and Admin.\n\nIdentify who was the last admin person to send a message (include their name, avoid considering bot or user for the last messsage).\n\n✅ Output the result in the following JSON format:\n\njson\n{\n  {\n    \"Bot\": 10,\n    \"User\": 8,\n    \"Admin\": 5\n  \"last_message_by\":\n    \"name\": \"Kinjal\",\n}\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "e41e5ed9-069b-4a6b-b0d1-e07a628b4be8",
      "name": "OpenAIチャットモデル1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2568,
        840
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "W1K5DlnXfMcbyFKe",
          "name": "Raj Bheda's OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7e77f48d-2201-4e87-9426-9e9f0a84460d",
      "name": "マージ1",
      "type": "n8n-nodes-base.merge",
      "position": [
        3076,
        420
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "d1390d6c-d5f7-4789-8751-89bfdf2c11d7",
      "name": "コード5",
      "type": "n8n-nodes-base.code",
      "position": [
        2856,
        620
      ],
      "parameters": {
        "jsCode": "let raw = $json[\"output\"];\n\n// Remove Markdown-style code block if present\nraw = raw.replace(/^```json\\n/, '').replace(/\\n```$/, '');\n\nreturn JSON.parse(raw);\n"
      },
      "typeVersion": 2
    },
    {
      "id": "69277b71-7eb0-444d-9b9b-0f4bc3795811",
      "name": "シートに行を追加",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3296,
        320
      ],
      "parameters": {
        "columns": {
          "value": {
            "Tone": "={{ $json[\"Tone & Behavior\"] }}",
            "Solved": "={{ $json[\"Did They Solve the Problem?\"] }}",
            "Clarity": "={{ $json[\"Clarity of Answers\"] }}",
            "Urgency": "={{ $json[\"Urgency Handling\"] }}",
            "Ownership": "={{ $json[\"Ownership & Accountability\"] }}",
            "#Bot Replies ": "={{ $json.Bot }}",
            "Overall Score": "={{ $json[\"Overall Score\"] }}",
            "Response time": "={{ $json[\"Response Time\"] }}",
            "Conversation ID": "={{ $item(0).$node[\"HTTP Request\"].json[\"id\"] }}",
            "Last Message by": "={{ $json.last_message_by.name }}",
            "Our Replies count": "={{ $json.Admin }}",
            "#User Replies Count": "={{ $json.User }}",
            "Conversation end date": "={{ $json[\"End Date\"] }}",
            "Conversation Start Date": "={{ $json[\"Start Date\"] }}"
          },
          "schema": [
            {
              "id": "Conversation end date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Conversation end date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Conversation Start Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Conversation Start Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Conversation ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Conversation ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Intercom URL",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Intercom URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Response time",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Response time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Clarity",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Clarity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Tone",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Tone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Urgency",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Urgency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Ownership",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Ownership",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Solved",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Solved",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Overall Score",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Overall Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time to close (Days)",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Time to close (Days)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "#Bot Replies ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "#Bot Replies ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "#User Replies Count",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "#User Replies Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Our Replies count",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Our Replies count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Message by",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Last Message by",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Conversation Start Date"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1593039064,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1f9VmrRKolmn3PKIyLWy0yVSiTlQ1QbCAz-8E93XzTJM/edit#gid=1593039064",
          "cachedResultName": "AI.Coach"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1f9VmrRKolmn3PKIyLWy0yVSiTlQ1QbCAz-8E93XzTJM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1f9VmrRKolmn3PKIyLWy0yVSiTlQ1QbCAz-8E93XzTJM/edit?usp=drivesdk",
          "cachedResultName": "Daily Input Update (DIU) - Customer Support"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WqAbIK1oyEv92RRM",
          "name": "Dhruv's Google Sheets"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "cc12f47b-8421-44da-887d-d096635a8be4",
      "name": "条件分岐",
      "type": "n8n-nodes-base.if",
      "position": [
        1160,
        420
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "b7f80639-c3cd-49ae-acbb-0f54d399844a",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.custom_attributes.Type }}",
              "rightValue": "Spam/Promotional"
            },
            {
              "id": "344ac3eb-6308-4973-882b-274cee353dac",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.custom_attributes.Type }}",
              "rightValue": "Other"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a86ada21-36c9-46cd-81d4-b3c038311f34",
      "name": "条件分岐1",
      "type": "n8n-nodes-base.if",
      "position": [
        3296,
        520
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "ef9a24d9-2cc2-4199-b9e4-2d8d85771b4f",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json['Overall Score'] }}",
              "rightValue": 3
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "86e0be5c-4328-4468-a567-7ba66039ae5a",
      "name": "AIエージェント2",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3516,
        520
      ],
      "parameters": {
        "text": "={{ $('Merge').item.json.conversationinitiatied }}{{ $('Merge').item.json.conversation }}",
        "options": {
          "systemMessage": "I manage a customer support team based in India. I want to evaluate how our agents handle live chat conversations. \n\nThe goal is to improve response speed, clarity, urgency handling, tone, ownership, and problem resolution.\n\nYou are to act like a human QA reviewer — not an AI. \n\nProvide straight, coaching-style feedback in simple, easy-to-understand language that agents can learn and act on.\n\nConversation mostly have involvement of AI replies in the name of \"Alisha ( AI Bot ) from Saleshandy\" initially and then if not solved real human team member participate. \n\n🧠 Tone Reminder\nUse a friendly, coaching tone — never sound like a complaint. The goal is to help the agent grow, not to shame them.\n\n🔧 GPT Feedback Instructions\n\n✅ Be factual, crisp, and direct\n\n✅ Avoid technical or fancy words\n\n✅ Use exact sentences from the chat to highlight mistakes\n\n✅ Suggest a clear and improved reply\n\n✅ Explain the impact and what the agent should do instead\n\n✅ Use the agent’s first name (from the transcript) — never say “agent” or mention AI\n\n✅ Adjust tone and expectations if the customer was angry, confused, or seemed in a hurry\n\n✅ Our support hours are from 10:00 AM to 2:30 AM IST\n\n✅ If team member has not participated in the conversation, mention the rating is for AI bot i.e Alisa. \n\n✅ Ensure the feedback is easy to read:\n- Use proper line breaks and spacing\n- Keep sentences short and clear (ideally under 20 words)\n- Use bullets or emojis where helpful\n- Avoid large blocks of text\n\n\n📣 Feedback for Team member \n\nWhat you did well\n\nMention 1–2 positive points (e.g., polite tone, clear guidance, fast reply)\n\nWhere you messed up\n❌ Quote the exact problematic sentence\n✅ Show a better version\n➕ Explain the impact and the expected behavior\n\nWhat the customer likely felt\n\nExplain in simple, emotional terms (e.g., “The customer probably felt ignored…”)\n\nHow to fix it next time\n\nGive practical advice the agent can follow in future chats\n\n🔄 Example Feedback\n❌ You said: “We will check and revert in 1 hour” — but the customer had already waited 12 hours.\n\nThis reply added no value and made the customer feel ignored.\n\n✅ Instead: “Apologies for the delay. I’ve checked internally — we need another hour and will update you by 4 PM IST today.”\n→ This shows urgency, ownership, and clear commitment.\n\n❌ You wrote: “We regret the inconvenience caused” without offering a solution.\n✅ Don’t paste sympathy lines. Understand the issue and respond with a real fix.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "3970a104-1a7a-4df2-b6ab-7e4a4e1a5b87",
      "name": "OpenAIチャットモデル2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3604,
        740
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "W1K5DlnXfMcbyFKe",
          "name": "Raj Bheda's OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ec53d175-543b-4e49-a894-07e34d97b33d",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 620,
        "height": 2460,
        "content": "\n# 🧠 Intercom Conversation QA Review Automation – n8n Workflow\n\n## ✅ Objective\n\nAutomate the QA review of Intercom support conversations using AI to:\n\n* Evaluate agent performance\n* Log structured feedback\n* Provide coaching where needed\n* Track trends in customer interactions\n\n---\n\n## 🧩 Workflow Overview\n\n### 1. **Webhook Trigger**\n\n* Listens for `conversation.admin.closed` events from Intercom.\n* Initiates the workflow whenever a conversation is closed.\n\n### 2. **Fetch Conversation Details**\n\n* Uses Intercom API to retrieve the full conversation using `conversation ID`.\n\n### 3. **Filter Irrelevant Conversations**\n\n* Skips conversations marked as “Spam/Promotional” or “Other” via `custom_attributes`.\n\n### 4. **Structure the Conversation**\n\n* Extracts:\n\n  * Message body\n  * Role (User, Bot, Admin)\n  * Author name\n  * Timestamps\n* Formats messages into a readable transcript.\n\n### 5. **AI-Powered Evaluation (Parallel Branches)**\n\n#### A. 🧪 **Performance Scoring (GPT-4o)**\n\nEvaluates the following attributes:\n\n* **Response Time**\n* **Clarity of Answers**\n* **Tone & Behavior**\n* **Urgency Handling**\n* **Ownership & Accountability**\n* **Problem Solving**\n* Outputs:\n\n  * `Start Date`, `End Date`\n  * `Overall Score` (1 to 5)\n  * Attribute-wise scores\n\n#### B. 🔍 **Message Analytics**\n\n* Counts the number of messages from:\n\n  * Bot\n  * User\n  * Admin\n* Identifies the **last admin responder's name**\n\n### 6. **Merge & Log**\n\n* Combines scoring and metadata\n* Appends the data to a Google Sheet:\n\n  * **Sheet:** `Daily Input Update`\n  * **Tab:** `AI.Coach`\n\n### 7. **Optional: Coaching Feedback Generator (Score ≤ 3)**\n\n* Triggered if the score is 3 or below\n* Generates coaching feedback in this format:\n\n  * ✅ What went well\n  * ❌ What needs fixing (with quote + suggestion)\n  * 😕 How the customer likely felt\n  * 🔄 What to do differently next time\n\n---\n\n## 📈 Example Output\n\n| Conversation ID | Response Time | Clarity | Tone   | Ownership | Overall Score | Last Message By |\n| --------------- | ------------- | ------- | ------ | --------- | ------------- | --------------- |\n| 215469787223351 | Fast          | Clear   | Polite | Strong    | 5             | Kinjal          |\n\n---\n\n## 💡 Why It Matters\n\n* Automates repetitive QA work at scale\n* Transforms unstructured conversations into actionable insights\n* Boosts support quality, ownership, and customer satisfaction\n* Offers personalized, high-signal feedback for team coaching\n\n---"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {
    "Webhook": [
      {
        "json": {
          "body": {
            "id": "notif_45059361-22bc-41bf-a30b-8d7e16fa7ba6",
            "data": {
              "item": {
                "id": "215469787223351",
                "open": false,
                "read": true,
                "tags": {
                  "tags": [],
                  "type": "tag.list"
                },
                "type": "conversation",
                "state": "closed",
                "title": "",
                "source": {
                  "id": "2998323371",
                  "url": "https://my.saleshandy.com/email-accounts?page=1&order=-1&sortByKey=health-score&search=&clientIds=&tagIds=&sequenceIds=&status=&owners=&emailServiceProvider=",
                  "body": "<p>Hi, I created an Email Account to send Sequences from but it's not showing up in the Sequence. How do I connect it?</p>",
                  "type": "conversation",
                  "author": {
                    "id": "68683be69ec0b4a6c181239f",
                    "name": "Kelsey Kachuk",
                    "type": "user",
                    "email": "hello@kelseykachuk.com"
                  },
                  "subject": "",
                  "redacted": false,
                  "attachments": [],
                  "delivered_as": "customer_initiated"
                },
                "ticket": null,
                "topics": {
                  "type": "topic.list",
                  "topics": [],
                  "total_count": 0
                },
                "ai_agent": {
                  "rating": null,
                  "source_type": "profile",
                  "source_title": "Parent",
                  "rating_remark": null,
                  "content_sources": {
                    "type": "content_source.list",
                    "total_count": 4,
                    "content_sources": [
                      {
                        "url": "/fin-ai-agent/content?content=article&id=7008446",
                        "title": "Sender Rotation: What, Why, and How to Set it Up?",
                        "locale": "en",
                        "content_type": "article"
                      },
                      {
                        "url": "/fin-ai-agent/content?content=article&id=8658807",
                        "title": "Getting Started With Saleshandy - Sequence/Campaign Setup",
                        "locale": "en",
                        "content_type": "article"
                      },
                      {
                        "url": "/fin-ai-agent/content?content=article&id=11088323",
                        "title": "How to Run Multichannel Sequences in Saleshandy",
                        "locale": "en",
                        "content_type": "article"
                      },
                      {
                        "url": "/fin-ai-agent/content?content=content_snippet&id=191588",
                        "title": "How do I add my email to a sequence if it doesn...",
                        "locale": "en",
                        "content_type": "content_snippet"
                      }
                    ]
                  },
                  "last_answer_type": "ai_answer",
                  "resolution_state": "confirmed_resolution"
                },
                "contacts": {
                  "type": "contact.list",
                  "contacts": [
                    {
                      "id": "68683be69ec0b4a6c181239f",
                      "type": "contact",
                      "external_id": "R93hzPfQds"
                    }
                  ]
                },
                "priority": "priority",
                "teammates": {
                  "type": "admin.list",
                  "admins": []
                },
                "created_at": 1752070504,
                "statistics": {
                  "type": "conversation_statistics",
                  "count_reopens": 0,
                  "handling_time": 0,
                  "last_close_at": "2025-07-09T14:16:28.000Z",
                  "first_close_at": "2025-07-09T14:16:28.000Z",
                  "count_assignments": 1,
                  "last_closed_by_id": 6371485,
                  "last_assignment_at": "2025-07-09T14:15:04.000Z",
                  "time_to_assignment": 0,
                  "time_to_last_close": 84,
                  "first_assignment_at": "2025-07-09T14:15:04.000Z",
                  "last_admin_reply_at": null,
                  "time_to_admin_reply": null,
                  "time_to_first_close": 84,
                  "first_admin_reply_at": null,
                  "median_time_to_reply": null,
                  "last_contact_reply_at": "2025-07-09T14:16:24.000Z",
                  "first_contact_reply_at": "2025-07-09T14:15:04.000Z",
                  "count_conversation_parts": 13,
                  "last_assignment_admin_reply_at": null,
                  "assigned_team_first_response_time": [],
                  "assigned_team_first_response_time_in_office_hours": []
                },
                "updated_at": 1752070588,
                "sla_applied": null,
                "snoozed_until": null,
                "waiting_since": 1752070504,
                "linked_objects": {
                  "data": [],
                  "type": "list",
                  "has_more": false,
                  "total_count": 0
                },
                "team_assignee_id": null,
                "admin_assignee_id": 6371485,
                "custom_attributes": {
                  "Language": "English",
                  "Copilot used": false,
                  "Auto-translated": false,
                  "Has attachments": false,
                  "AI Answer Length": "Concise",
                  "AI Tone of Voice": "Friendly",
                  "AI Pronoun Formality": "Let Fin decide",
                  "Conversation Priority": "Highest",
                  "Fin AI Agent: Preview": false,
                  "Fin AI Agent resolution state": "Confirmed Resolution"
                },
                "conversation_parts": {
                  "type": "conversation_part.list",
                  "total_count": 1,
                  "conversation_parts": [
                    {
                      "id": "26221461489",
                      "body": null,
                      "tags": [],
                      "type": "conversation_part",
                      "state": "closed",
                      "author": {
                        "id": "6371485",
                        "name": "Alisha (AI Bot)",
                        "type": "bot",
                        "email": "operator+g27xawt4@intercom.io"
                      },
                      "metadata": {},
                      "redacted": false,
                      "part_type": "close",
                      "created_at": 1752070588,
                      "updated_at": 1752070588,
                      "assigned_to": null,
                      "attachments": [],
                      "external_id": null,
                      "notified_at": 1752070588,
                      "event_details": {},
                      "app_package_code": null,
                      "email_message_metadata": null
                    }
                  ]
                },
                "conversation_rating": null,
                "first_contact_reply": {
                  "url": "https://my.saleshandy.com/email-accounts?page=1&order=-1&sortByKey=health-score&search=&clientIds=&tagIds=&sequenceIds=&status=&owners=&emailServiceProvider=",
                  "type": "conversation",
                  "created_at": 1752070504
                },
                "ai_agent_participated": true
              },
              "type": "notification_event_data"
            },
            "self": null,
            "type": "notification_event",
            "links": {},
            "topic": "conversation.admin.closed",
            "app_id": "g27xawt4",
            "created_at": 1752070590,
            "delivered_at": 0,
            "first_sent_at": 1752070591,
            "delivery_status": "pending",
            "delivery_attempts": 1
          },
          "query": {},
          "params": {},
          "headers": {
            "date": "Wed, 09 Jul 2025 14:16:31 GMT",
            "host": "cygnus.saleshandy.com",
            "accept": "application/json",
            "cf-ray": "95c8708ccf1a2d15-IAD",
            "cdn-loop": "cloudflare; loops=1",
            "cf-visitor": "{\"scheme\":\"https\"}",
            "user-agent": "Intercom/Parrot 1.3",
            "cf-ipcountry": "US",
            "content-type": "application/json",
            "content-length": "4350",
            "accept-encoding": "gzip, br",
            "x-amzn-trace-id": "Root=1-686e79bf-58c9924b30bd58ee44441bbc",
            "x-forwarded-for": "35.171.78.91, 172.71.223.148",
            "x-hub-signature": "sha1=de547f642efa133f34b1b44aba1a045a440e71fe",
            "cf-connecting-ip": "35.171.78.91",
            "intercom-version": "2.13",
            "x-forwarded-port": "443",
            "x-forwarded-proto": "https",
            "x-datadog-trace-id": "246277491046908309",
            "x-datadog-parent-id": "4152388321528558178",
            "x-datadog-sampling-priority": "1",
            "intercom-webhook-subscription-id": "nsub_wd_44657dbe-c0a4-4f1d-a4f1-92b9c1a7bf93_g27xawt4"
          },
          "webhookUrl": "https://cygnus.saleshandy.com/webhook/a716761a-b062-4f93-9734-04fdc83e9a9a",
          "executionMode": "production"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5125f964-44cf-4fae-80b8-1cc7cafa056b",
  "connections": {
    "cc12f47b-8421-44da-887d-d096635a8be4": {
      "main": [
        [],
        [
          {
            "node": "d15b437b-e2a3-4fcc-a167-7bcc1c1ac8ff",
            "type": "main",
            "index": 0
          },
          {
            "node": "0dec2602-4e2d-43d4-b494-094f9a3c5e29",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a86ada21-36c9-46cd-81d4-b3c038311f34": {
      "main": [
        [
          {
            "node": "86e0be5c-4328-4468-a567-7ba66039ae5a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b5a0fd7a-c73c-44b6-bbda-86daf62dc1aa": {
      "main": [
        [
          {
            "node": "0ba2ff75-4ee6-4db8-8aef-8d7bbfc56ccd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "963b2239-32af-4cb0-a130-e3b067b6fe7e": {
      "main": [
        [
          {
            "node": "f8e6b7dc-9a3d-4ffa-ace0-dc2da6dd5534",
            "type": "main",
            "index": 1
          },
          {
            "node": "9afa1edb-2693-4705-b1af-ac5b56beea2c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e51d2ee7-fd29-4535-88be-94bbaf5083dd": {
      "main": [
        [
          {
            "node": "7e77f48d-2201-4e87-9426-9e9f0a84460d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a4d0c944-d7d3-4fa2-8549-24e0895f9ecd": {
      "main": [
        [
          {
            "node": "f8e6b7dc-9a3d-4ffa-ace0-dc2da6dd5534",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d1390d6c-d5f7-4789-8751-89bfdf2c11d7": {
      "main": [
        [
          {
            "node": "7e77f48d-2201-4e87-9426-9e9f0a84460d",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "f8e6b7dc-9a3d-4ffa-ace0-dc2da6dd5534": {
      "main": [
        [
          {
            "node": "42d3660f-ef89-4b05-92b7-8efbe1d5a9d4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7e77f48d-2201-4e87-9426-9e9f0a84460d": {
      "main": [
        [
          {
            "node": "69277b71-7eb0-444d-9b9b-0f4bc3795811",
            "type": "main",
            "index": 0
          },
          {
            "node": "a86ada21-36c9-46cd-81d4-b3c038311f34",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3a663159-b082-440d-b15f-81a4f246e8c2": {
      "main": [
        [
          {
            "node": "82fb7f3c-137f-4d28-8764-4b71ecca18d4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "42d3660f-ef89-4b05-92b7-8efbe1d5a9d4": {
      "main": [
        [
          {
            "node": "e51d2ee7-fd29-4535-88be-94bbaf5083dd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9afa1edb-2693-4705-b1af-ac5b56beea2c": {
      "main": [
        [
          {
            "node": "d1390d6c-d5f7-4789-8751-89bfdf2c11d7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0dec2602-4e2d-43d4-b494-094f9a3c5e29": {
      "main": [
        [
          {
            "node": "b5a0fd7a-c73c-44b6-bbda-86daf62dc1aa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0ba2ff75-4ee6-4db8-8aef-8d7bbfc56ccd": {
      "main": [
        [
          {
            "node": "963b2239-32af-4cb0-a130-e3b067b6fe7e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d15b437b-e2a3-4fcc-a167-7bcc1c1ac8ff": {
      "main": [
        [
          {
            "node": "a4d0c944-d7d3-4fa2-8549-24e0895f9ecd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "82fb7f3c-137f-4d28-8764-4b71ecca18d4": {
      "main": [
        [
          {
            "node": "cc12f47b-8421-44da-887d-d096635a8be4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b71a3cfd-e33a-4bbe-8e14-d6b25aed76aa": {
      "ai_languageModel": [
        [
          {
            "node": "42d3660f-ef89-4b05-92b7-8efbe1d5a9d4",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "e41e5ed9-069b-4a6b-b0d1-e07a628b4be8": {
      "ai_languageModel": [
        [
          {
            "node": "9afa1edb-2693-4705-b1af-ac5b56beea2c",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "3970a104-1a7a-4df2-b6ab-7e4a4e1a5b87": {
      "ai_languageModel": [
        [
          {
            "node": "86e0be5c-4328-4468-a567-7ba66039ae5a",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - チケット管理, AI要約

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数22
カテゴリー2
ノードタイプ10
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34