Automated DHL shipment tracking bot for web forms and email inquiries
This n8n template automates responses to customer inquiries about DHL shipment status, handling requests from both web forms and emails. Use cases Automate Customer Support: Provide 24/7 instant answers to the common "Where is my order?" question without human intervention. Reduce Support Tickets: Decrease the volume of repetitive tracking inquiries by providing customers with immediate, self-service information. Enhance Customer Experience: Offer a consistent and rapid response across multiple channels (your website and email), allowing customers to use their preferred method of contact. Good to know DHL API Key is required: You'll need to register on the DHL Developer Portal to get your API key. This workflow requires Gmail credentials (OAuth2) to monitor incoming emails and send replies. The webhook URL must be configured in your website's contact or tracking form to receive submissions. How it works The workflow is initiated by one of two triggers: a Webhook (from a website form) or a Gmail Trigger (when a new email arrives). A Merge node combines the data from both triggers into a single, unified flow. The "Extract Tracking Number" Code node intelligently parses the tracking number from either the form data or the email body. It also extracts the customer's name and email address. The HTTP Request node sends the extracted tracking number to the DHL API to fetch the latest shipment status. The "Format Response Message" Code node takes the API response and composes a user-friendly message for the customer. It also handles cases where tracking information is not found. An If node checks the original source of the inquiry to determine whether it came from the webhook or email. If the request came from the webhook, a Respond to Webhook node sends the tracking data back as a JSON response. If the request came from an email, the Gmail node sends the formatted message as an email reply to the customer. How to use Configure the Triggers: Webhook Trigger: Copy the Test URL and set it as the action endpoint for your web form. Once you activate the workflow, use the Production URL. Webhook URL: https://your-n8n-instance.com/webhook/dhl-tracking-inquiry Gmail Trigger: Connect your Gmail account using OAuth2 credentials and set the desired filter conditions (e.g., unread emails with a specific subject). Set up the DHL API: Open the "Get DHL Tracking Status" (HTTP Request) node and navigate to the "Headers" tab. Replace YOURDHLAPI_KEY with your actual DHL API key. json { "DHL-API-Key": "YOURDHLAPI_KEY" } Configure the Gmail Send Node: Connect the same Gmail credentials to the "Send Gmail Response" node. Customize options like the replyTo address as needed. Activate the workflow. Requirements A DHL Developer Portal account to obtain an API key. A Gmail account configured with OAuth2 in n8n. Customising this workflow Add More Carriers: Duplicate the HTTP Request node and response formatting logic to support other shipping carriers like FedEx or UPS. Log Inquiries: Add a node to save inquiry details (tracking number, customer email, status) to a Google Sheet or database for analytics. Advanced Error Handling: Implement more robust error handling, such as sending a Slack notification to your support team if the DHL API is down or returns an unexpected error.
Location-based triggered reminder via Telegram Bot (iOS)
This workflow integrates iOS Shortcuts with n8n to create a simple, automatic location-based reminder system. When the user arrives at a specified location, an automation in the Shortcuts app sends a webhook trigger to n8n. If the trigger matches predefined date and time conditions, n8n sends a Telegram message reminder to the user. This is perfect for repetitive weekly tasks like taking out the bins, customized with conditions for day and time. Key Features Location-Based Trigger: Uses iOS Shortcuts automation to start the workflow upon arrival at a specific location. Time and Day Validation: Logic in n8n checks current weekday and time to ensure reminders are sent only when appropriate. Telegram Integration: Sends reminders directly to your Telegram account using your bot. Minimal Setup: Uses native iOS and simple webhook setup in n8n. How It Works iOS Shortcut Trigger: When the user arrives at a designated location, the iOS shortcut sends a GET request to the n8n webhook. n8n Webhook Node: Receives the request and triggers the workflow. Conditional Check: An IF node checks if the current time is after 4:00 PM and it's a Wednesday (or any other configured condition). Telegram Node: If the condition passes, n8n sends a message like "Don't forget to take the bins out." to your Telegram bot. Setup Instructions Create a Telegram Bot: Use @BotFather to create a bot and obtain your bot token. Add Telegram API credentials in n8n with your bot token. Setup iOS Shortcut: Open the Shortcuts app on your iPhone. Go to the Automation tab → Tap + → Create Personal Automation. Choose Arrive → Select a location. Add action: Get Contents of URL. Method: GET, URL: your n8n Webhook URL (e.g. https://n8n.yourdomain.com/webhook/your-path). Save the automation. (You can also test the automation by pressing the Play button) Import Workflow into n8n: Load the provided workflow JSON. Set your webhook path and Telegram credentials. Adjust the logic in the IF node to your usecase. In my case, I check if today is Wednesday and after 4 PM until Midnight. Expose n8n Publicly: Ensure your n8n instance is publicly accessible via HTTPS so the shortcut can reach it. Customization Guidance Change Reminder Message: Modify the text inside the Telegram node to suit different reminders. Add More Conditions: Extend the logic to support more days, hours, or different trigger messages. Add Multi-Channel Output: Send reminders via email, SMS, or Slack in addition to Telegram. Use More Triggers: Expand to other types of shortcut triggers (e.g. NFC tag, leaving location, time of day). Security and Implementation Webhook Protection: Avoid using easily guessable webhook URLs. Secure Telegram Token: Store your bot token securely in n8n credentials, not in plain workflow text. Limit Shortcut Scope: Only trigger the shortcut at trusted locations or with secure iCloud sync. Automation Permissions: Ensure your iPhone allows shortcut automations to run without confirmation. Benefits Automates repetitive location-based reminders without user interaction. Provides a lightweight, native solution using iOS and n8n with no extra apps. Keeps you on track for routine tasks like garbage days, medicine reminders, or arrival-based tasks. Easily extendable for multiple locations or trigger conditions.