Blog

  • Building ‘Stuck Shipment’ Logic with n8n Cron Triggers.

    I don’t just wait for webhooks. I run a nightly Cron job in n8n that scans the active order database. If Order_Date is more than 5 days old and Status is not 'Delivered', it triggers an 'Escalation' workflow to the logistics partner and an 'Apology' template to the customer.

    Learn more about how ShahiRaj uses n8n to automate workflows and improve customer satisfaction.

  • API Aggregation in n8n: Normalizing Shipmozo & BigShip Data

    In this post, I’ll share how I built a ‘Normalizer’ node in n8n to standardize status codes from Shipmozo and BigShip. This allowed us to push clean updates to users, improving their experience and reducing support queries.

    Every logistics carrier sends data differently, making it challenging to work with. By normalizing the data, we can now provide a seamless experience for our customers.

    Check out the code and learn how to build your own Normalizer node in n8n!

    Read more about our e-commerce solutions and how we can help you get started today!

  • Webhook Routing 101: Handling Multi-Carrier Updates

    When working with multiple logistics partners like Shipmozo, BigShip, and ShipRocket, webhook routing can get complicated. Shipmozo sends webhooks one way, while BigShip does it another. That’s where n8n’s ‘Switch’ node comes in handy.

    In this post, I’ll break down how to use the ‘Switch’ node to route incoming webhook data based on the ‘Carrier_ID’, so you can handle unlimited logistics partners in a single workflow.

    With n8n, you can:

    • Route webhooks from multiple carriers
    • Automate data processing and updates
    • Integrate with your existing systems

    Want to learn more about webhook routing and how it can supercharge your logistics operations? Check out our Dev blog for the full tutorial.

    #ShahiRaj #WebhookRouting #LogisticsAutomation

  • Date-Based Triggers in n8n: Automating Recurring Invoices

    Hard-coding dates is messy. I built a workflow in n8n that checks the Student Database, compares the Next Due Date with Today, and generates an invoice link (Razorpay/Stripe) if they match. The invoice is then sent via the WhatsApp API. A zero-touch finance department is a beautiful thing.

    This logic is reusable and easy to maintain. By using date-based triggers, we can automate recurring invoices and reduce manual intervention. Say goodbye to tedious tasks and hello to increased productivity.

    Want to learn more about building date-based triggers in n8n? Reach out to me for a consultation.

  • Google Sheets to WhatsApp: Building an Attendance Bot

    I’ll show you a simple but powerful workflow. Teachers mark attendance in a Google Sheet on their phone. n8n watches that sheet. If a student is marked ‘Absent’, it triggers a WhatsApp Template message to the parent instantly. No manual typing. Learn more about our custom development services.

  • Algorithmic Calendars: Coding the Misri Date Converter

    The challenge of date conversion between the Gregorian calendar and the Misri Calendar is a complex one, but I was determined to crack the code. I used a custom Javascript function in n8n to convert dates dynamically, while fetching real-time weather data from the OpenWeatherMap API in the same workflow.

    This was no easy feat, but the end result was well worth it. With ShahiRaj, I can now get the correct Misri dates and weather updates in one place, streamlining my workflow and saving me valuable time.

    Want to learn more about how I built this custom solution? Reach out to me and let’s discuss how we can help you automate your specific needs.

  • Unlocking API Power with n8n: A Tale of Three APIs

    As a developer, I’ve often found myself wrestling with the challenge of API aggregation. How do you chain together multiple APIs to create something truly powerful? The answer, in my case, was n8n – a fantastic tool for automating workflows and integrating APIs.

    My latest project involved fetching OpenWeatherMap data, calculating Misri Calendar dates using a custom algorithm, and sending Telegram Markdown messages. Sounds complicated, right? With n8n, it was a breeze.

    Here’s a breakdown of how I achieved this feat, and the n8n workflow that made it possible:

    <script>
    const n8n = require('n8n');
    n8n.on('ready', () => {
    // Fetch OpenWeatherMap data
    n8n.nodes.n8nOpenWeatherMap.getAll({
    latitude: 37.7749,
    longitude: -122.4194
    });

    // Calculate Misri Calendar dates
    n8n.nodes.n8nAlgorithmic.calculateMisriCalendarDates({
    dates: ['2024-02-14', '2024-02-15']
    });

    // Send Telegram Markdown messages
    n8n.nodes.n8nTelegram.sendMarkdown({
    text: 'Hello, world!',
    chatId: '1234567890'
    });
    });
    </script>

    Want to dive deeper into the world of API aggregation with n8n? Check out our website for more information and resources.

  • Aggregating Business Metrics: Stripe + SQL to Telegram via n8n.

    I’m tired of using expensive and bloated dashboard apps. Instead, I’ve built a system that aggregates my business metrics using n8n, a workflow automation tool. With n8n, I can write a simple SQL query to fetch my Stripe balance via API, format it as an HTML list, and push it to a private Telegram channel via a Cron trigger. Want to know how? Check out our blog post on ShahiRaj.com

     

    n8n is an open-source workflow automation tool that allows you to connect different APIs and services. With n8n, you can automate tasks such as data aggregation, file uploads, and notifications. Get in touch with us to learn more about how n8n can help you streamline your business processes.

    #ShahiRaj #n8n #BusinessAutomation #WorkflowAutomation

  • Chat with Your Data: RAG Architecture using n8n & Vector DBs.

    I’ll break down the stack I use to build ‘Hallucination-Proof’ bots: n8n for orchestration, Pinecone/Qdrant for vector storage, and OpenAI for generation. Learn how to chunk PDFs so the AI actually understands them.

    Our solution involves using n8n to orchestrate the workflow, Pinecone/Qdrant for vector storage, and OpenAI for generation. By breaking down complex documents into smaller chunks, we can train the AI to accurately understand and retrieve information. Check out our blog for more technical insights and tutorials.

  • Building ‘Out of Office’ Logic in n8n (That Actually Sells).

    Standard auto-replies are boring. I’ll show you how to build a ‘Weekend Router’ in n8n. It detects the day (Saturday/Sunday) and switches the LLM system prompt from ‘Instant Support’ to ‘Lead Capture & Scheduling’ mode.

    With n8n, we can create a workflow that checks the current day and adjusts the AI Agent’s behavior accordingly. This way, we can capture leads and schedule appointments on weekends, when our competitors are closed.

    Here’s a code snippet to get you started:

    n8n: https://n8n.io/ 
    
    // Weekend Router workflow
    
    {
      "name": "Weekend Router",
      "nodes": [
        {
          "parameters": {
            "date": "{new Date().getDay()}",
            "mode": "Lead Capture & Scheduling"
          },
          "type": "n8n-nodes-base.if",
          "name": "Weekend Check"
        },
        {
          "parameters": {
            "LLM System Prompt": "{{node["Weekend Check"].json["mode"]}}"
          },
          "type": "n8n-nodes-base.updateItem",
          "name": "Update LLM Prompt"
        }
      ],
      "next": {
        "node": "Update LLM Prompt"
      }
    }
    

    Feel free to customize and expand this workflow to suit your needs. With n8n and our WhatsApp AI Agent, you can create a comprehensive sales bot that runs 24/7.