Multi-Channel DHL Shipment Status Automation - n8n Workflow

Build an expert n8n workflow to automate DHL shipment tracking responses. This template uses an n8n trigger for webhooks and Gmail to instantly reply to customer inquiries.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • E-commerce businesses needing to automate customer service responses for tracking inquiries.

  • Technical teams looking for advanced n8n templates integrating webhooks and email logic.

  • Developers needing a robust, multi-channel n8n trigger setup for handling external requests.

  • Anyone seeking to reduce manual effort associated with looking up DHL parcel statuses.

Overview

Customer service teams often spend significant time responding to standard 'Where is my order?' inquiries. This expert n8n workflow solves this inefficiency by creating a fully automated DHL tracking bot capable of handling requests from two critical channels: website forms and direct customer emails.

By leveraging the versatile n8n trigger system, the workflow listens continuously for incoming tracking numbers. Once a number is received, regardless of the source, the powerful n8n node processes the data, calls the official DHL API, formats the current status information, and intelligently routes the reply back to the originating channel (either a clean JSON response for a web form or a friendly, formatted email via the Gmail n8n node).

This sophisticated n8n workflow ensures rapid customer feedback, drastically improves response times, and allows support staff to focus on more complex issues, maximizing the value of your existing n8n installation.

How it Works

This n8n workflow operates using a dual-channel n8n trigger setup for maximum coverage:


  1. Dual Trigger Activation: The n8n workflow starts when either the 'Webhook Form Trigger' receives a POST request (typically from a website's 'Track My Order' form) or the 'Gmail Email Trigger' detects a new, unread email.

  2. Data Consolidation: The 'Merge Triggers' n8n node combines the parallel streams of data. The subsequent 'Extract Tracking Number' Code n8n node normalizes the data. It uses smart logic (including regex on email text) to reliably extract the Tracking Number, Customer Email, and Customer Name, ensuring consistent processing downstream.

  3. API Integration: The 'Get DHL Tracking Status' HTTP Request n8n node securely calls the DHL API, passing the extracted tracking number as a query parameter. This step requires a valid DHL API key.

  4. Response Formatting: The 'Format Response Message' Code n8n node processes the raw API output. It constructs a human-readable summary, including the current status, location, and estimated delivery, and crucially determines whether the request originated from the webhook n8n trigger or the Gmail n8n trigger.

  5. Intelligent Routing: The 'Check Source' If n8n node routes the execution path. If the source was a webhook, execution moves to the Webhook Response n8n node. If the source was email, it moves to the Gmail Response n8n node.

  6. Final Action: The response is delivered instantaneously, either as a JSON payload for front-end processing or as a personalized email reply, finalizing the automated n8n workflow execution.

Installation Guide

To deploy this complete n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON and paste it directly into your n8n instance under the 'Workflows' section using the 'New' -> 'Import from JSON' option.

  2. Set up Gmail Credentials: Locate the 'Gmail Email Trigger' and 'Send Gmail Response' n8n node instances. Click on 'Credentials' and authenticate with your Google account using OAuth2. This grants the n8n workflow permission to monitor and send emails.

  3. Configure DHL API Key: The 'Get DHL Tracking Status' n8n node is the core of this integration. You must configure the API key:

Obtain a DHL API key from the DHL Developer Portal.
In the 'Get DHL Tracking Status' n8n node, navigate to 'Headers' -> 'Header Parameters'.
* Replace the placeholder YOURDHLAPI_KEY in the DHL-API-Key field with your actual key.

  1. Configure Webhook Trigger: Locate the 'Webhook Form Trigger' n8n node. Copy the Test or Production URL displayed and integrate this endpoint URL into your website's form submission settings.

  2. Activate: Save the n8n workflow and set the 'Active' toggle to 'On' to start monitoring for new inquiries.

Node Details

This n8n workflow utilizes several specialized n8n nodes to achieve its goal:

Webhook Form Trigger: Function: Serves as the primary real-time n8n trigger for website form submissions. Key Configuration: Uses the POST method and is set to return the response via a dedicated response node.
Gmail Email Trigger: Function: The secondary n8n trigger, continuously polling a designated Gmail inbox for new, unread emails containing tracking inquiries. Key Configuration: Requires Gmail OAuth2 credentials.
Merge Triggers (Merge n8n node): Function: Combines the incoming data from the two parallel triggers into a single stream for subsequent processing.
Extract Tracking Number (Code n8n node): Function: A crucial data preparation step. It normalizes the input data, using conditional logic to extract the tracking number and customer contact details from either the webhook body or the email text (using regex).
Get DHL Tracking Status (HTTP Request n8n node): Function: The integration point. It queries the external DHL API. Key Configuration: Uses HTTP Header Authentication to pass the required DHL-API-Key and dynamically sets the tracking number using an n8n expression: ={{ $json.trackingNumber }}.
Format Response Message (Code n8n node): Function: Transforms the raw DHL API data into a polished, human-friendly message body for the customer. It also sets the isWebhook flag used for routing.
Check Source (If n8n node): Function: Flow control gate. Determines which path to take based on the isWebhook flag generated in the previous n8n node.
Webhook Response (RespondToWebhook n8n node): Function: Used only if the original n8n trigger was a webhook. It sends a structured JSON response (containing tracking details) instantly back to the web form.


  • Send Gmail Response (Gmail n8n node): Function: Used only if the original n8n trigger was email. It sends the fully formatted email response to the customer. Key Configuration: Uses the customer's extracted email address for the Send To parameter.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

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.

Featured*