See llms.txt for all machine-readable content.

Back to Templates

Monitor WhatsApp template health with OpenAI, Gmail and Slack alerts

Quick overview

This workflow runs daily to check WhatsApp Cloud API phone number health and message template status via the Meta Graph API, compares results with the previous run, optionally generates OpenAI rewrite suggestions for newly rejected templates, and sends severity-based alerts via Gmail (and optional Slack) with Google Sheets logging.

How it works

  1. Runs every morning at 8:00 (or manually) and loads your WhatsApp Business Account, phone number IDs, and alert settings.
  2. Calls the Meta Graph API to fetch health details for each configured phone number (quality rating, status, messaging limit tier, and display name status) and lists all message templates in the account with pagination.
  3. Consolidates the results into a single “health snapshot,” turning any Graph API failures into actionable issues with suggested fixes.
  4. Compares the snapshot to the previous baseline stored in workflow static data so only new issues, resolved issues, and messaging-limit tier changes are reported (or sends a daily summary if enabled).
  5. For newly rejected templates (when enabled), uses an OpenAI chat model to read the template details from the Meta Graph API and attach a suggested BODY rewrite and category adjustment to the report.
  6. Builds an HTML alert, optionally posts critical alerts to Slack, sends the full alert email via Gmail, then saves the current snapshot as the next baseline and optionally appends Errors and Health log rows to Google Sheets.

Setup

  1. Create a WhatsApp Cloud API (Meta Graph API) credential using a permanent System User access token with whatsapp_business_management permission and access to your WhatsApp Business Account.
  2. Add a Gmail credential for sending alert emails and set the recipient address in the workflow settings.
  3. Add an OpenAI credential (used for rejected-template rewrite suggestions) and disable AI suggestions if you don’t want OpenAI involved.
  4. In “Set Health Check Settings,” replace the YOUR_ placeholders (waba_id, phone_number_ids, alert_email, and optional sheet_url) and optionally set watched_templates, slack_alerts/slack_channel, and the logging toggles.
  5. If Google Sheets logging is enabled, provide a Google Sheets credential and ensure the target spreadsheet contains the specified tab names (for example, “Errors” and “Health log”).
  6. If Slack alerts are enabled, add a Slack credential and ensure the configured channel (for example, #whatsapp-alerts) exists.