AutomationFlowsWeb Scraping › Automated SMS Dispatch Queue via Telnyx

Automated SMS Dispatch Queue via Telnyx

Original n8n title: [sms] Dispatch Queue

[SMS] Dispatch Queue. Uses httpRequest. Scheduled trigger; 10 nodes.

Cron / scheduled trigger★★★★☆ complexity10 nodesHTTP Request
Web Scraping Trigger: Cron / scheduled Nodes: 10 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "[SMS] Dispatch Queue",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 10
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Every 10 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        220,
        300
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://dabbahwala-latest.onrender.com/api/sms/pending",
        "options": {}
      },
      "id": "fetch-pending-sms",
      "name": "Fetch Pending SMS Contacts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "has-sms",
              "leftValue": "={{ $json.length }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "has-pending",
      "name": "Has Pending SMS?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        660,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contacts = $input.first().json;\nif (!Array.isArray(contacts) || contacts.length === 0) return [];\nreturn contacts.map(item => ({ json: item }));"
      },
      "id": "split-contacts",
      "name": "Split Contacts",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        880,
        240
      ]
    },
    {
      "parameters": {
        "jsCode": "// Build SMS payload based on sms_level and lifecycle\nconst contact = $input.item.json;\nconst smsLevel = contact.sms_level || 1;\nconst lifecycle = contact.lifecycle || 'cold';\n\nlet messageBody = '';\n\nif (lifecycle === 'new_customer') {\n  messageBody = `Hi ${contact.contact_email.split('@')[0]}! Thanks for your recent order with DabbahWala. Reply YES for exclusive offers.`;\n} else if (smsLevel >= 3) {\n  messageBody = `We miss you! Your favorites are ready for reorder. Reply ORDER or call us \u2014 DabbahWala`;\n} else if (smsLevel >= 2) {\n  messageBody = `Special offer just for you from DabbahWala! Check your email for details. Reply STOP to opt out.`;\n} else {\n  messageBody = `DabbahWala: Fresh items available this week! Reply STOP to opt out.`;\n}\n\nreturn {\n  json: {\n    contact_id: contact.contact_id,\n    phone: contact.phone,\n    email: contact.contact_email,\n    message_body: messageBody,\n    sms_level: smsLevel\n  }\n};"
      },
      "id": "build-message",
      "name": "Build SMS Message",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1100,
        240
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.telnyx.com/v2/messages",
        "authentication": "none",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"from\": \"{{ $('Get Credentials').first().json.TELNYX_FROM_NUMBER }}\",\n  \"to\": \"{{ $json.phone }}\",\n  \"text\": \"{{ $json.message_body }}\"\n}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Get Credentials').first().json.TELNYX_API_KEY }}"
            }
          ]
        }
      },
      "id": "send-telnyx-sms",
      "name": "Send via Telnyx",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1320,
        240
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://dabbahwala-latest.onrender.com/api/sms/{{ $('Build SMS Message').item.json.contact_id }}/sent",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"telnyx_msg_id\": \"{{ $json.data?.id || '' }}\"\n}",
        "options": {}
      },
      "id": "mark-sms-sent",
      "name": "Mark SMS Sent",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1540,
        240
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://dabbahwala-latest.onrender.com/api/telnyx/message",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"contact_email\": \"{{ $('Build SMS Message').item.json.email }}\",\n  \"direction\": \"outbound\",\n  \"from_number\": \"{{ $('Get Credentials').first().json.TELNYX_FROM_NUMBER }}\",\n  \"to_number\": \"{{ $('Build SMS Message').item.json.phone }}\",\n  \"body\": \"{{ $('Build SMS Message').item.json.message_body }}\",\n  \"telnyx_msg_id\": \"{{ $json.data?.id || '' }}\",\n  \"status\": \"sent\",\n  \"is_delivery_staff\": false,\n  \"metadata\": {}\n}",
        "options": {}
      },
      "id": "store-message",
      "name": "Store in Telnyx Messages",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1760,
        240
      ]
    },
    {
      "parameters": {},
      "id": "no-pending",
      "name": "No Pending \u2014 Skip",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        880,
        400
      ]
    },
    {
      "id": "get-credentials",
      "name": "Get Credentials",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        470,
        300
      ],
      "parameters": {
        "method": "GET",
        "url": "https://dabbahwala-latest.onrender.com/api/credentials",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Every 10 Minutes": {
      "main": [
        [
          {
            "node": "Get Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Pending SMS Contacts": {
      "main": [
        [
          {
            "node": "Has Pending SMS?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Pending SMS?": {
      "main": [
        [
          {
            "node": "Split Contacts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Pending \u2014 Skip",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Contacts": {
      "main": [
        [
          {
            "node": "Build SMS Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build SMS Message": {
      "main": [
        [
          {
            "node": "Send via Telnyx",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send via Telnyx": {
      "main": [
        [
          {
            "node": "Mark SMS Sent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Store in Telnyx Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Get Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Credentials": {
      "main": [
        [
          {
            "node": "Fetch Pending SMS Contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    {
      "name": "DabbahWala",
      "id": "dabbahwala"
    },
    {
      "name": "Telnyx",
      "id": "tag-telnyx"
    },
    {
      "name": "Action",
      "id": "tag-action"
    }
  ]
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

[SMS] Dispatch Queue. Uses httpRequest. Scheduled trigger; 10 nodes.

Source: https://github.com/vivek-dataskate/DabbahWala/blob/55df577abf41d0b89f3199f4c78662a9513accba/n8n/sms_dispatch.json — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

As n8n instances scale, teams often lose track of sub-workflows—who uses them, where they are referenced, and whether they can be safely updated. This leads to inefficiencies like unnecessary copies o

HTTP Request, n8n, N8N Trigger +1
Web Scraping

This workflow is an improvement of this workflow by Greg Brzezinka.

HTTP Request, Email Send, XML +1
Web Scraping

N8N-Workflow-Github-Manager. Uses github, httpRequest, n8n. Scheduled trigger; 38 nodes.

GitHub, HTTP Request, n8n
Web Scraping

This workflow uses KlickTipp community nodes, available for self-hosted n8n instances only.

N8N Nodes Klicktipp, Salesforce, Salesforce Trigger +1
Web Scraping

This workflow acts as an automated engagement bot. It sends a Direct Message (DM) with a link or resource to any follower who replies to your post with a specific target keyword.

HTTP Request