Skip to main content
Sends WhatsApp template messages. Templates must be pre-approved by Meta.

Configuration

  • whatsapp_config_id: WhatsApp connection to use (optional; falls back to the conversation)
  • template_id: WhatsApp template identifier
  • parameters: Template parameter values (dict or list, optional)
  • provider_model_name: Required when using AIField in parameters

Examples

Simple template
from kapso.builder.flows.nodes import SendTemplateNode

node = SendTemplateNode(
    id="template_1234",
    template_id="order_confirmation"
)
Template with static parameters
node = SendTemplateNode(
    id="template_5678",
    template_id="order_update",
    parameters={
        "1": "{{customer_name}}",
        "2": "{{order_id}}",
        "3": "Processing"
    }
)
Template with list parameters
node = SendTemplateNode(
    id="template_list",
    template_id="shipping_update",
    parameters=[
        "{{customer_name}}",
        "{{order_id}}",
        "{{delivery_date}}"
    ]
)
Template with AI parameters
from kapso.builder.ai.field import AIField

node = SendTemplateNode(
    id="template_ai",
    template_id="order_update",
    parameters=AIField("Generate order confirmation parameters based on order data: customer_name, order_id, status"),
    provider_model_name="claude-3-5-sonnet-20241022"
)
When placing AI fields inside lists or dictionaries, the SDK automatically produces the flattened ai_field_config paths the backend expects. For example, the first element in a list maps to parameters.0, while a dictionary entry such as {"name": AIField("Prompt")} creates an entry at parameters.name.

Template setup

Templates must be created and approved in Meta Business Manager first. Common templates:
  • Welcome messages
  • Order confirmations
  • Appointment reminders
  • Support ticket updates

Usage patterns

Order flow Notification flow
I