send
Send up to 15 queued WhatsApp messages (campaign/client ID 2) through rotating linked devices via
mudslide, rate-limited per device
- Command:
/go/send - Category: WhatsApp
- Required option: None
- Output: Progress lines per message;
Please wait <n> secondsif run too soon after the last send - Last updated: 2026-11-21
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
/go/send drains a WhatsApp send queue stored in MariaDB and dispatches each message through one of several WhatsApp-linked "device" sessions, using mudslide (run through npx). It rotates across devices, enforces a per-device send quota and a 5-minute cooldown between sends from the same device, and retires a device after repeated delivery failures.
It's meant to be run on a short, repeating schedule (for example, every minute from cron); each run processes at most 15 messages.
[!WARNING] This script references
$MySQLRootPasswordin every database query, but never defines it — there is no assignment to that variable anywhere in the script, and it doesn't source anything (such as/go/function) that would set it either. Compare this tobackupandrestore, which both derive it explicitly near the top of the script. Unless this variable is somehow exported into the environment before/go/sendruns, everymariadbcall here authenticates with an empty password, which will either fail outright or hang waiting for interactive input — meaning the queue is never actually read or sent. Check this before relying on the command; see Known issues.
The call is appended to /var/log/go/send.log.
Quick start
/go/send
If Node.js (and npx) isn't installed yet, the first run only installs it and exits; run the command again afterward to actually process the queue.
Syntax
/go/send
The command takes no arguments.
Options
None. Everything comes from GoAdmio's configuration and the CRM database:
| Input | Where it comes from |
|---|---|
| Queue and device database name | /etc/wa, or crm if that file doesn't exist |
| Linked device sessions | Subfolders of /whatsapp/ |
| Per-device send quota, cooldown timer, failure count | The Member table (keyed by phone number) and a failed counter file in each device's folder |
| Queued messages | The Whatsapp table, filtered to CID=2 (see Known issues) |
Output
Please wait 37 seconds
or, per message attempted:
----------------------------------------
Sender: 15551234567 (3/50)
Sending "Reminder" To 15559876543 (From /whatsapp/15551234567)...
Invalid mobile number 0123
Mobile 15551234567 not have an account
Examples
# Run it directly
/go/send
# Typical setup: run every minute from cron
* * * * * /go/send >> /var/log/go/send-cron.log 2>&1
# Check a device's quota and last-send time
sudo mariadb -N -e "select Mobile, Send, Max, TimeStamp from crm.Member where Mobile='15551234567'"
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Nothing is ever sent, with no clear error | MySQLRootPassword is undefined (see the warning above), so every database query fails or hangs. |
Confirm whether this variable is actually exported from somewhere outside the script. If not, the script needs a line deriving it, the same way backup and restore do. |
Please wait <n> seconds |
A message was successfully sent in the last 50 seconds. | Wait, or see Known issues about the lock file's lifetime. |
| The command installs Node.js and exits without sending anything | npx wasn't found, so the command ran nodejs and stopped. |
Run /go/send again after Node.js finishes installing. |
Invalid mobile number <value> |
The recipient's number, after stripping non-digits, starts with 0 or is shorter than 10 digits. |
The message is deleted from the queue outright, not retried. Check the number format before queuing it. |
Mobile <number> not have an account |
The folder under /whatsapp/ has no matching row in the Member table yet. |
A row is created automatically (see Details), but it starts with no quota, so no send happens through it this run. |
A device stops sending permanently and its /whatsapp/<number> folder has vanished |
It reached more than 10 recorded delivery failures, and the folder (including its mudslide session) was deleted outright. |
Relink that WhatsApp number — the linked session is gone, not just paused. There is no automatic alert when this happens; see Known issues. |
| Messages for a different campaign/client never go out | The queue query only selects rows where CID=2. |
This command doesn't process other CID values at all. |
| A new device's folder exists but never sends | A freshly auto-created Member row has no quota (Max) set. |
Set a Max value for that mobile number in the Member table through whatever process normally provisions these devices. |
Details
Per run
- Refuses to run if a message was sent in the last 50 seconds (see Known issues for how reliable this actually is).
- Installs Node.js and exits if
npxisn't available. - Reads up to 15 queued messages with
CID=2from<db>.Whatsapp, oldest first. - For each message, rotates to the next folder under
/whatsapp/(shuffled once at the start of the run, then cycled through in order) and treats that folder's name as the sending device's mobile number.
Per message
- Strips everything but digits from the recipient number. Deletes the message outright if the result starts with
0or has fewer than 10 digits. - Looks up the device's
Send(count),Max(quota), andTimeStamp(last send) from theMembertable. If the device has no row yet (Maxis0), creates one — but see the data issue under Known issues. - Only attempts a send if the device's
Sendis under itsMaxand at least 300 seconds have passed since its last send. - Calls
npx mudslide send <number> "<message>" -c <device-folder>, retrying once if the first attempt returns nothing. - On success: deletes the message from the queue, increments the device's
Sendand lifetimeWhatsappcounters, resets its failure counter, and pauses 3 seconds. - On failure (empty result, an "error" in the result, or a result not containing "Done"): increments a
failedcounter file in the device's folder. Once that counter passes 10, deletes the entire device folder.
Known issues
MySQLRootPasswordis never set in this script. See the warning above — this is likely a missing line, not an intentional design choice, and as written it probably prevents the command from doing anything useful.- The 50-second lock is cleared at the end of every run, regardless of outcome. The cleanup condition is
[ "$N" -eq "0" ] || [ "$Sent" -eq "1" ]— and because$Sentis only ever set to1in the same place$Nbecomes1or more, this condition is true whether or not anything was sent. In practice the lock file is deleted at the end of every single run, so it does not actually throttle back-to-back runs the way it appears designed to. - A newly auto-created device gets a nonsensical
IPvalue. TheINSERT IGNOREfor a brand-newMemberrow sets theIPcolumn to the current Unix timestamp (the same value also used forPWD), not an actual IP address — almost certainly a copied-and-not-updated value list. /whatsapp/is globbed without checking it has any subfolders. If the folder is empty or missing, bash leaves the literal, unexpanded pattern as the only array element, which is then treated as a device name — this can insert a garbageMemberrow (something like a mobile number of*).- The admin alert for a failing device is commented out. Combined with the previous point, a device can be silently deleted after 10 failures with no notification sent anywhere.
- Several queried values are never used:
ServerIP,AdminEmail,AdminMobile,AlternativeAdminMobile,WAInstanceID, andWAAPIKeyare all looked up but only referenced inside the commented-out alert line. - Hardcoded to
CID=2. There's no option to process a different campaign/client ID; rows with any otherCIDare never picked up by this command.
See also
| Command | Description |
|---|---|
nodejs |
Install the latest Node.js version on a GoAdmio server |
mudslide |
Placeholder for WhatsApp helpers |
backup |
Back up one or all accounts to local disk or remote storage, manually or on a schedule |
restore |
Restore accounts, databases, SSL certificates, or folders from local or remote GoAdmio backups |