8
n8n 한국어amn8n.com

다중 채널 DHL 상태 봇

중급

이것은Support Chatbot, AI Chatbot분야의자동화 워크플로우로, 15개의 노드를 포함합니다.주로 If, Code, Gmail, Merge, Webhook 등의 노드를 사용하며. 웹 양식 및 이메일 문의를 위한 자동화된 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": "Workflow Overview",
      "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 트리거 Form Trigger",
      "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": "Trigger 설정up",
      "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": "병합 Triggers",
      "type": "n8n-nodes-base.merge",
      "position": [
        608,
        208
      ],
      "parameters": {
        "mode": "combine",
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "extract-tracking",
      "name": "Extract Tracking Number",
      "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": "Extraction Logic",
      "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": "Get DHL Tracking Status",
      "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 Configuration",
      "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": "Format Response Message",
      "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": "Check Source",
      "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": "Response Routing",
      "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 트리거 Response",
      "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": "Send Gmail Response",
      "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": "Email 설정up",
      "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 Email Trigger": {
      "main": [
        [
          {
            "node": "Merge Triggers",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Webhook Form 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)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수15
카테고리2
노드 유형9
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
Yusuke Yamamoto

Yusuke Yamamoto

@yusuke-yamamoto

Business 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에서 보기

이 워크플로우 공유

카테고리

카테고리: 34