Skip to main content
Functions are what let a chat agent do things rather than only say things — look up an order, send a brochure, book a callback. The model decides when to call one, based on its description, and you decide what it does.

Available function types

Instagram agents support custom functions only. The template, call and media types are WhatsApp-specific.

How the agent chooses

The model reads each function’s description — for custom functions, the docstring — and matches it against the conversation. Nothing else selects a function for it. That makes the description the most important field on the form. Two rules:
Describe the trigger, not the mechanism. “Send when the customer asks how much the service costs” works. “Sends the pricing template” does not tell the model when.
Reinforce it in the system prompt. The description tells the model what the function is for; the prompt tells it that using functions is expected. Agents that never call their functions almost always have both written vaguely.

Rounds

The agent may call functions across several rounds before replying, capped by Max Function Rounds (LLM Model, default 3). One round can chain into the next — look up the order, then look up the courier, then reply. The final reply is always one additional round on top.

Two function lists

They are configured identically, and deliberately separate: a follow-up should usually be able to do far less than a live conversation.

Testing before going live

Every function type has a test path in its own form:
  • Custom functions — a Test Run tab that builds input fields from your function signature and executes it
  • Send Template and the media types — a Test Send section that sends the real thing to a phone number you enter
Use them. A broken media URL or a template with a variable mismatch fails silently in front of a customer, and the first you hear about it is the conversation going wrong.

Custom functions

Python, secrets, contact context, Direct Send

System prompt

Where you tell the agent to use them