See llms.txt for all machine-readable content.

Back to Templates

Send WhatsApp templates from Google Sheets with Cosend and update statuses

Quick overview

This workflow runs every five minutes to read new rows from Google Sheets, send an approved WhatsApp template message via Cosend to each phone number, and then update the sheet with a sent/failed status plus timestamp or error details.

How it works

  1. Runs every five minutes on a schedule trigger.
  2. Reads rows from a selected Google Sheets worksheet.
  3. Keeps only rows that have a non-empty phone number and an empty status field, then limits processing to 50 rows per run.
  4. Sends a WhatsApp template message through Cosend to each row’s phone number, inserting the row’s name into the template body.
  5. Updates the corresponding Google Sheets row as sent with a timestamp when the message succeeds.
  6. Updates the corresponding Google Sheets row as failed with the Cosend error code/message when the send fails.

Setup

  1. On self-hosted n8n, install the community node package n8n-nodes-cosend.
  2. Create a Google Sheets OAuth connection, then select the target spreadsheet and worksheet in the read and update steps.
  3. In the Cosend dashboard, open Settings > Developer > API keys, create a key and add it in n8n as a Cosend API credential. Then pick your approved WhatsApp template (one body variable for the first name) and its language.
  4. Give your sheet a header row with phone and name. Numbers carry their country code. The workflow adds the status, sent_at and error columns the first time it writes, and skips rows that already have a status.