fast2sms

n8n community node for the Fast2SMS SMS platform: DLT, DLT Manual and Quick routes, OTP, DLT Manager, delivery reports, logs, wallet and webhooks.

Package Information

Released: 2 mo ago
Downloads: 0 weeklyΒ /Β 0 monthly
Latest Version: 0.1.1

Documentation

n8n-nodes-fast2sms

npm version
npm downloads
license
n8n community node

A feature-rich n8n community node for the Fast2SMS platform β€” India's popular bulk SMS, OTP and DLT messaging API.

Send SMS, verify OTPs, manage DLT templates, track deliveries, and automate webhook-driven workflows β€” all from within n8n.


✨ Features at a Glance

Category Operations Highlights
πŸ“± SMS Send, Send Bulk, Send & Wait for Delivery DLT, DLT Manual & Quick routes
πŸ” OTP Send, Verify, Resend Configurable expiry & length
πŸ“‹ DLT Manager Get Templates, Get Senders, Get Entities Cached lookups, guided variable UI
πŸ“ DLT Registry Add Entity, Add Sender, Add Template Bulk upload via Excel URLs
πŸ“Š Reports Delivery Report, SMS Logs, Summary Paginated, date-filtered
πŸ’° Account Get Wallet Balance Real-time balance & SMS count
πŸ”” Webhooks Create, Update, Delete, Get, Set Status SMS & OTP services
⚑ Trigger Delivery Webhook Trigger Real-time delivery callbacks

πŸš€ Installation

Via n8n Community Nodes UI (Recommended)

  1. Go to Settings β†’ Community Nodes
  2. Click Install a community node
  3. Enter: n8n-nodes-fast2sms
  4. Click Install

Via npm

cd ~/.n8n
npm install n8n-nodes-fast2sms

Via Docker

Add to your Dockerfile:

RUN cd /home/node/.n8n && npm install n8n-nodes-fast2sms

βš™οΈ Setup

  1. Get your API Key from Fast2SMS Dashboard β†’ Dev API
  2. In n8n, go to Credentials β†’ New Credential β†’ Fast2SMS API
  3. Paste your API key β€” that's it!

The credential test automatically verifies your key against the /dev/wallet endpoint.


πŸ“± SMS Operations

Three Routes Supported

Route Best For Sender ID DLT Template Price
DLT Production bulk SMS Required From DLT Manager Account-specific
DLT Manual Custom template text Required User-provided Account-specific
Quick Testing & dev Auto (FSTSMS) Not needed β‚Ή5.00/SMS

Send SMS

Send to one or multiple recipients with automatic number validation, batching, and cost estimation.

  • βœ… Smart batching β€” automatically splits large recipient lists into API-sized batches (100/batch)
  • βœ… Number normalization β€” accepts +91, 0, or raw 10-digit formats
  • βœ… Duplicate detection β€” removes duplicate numbers before sending
  • βœ… Segment estimation β€” calculates SMS segments and estimated cost before sending
  • βœ… GSM-7 / UCS-2 detection β€” correctly counts extension characters (€, [, ], etc.) that cost 2 septets

Send & Wait for Delivery

Sends the SMS and holds the workflow until the delivery report resolves β€” no polling node needed.

  • Two-stage architecture: inline polling (≀60s) and putExecutionToWait (up to 1 hour)
  • Configurable resolve conditions: all delivered, any terminal, or any failure
  • Graceful timeout handling with partial results

Personalised / Per-Recipient Messages

Turn on "Personalise per Recipient" to send a unique message to each input item via the /dev/custom endpoint. Each row gets its own text, variables, and recipient β€” validated up-front before anything is sent.


πŸ” OTP Operations

Operation Description
Send Dispatch an OTP via a pre-configured OTP template
Verify Check if the user-submitted OTP is correct
Resend Re-send the last OTP to the same number
  • Configurable OTP length (4–10 digits) and expiry (1–10,080 minutes)
  • Numeric-only variable validation enforced locally before the API call

πŸ“‹ DLT Manager (Read Operations)

Browse your approved DLT assets without leaving n8n:

  • Get Templates β€” list all templates, optionally filtered by Sender ID
  • Get Sender IDs β€” list approved sender IDs with entity names
  • Get Entities β€” de-duplicated entity list derived from senders
  • Get Template by ID β€” look up a single template with its variable slots

All lookups are cached (5-minute TTL) so opening dropdowns doesn't burn API calls.


πŸ“ DLT Registry (Write Operations)

Register new DLT assets programmatically:

Operation What It Does
Add Entity Register a new entity with screenshot proof
Add Sender Register a sender ID under an entity
Add Sender (Excel) Bulk-register senders via an Excel URL
Add Template Register a message template with screenshots
Add Template (Excel) Bulk-register templates via an Excel URL

All URLs are validated to be publicly reachable http(s):// links.


πŸ“Š Reports & Logs

Operation Description
Get Delivery Report Per-recipient delivery status for a request ID
Get SMS Logs Paginated logs with date range filtering
Get Summary Aggregate delivery stats for a date range

Delivery reports can be returned as one item per recipient (split mode) or as a single summary object.


πŸ”” Webhook Management

Full CRUD for Fast2SMS delivery webhooks:

  • Create β€” register a callback URL with event filters
  • Get / Get Many β€” list registered webhooks
  • Update β€” modify URL, events, headers, or payload format
  • Delete β€” remove a webhook
  • Set Status β€” activate / deactivate without deleting

Supports both SMS and OTP webhook services.


⚑ Trigger Node

The Fast2SMS Trigger node receives real-time delivery callbacks:

  • Automatic mode β€” creates/deletes the webhook for you when the workflow activates
  • Manual mode β€” bring your own webhook ID
  • HMAC verification β€” optional shared-secret authentication with timing-safe comparison
  • Payload normalization β€” snake_case API fields mapped to camelCase with ISO timestamps

🎯 Variable System

The DLT route uses positional {#var#} template variables. This node makes them safe and easy:

Mode Description
Guided One labeled input box per variable, auto-named from template context
Pipe-delimited Classic `value1
List JSON array of values

Built-in validation catches:

  • Wrong variable count
  • Pipe characters inside values (escaping or stripping)
  • Control characters that break SMS encoding
  • Empty variables
  • Template rendering verification (round-trip check)

πŸ”’ Security

This package follows security best practices:

  • πŸ” API keys β€” never logged, never in URLs; header-only authentication
  • πŸ›‘οΈ Timing-safe comparison β€” webhook HMAC verification uses SHA-256 + timingSafeEqual
  • 🚫 Path traversal prevention β€” webhook IDs validated against strict [A-Za-z0-9_-]+ pattern
  • πŸ”‘ Cache isolation β€” template cache keyed by SHA-256 hash of API key (cross-tenant safe)
  • πŸ“ Header redaction β€” sensitive headers stripped from webhook payloads
  • ⚠️ GET method warning β€” opt-in only, with clear data exposure warnings

πŸ“‹ Compatibility

Requirement Version
n8n β‰₯ 1.69.0
Node.js β‰₯ 20.15
Runtime dependencies Zero β€” only n8n-workflow as peer

πŸ§ͺ Testing

# Run the full test suite
npm test

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

154 tests covering phone normalization, variable validation, segment counting, datetime parsing, webhook path security, and more.


πŸ“¦ Development

# Clone the repo
git clone https://github.com/AakashRawat04/n8n-nodes-fast2sms.git
cd n8n-nodes-fast2sms

# Install dependencies
npm install

# Build
npm run build

# Lint
npm run lint

# Link to your local n8n for testing
npm link
cd ~/.n8n
npm link n8n-nodes-fast2sms

πŸ“„ License

MIT β€” use it however you like.


🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

πŸ“š Resources

Discussion