マルチチャンネルDHLステータスボット
中級
これはSupport Chatbot, AI Chatbot分野の自動化ワークフローで、15個のノードを含みます。主にIf, Code, Gmail, Merge, Webhookなどのノードを使用。 Webフォームおよびメール照会に対応する自動化DHLパッケージ追跡ボット
前提条件
- •Googleアカウント + Gmail API認証情報
- •HTTP Webhookエンドポイント(n8nが自動生成)
- •ターゲットAPIの認証情報が必要な場合あり
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "sKPt2XLNb9anT2fW",
"meta": {
"instanceId": "15d6057a37b8367f33882dd60593ee5f6cc0c59310ff1dc66b626d726083b48d"
},
"name": "Multi-Channel DHL Status Bot with n8n, Gmail, and Webhooks",
"tags": [],
"nodes": [
{
"id": "intro-note-1",
"name": "ワークフロー概要",
"type": "n8n-nodes-base.stickyNote",
"position": [
-112,
80
],
"parameters": {
"width": 320,
"height": 410,
"content": "## Multi-Channel DHL Status Bot\n\nThis workflow automatically answers customer inquiries about DHL shipment status from two different channels: web forms and email.\n\n**Channels Handled:**\n- **Webhooks:** For 'Track My Order' forms on your website.\n- **Gmail:** For direct email inquiries.\n\n**Process Flow:**\n1. Receives a tracking number from either source.\n2. Fetches the latest status from the DHL API.\n3. Sends a formatted response back to the original channel."
},
"typeVersion": 1
},
{
"id": "webhook-trigger",
"name": "Webhook フォームトリガー",
"type": "n8n-nodes-base.webhook",
"position": [
304,
112
],
"webhookId": "dhl-tracking-webhook",
"parameters": {
"path": "dhl-tracking-inquiry",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "gmail-trigger",
"name": "Gmail メールトリガー",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
304,
304
],
"parameters": {
"simple": false,
"filters": {
"sender": [],
"readStatus": "unread"
},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "gmailCredentials",
"name": "Gmail OAuth2"
}
},
"typeVersion": 1.1
},
{
"id": "setup-note-1",
"name": "トリガー設定",
"type": "n8n-nodes-base.stickyNote",
"position": [
304,
480
],
"parameters": {
"color": 3,
"width": 280,
"height": 308,
"content": "## ⚙️ Trigger Configuration\n\n**1. Gmail Trigger:**\n- Select the 'Gmail Email Trigger' node.\n- Connect your Gmail OAuth2 credentials.\n- **Action:** This allows the workflow to monitor an inbox for new tracking inquiries.\n\n**2. Webhook Trigger:**\n- Copy the Production URL from the 'Webhook Form Trigger' node.\n- **Action:** Paste this URL into your website's form settings (e.g., WordPress, Webflow, custom HTML form)."
},
"typeVersion": 1
},
{
"id": "merge-triggers",
"name": "トリガー統合",
"type": "n8n-nodes-base.merge",
"position": [
608,
208
],
"parameters": {
"mode": "combine",
"options": {}
},
"typeVersion": 3
},
{
"id": "extract-tracking",
"name": "追跡番号抽出",
"type": "n8n-nodes-base.code",
"position": [
800,
208
],
"parameters": {
"jsCode": "// Extract tracking number from different sources\nconst items = $input.all();\nconst output = [];\n\nfor (const item of items) {\n let trackingNumber = '';\n let customerEmail = '';\n let customerName = '';\n \n // Check if from webhook (form submission)\n if (item.json.body) {\n trackingNumber = item.json.body.trackingNumber || item.json.body.orderNumber || '';\n customerEmail = item.json.body.email || '';\n customerName = item.json.body.name || 'Customer';\n }\n \n // Check if from email\n if (item.json.subject || item.json.text) {\n // Extract tracking number using regex (DHL format)\n const text = item.json.text || item.json.snippet || '';\n const dhlPattern = /\\b\\d{10,}\\b/g;\n const matches = text.match(dhlPattern);\n \n if (matches && matches.length > 0) {\n trackingNumber = matches[0];\n }\n \n customerEmail = item.json.from?.value?.[0]?.address || item.json.from || '';\n customerName = item.json.from?.value?.[0]?.name || 'Customer';\n }\n \n if (trackingNumber) {\n output.push({\n json: {\n trackingNumber: trackingNumber,\n customerEmail: customerEmail,\n customerName: customerName,\n originalData: item.json\n }\n });\n }\n}\n\nreturn output;"
},
"typeVersion": 2
},
{
"id": "extraction-note",
"name": "抽出ロジック",
"type": "n8n-nodes-base.stickyNote",
"position": [
688,
384
],
"parameters": {
"color": 5,
"width": 250,
"height": 236,
"content": "## Data Normalization\n\nThis Code node unifies data from both triggers.\n\n**It extracts:**\n- Tracking Number (from form body or email text)\n- Customer Email\n- Customer Name\n\nThis ensures the rest of the workflow can process the data in a consistent format, regardless of the source."
},
"typeVersion": 1
},
{
"id": "dhl-api-request",
"name": "DHL追跡ステータス取得",
"type": "n8n-nodes-base.httpRequest",
"position": [
1008,
208
],
"parameters": {
"url": "https://api-eu.dhl.com/track/shipments",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
},
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"queryParameters": {
"parameters": [
{
"name": "trackingNumber",
"value": "={{ $json.trackingNumber }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "DHL-API-Key",
"value": "YOUR_DHL_API_KEY"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "9clRo88n4LVt91WQ",
"name": "動画生成AI_sora"
}
},
"typeVersion": 4.2
},
{
"id": "api-note",
"name": "DHL API 設定",
"type": "n8n-nodes-base.stickyNote",
"position": [
1008,
384
],
"parameters": {
"color": 4,
"width": 280,
"height": 240,
"content": "## ⚙️ DHL API Configuration\n\n**Action Required:** You must add your DHL API key to proceed.\n\n1. **Get API Key:** Register and get a key from the [DHL Developer Portal](https://developer.dhl.com/).\n2. **Add Key to Node:**\n - Select the 'Get DHL Tracking Status' node.\n - Go to `Headers` > `Header Parameters`.\n - Replace `YOUR_DHL_API_KEY` with your actual key."
},
"typeVersion": 1
},
{
"id": "format-response",
"name": "応答メッセージ整形",
"type": "n8n-nodes-base.code",
"position": [
1200,
208
],
"parameters": {
"jsCode": "// Format the tracking response\nconst trackingData = $input.item.json;\nconst customerData = $node[\"Extract Tracking Number\"].json;\n\nlet statusMessage = '';\nlet trackingDetails = {};\n\ntry {\n // Parse DHL API response\n const shipment = trackingData.shipments?.[0];\n \n if (shipment) {\n const latestEvent = shipment.events?.[0];\n const status = shipment.status;\n \n trackingDetails = {\n trackingNumber: customerData.trackingNumber,\n currentStatus: status?.status || 'In Transit',\n statusDescription: status?.description || '',\n lastUpdate: latestEvent?.timestamp || new Date().toISOString(),\n location: latestEvent?.location?.address?.addressLocality || 'Unknown',\n estimatedDelivery: shipment.estimatedTimeOfDelivery || 'Not available',\n carrier: 'DHL Express'\n };\n \n statusMessage = `\nDear ${customerData.customerName},\n\nThank you for your inquiry about tracking number: ${trackingDetails.trackingNumber}\n\n📦 **Current Status:** ${trackingDetails.currentStatus}\n📍 **Last Location:** ${trackingDetails.location}\n🕒 **Last Update:** ${new Date(trackingDetails.lastUpdate).toLocaleString()}\n📅 **Estimated Delivery:** ${trackingDetails.estimatedDelivery}\n\n${trackingDetails.statusDescription}\n\nYou can track your shipment in real-time at:\nhttps://www.dhl.com/track?tracking-id=${trackingDetails.trackingNumber}\n\nIf you have any questions, please don't hesitate to contact us.\n\nBest regards,\nCustomer Service Team\n `;\n } else {\n statusMessage = `\nDear ${customerData.customerName},\n\nWe couldn't find tracking information for: ${customerData.trackingNumber}\n\nPlease verify the tracking number and try again. If the issue persists, please contact our support team.\n\nBest regards,\nCustomer Service Team\n `;\n }\n} catch (error) {\n statusMessage = `\nDear ${customerData.customerName},\n\nWe encountered an issue retrieving your tracking information. Our team has been notified and will look into this immediately.\n\nTracking Number: ${customerData.trackingNumber}\n\nPlease try again later or contact our support team for immediate assistance.\n\nBest regards,\nCustomer Service Team\n `;\n}\n\nreturn {\n json: {\n customerEmail: customerData.customerEmail,\n customerName: customerData.customerName,\n subject: `Re: DHL Tracking Update - ${customerData.trackingNumber}`,\n message: statusMessage,\n trackingDetails: trackingDetails,\n isWebhook: customerData.originalData?.body ? true : false\n }\n};"
},
"typeVersion": 2
},
{
"id": "check-source",
"name": "送信元確認",
"type": "n8n-nodes-base.if",
"position": [
1408,
208
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "condition-1",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isWebhook }}",
"rightValue": true
}
]
}
},
"typeVersion": 2
},
{
"id": "routing-note",
"name": "応答ルーティング",
"type": "n8n-nodes-base.stickyNote",
"position": [
1344,
352
],
"parameters": {
"color": 6,
"width": 220,
"height": 232,
"content": "## Response Routing\n\nThis IF node intelligently routes the response based on the original inquiry source.\n\n- **If `isWebhook` is true:** The workflow sends a JSON response back to the web form.\n- **If `isWebhook` is false:** The workflow sends a formatted reply via Gmail."
},
"typeVersion": 1
},
{
"id": "webhook-response",
"name": "Webhook 応答",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1600,
112
],
"parameters": {
"options": {
"responseCode": 200,
"responseHeaders": {
"entries": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"respondWith": "json",
"responseBody": "={{ JSON.stringify($json.trackingDetails) }}"
},
"typeVersion": 1.1
},
{
"id": "gmail-send",
"name": "Gmail 応答送信",
"type": "n8n-nodes-base.gmail",
"position": [
1600,
304
],
"webhookId": "3c958446-e0e3-4b3d-91c0-2dad70585160",
"parameters": {
"sendTo": "={{ $json.customerEmail }}",
"message": "={{ $json.message }}",
"options": {
"replyTo": "support@yourcompany.com"
},
"subject": "={{ $json.subject }}"
},
"credentials": {
"gmailOAuth2": {
"id": "gmailCredentials",
"name": "Gmail OAuth2"
}
},
"typeVersion": 2.1
},
{
"id": "email-config-note",
"name": "メール設定",
"type": "n8n-nodes-base.stickyNote",
"position": [
1600,
464
],
"parameters": {
"color": 2,
"height": 252,
"content": "## ✉️ Email Customization\n\nCustomize the automated email reply.\n\n**Suggestions:**\n- **Set `Reply-To` in 'Send Gmail Response' node:** Add a support address like `support@yourcompany.com`.\n- **Refine Message:** Edit the email body in the \"Format Response Message\" node to add your company signature or branding."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"timezone": "America/New_York",
"errorWorkflow": "",
"executionOrder": "v1",
"saveManualExecutions": true,
"saveExecutionProgress": true,
"saveDataErrorExecution": "all",
"saveDataSuccessExecution": "all"
},
"versionId": "9066dca1-1efe-41ec-8477-457dcaadd0a8",
"connections": {
"check-source": {
"main": [
[
{
"node": "webhook-response",
"type": "main",
"index": 0
}
],
[
{
"node": "gmail-send",
"type": "main",
"index": 0
}
]
]
},
"merge-triggers": {
"main": [
[
{
"node": "extract-tracking",
"type": "main",
"index": 0
}
]
]
},
"gmail-trigger": {
"main": [
[
{
"node": "merge-triggers",
"type": "main",
"index": 1
}
]
]
},
"webhook-trigger": {
"main": [
[
{
"node": "merge-triggers",
"type": "main",
"index": 0
}
]
]
},
"extract-tracking": {
"main": [
[
{
"node": "dhl-api-request",
"type": "main",
"index": 0
}
]
]
},
"format-response": {
"main": [
[
{
"node": "check-source",
"type": "main",
"index": 0
}
]
]
},
"dhl-api-request": {
"main": [
[
{
"node": "format-response",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - サポートチャットボット, AIチャットボット
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
航空公司のFAQボット
GPT-4と質問分類を使った航空会社カスタマーサポートの自動化
If
Code
Merge
+
If
Code
Merge
27 ノードOneclick AI Squad
サポートチャットボット
n8nノードの探索(可視化リファレンスライブラリ内)
n8nノードを可視化リファレンスライブラリで探索
If
Ftp
Set
+
If
Ftp
Set
113 ノードI versus AI
その他
AI医療症状チェッカーとヘルスアシスタント
GPT-4-miniに基づく医療症状チェックと健康アシスタント
If
Set
Code
+
If
Set
Code
17 ノードJah coozi
サポートチャットボット
GPT-4o、Brevo、NocoDBを使用して sales 外勤業務の自動化とリスポンス管理
GPT-4o、Brevo、NocoDB を使って販売アウトリーチとレスポンス管理を自動化
If
Set
Code
+
If
Set
Code
77 ノードEvervise
リードナーチャリング
競合他社コンテンツギャップ分析ツール:構題マッピングの自動化
Gemini AI、Apify、Google Sheetsを使用して競合企業のコンテンツギャップを分析
If
Set
Code
+
If
Set
Code
30 ノードMychel Garzon
その他
Gmailのメールヘッダーを解析してIP信頼性とスプーフィングを検出
Gmailのメールヘッダーを解析し、IP評判とスプーフィングを検出する
If
Set
Code
+
If
Set
Code
40 ノードAngel Menendez
セキュリティ運用
ワークフロー情報
難易度
中級
ノード数15
カテゴリー2
ノードタイプ9
作成者
Yusuke Yamamoto
@yusuke-yamamotoBusiness creator from Tokyo. Designing AI-driven automations that enhance marketing, reporting, and daily operations. I turn complex workflows into simple, elegant automations with n8n.
外部リンク
n8n.ioで表示 →
このワークフローを共有