Skip to main content

Send Template Message

Sends an approved template message via the WhatsApp Business Cloud API. Template messages are pre-approved message formats that can be sent to users outside the 24-hour messaging window.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Phone Number ID - WhatsApp Business Phone Number ID from Meta Developer Portal.
  • To Phone Number - Recipient's phone number with country code (without + sign). Example: 1234567890.
  • Template Name - Name of the approved message template (must be approved in Meta Business Manager).
  • Template Parameters - Array of parameter objects for the template body variables.

Options

  • API Version - Meta Graph API version. Default is 21.0.
  • Language Code - Template language code. Default is en_US. Examples: en_US, en_GB, es, pt_BR, fr, de.
  • Header Type - Type of header component: none, text, image, video, or document. Default is none.
  • Header Value - Header content (text or media URL/ID) based on Header Type.
  • Button Parameters - Array of button parameter objects for dynamic button URLs.
  • Access Token - WhatsApp Cloud API Access Token credential (required).

Output

  • Response - The complete API response object containing message details and status.

How It Works

The Send Template Message node sends pre-approved template messages. When executed, the node:

  1. Validates all required inputs
  2. Retrieves the access token from the credential
  3. Builds the template payload with components (header, body, buttons)
  4. Constructs body parameters from the Template Parameters input
  5. Adds optional header and button components if provided
  6. Sends a POST request to the WhatsApp API
  7. Returns the API response

Requirements

  • A WhatsApp Business Account in Meta Developer Portal
  • Approved message templates created in Meta Business Manager
  • Template must be approved by Meta before use
  • Access Token with appropriate permissions
  • Correct template name and language code

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Phone Number ID
  • Empty or invalid recipient phone number
  • Empty or invalid template name
  • Template not found or not approved
  • Incorrect number of parameters for template
  • Invalid language code
  • Invalid header type or value
  • Malformed button parameters
  • Invalid access token
  • Network connectivity issues

Template Parameters Format

Template parameters should be an array of objects with type and text fields:

[
{"type": "text", "text": "John"},
{"type": "text", "text": "12345"},
{"type": "text", "text": "March 15, 2024"}
]

Button Parameters Format

For templates with dynamic button URLs, provide button parameters as an array:

[
{"text": "ABC123"}
]

The text value will replace the URL parameter in the button template.

Example: Simple Template

Template in Meta: hello_world

Hello {{1}}! Your verification code is {{2}}.

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Template Name: hello_world
  • Template Parameters:
    [
    {"type": "text", "text": "John"},
    {"type": "text", "text": "987654"}
    ]

Options:

  • Language Code: en_US

Result: User receives: Hello John! Your verification code is 987654.

Example: Template with Image Header

Template in Meta: order_confirmation with image header

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Template Name: order_confirmation
  • Template Parameters:
    [
    {"type": "text", "text": "ORD-12345"},
    {"type": "text", "text": "$99.99"}
    ]

Options:

  • Language Code: en_US
  • Header Type: image
  • Header Value: https://example.com/order-image.jpg

Example: Template with Button URL

Template in Meta: order_tracking with dynamic URL button

Button URL: https://example.com/track/{{1}}

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Template Name: order_tracking
  • Template Parameters:
    [
    {"type": "text", "text": "John"},
    {"type": "text", "text": "ORD-12345"}
    ]

Options:

  • Language Code: en_US
  • Button Parameters:
    [
    {"text": "ORD-12345"}
    ]

Result: Button URL becomes: https://example.com/track/ORD-12345

Creating Templates

Templates must be created and approved in Meta Business Manager:

  1. Go to Meta Business Manager
  2. Navigate to WhatsApp Manager > Message Templates
  3. Click "Create Template"
  4. Choose template category (Marketing, Utility, or Authentication)
  5. Define template name (lowercase, underscores only)
  6. Select language
  7. Add header (optional): text, media
  8. Add body with variables using {{1}}, {{2}}, etc.
  9. Add footer (optional)
  10. Add buttons (optional): Call to Action or Quick Reply
  11. Submit for approval (usually takes a few hours)

Template Categories

  • Utility - Order updates, account notifications, general updates
  • Marketing - Promotional messages, offers, announcements
  • Authentication - One-time passwords, verification codes

Usage Notes

  • Template names must be lowercase with underscores only
  • Parameters are 1-indexed: {{1}}, {{2}}, {{3}}, etc.
  • Templates can have up to 4096 characters in the body
  • Header can be text (max 60 chars), image, video, or document
  • Footer is optional and supports up to 60 characters
  • Templates must be approved by Meta before use
  • Each language variant must be approved separately
  • Template messages can be sent outside the 24-hour window
  • Template messages have higher delivery priority

Tips for RPA Developers

  • Create templates for common automation scenarios (order confirmations, notifications)
  • Use template messages to initiate conversations with users
  • Store template names and parameters in configuration files
  • Build a template parameter mapping system for dynamic content
  • Keep track of template approval status
  • Use Utility category for transactional messages to avoid marketing restrictions
  • Test templates thoroughly before submitting for approval
  • Create multilingual templates for international users
  • Monitor template performance metrics in Meta Business Manager

Common Errors and Solutions

Error: Template not found

  • Verify the template name is correct (case-sensitive)
  • Ensure the template is approved
  • Check the language code matches the template

Error: Invalid parameter count

  • Count the placeholders in your template ({{1}}, {{2}}, etc.)
  • Ensure you provide the exact number of parameters
  • Parameters must be in order starting from {{1}}

Error: Template not approved

  • Wait for Meta to approve the template (can take hours to days)
  • Check the approval status in Meta Business Manager
  • Review rejection reasons if template was rejected

Error: Header parameter invalid

  • For media headers, ensure URL is publicly accessible
  • Media must be in supported format (JPEG, PNG for images)
  • Check file size limits (images: 5MB, videos: 16MB, documents: 100MB)

Template Best Practices

  • Keep templates concise and clear
  • Use variables for personalization
  • Avoid promotional language in Utility templates
  • Include clear call-to-action with buttons
  • Test with different parameter values
  • Follow WhatsApp Business Policy guidelines
  • Don't send spam or unwanted messages
  • Provide opt-out mechanism if required