Open the flow canvas
Chat agents → your agent → Flow → drag in AI assistant
The Fields
Everything the flow has collected so far is appended to the prompt
automatically, so the model already knows the visitor’s name, their order id and
anything else an earlier card asked for. You do not have to paste variables into
the instructions.
Blocks publish: no instructions.
When The Card Ends
There is no turn cap and no “Done” button. The card ends when the assistant callsfinish_conversation, then the flow takes the card’s single exit.
That is deliberate. A counter ends a conversation mid-sentence, and a
“That’s all, thanks” pill asks the visitor to answer a question only the
assistant is placed to judge.
The assistant is instructed to finish only when the person has clearly
signalled they are done — goodbye, thanks that’s all, or confirming their
question is fully answered. It is explicitly told not to finish because it
could not help, because a function failed, because it did not understand, or
because the request is outside its remit. In those cases it says so and lets the
visitor decide.
The conversation as a whole is still bounded by the session limit of 200 turns,
and there is a backstop at 30 exchanges on a single AI card. Neither should ever
be reached in a real conversation.
Functions
Two kinds, and they mirror the WhatsApp chat agent’s function editor field for field.Custom — your own Python
Write a LangChain tool. Decorate it with@tool, and its signature is the
parameter list — nothing is declared separately.
Send image / send document
No code. You give a name and a description; the assistant supplies the link.
The description is where you say where the link comes from — “the URL
returned by
lookup_invoice”, or a fixed address. Same arrangement as the
WhatsApp send functions.
What Your Code Can See
Three objects are injected into every custom function. No imports, no setup.x_vars
Everything the flow has collected — Ask answers, Set values, API mappings,
and anything passed in on the URL as
vars.x_contact
The CRM record for whoever is in this conversation — name, email, tags,
custom attributes.
x_secrets
Your account’s secrets by name, so an API key never has to sit in plain
text inside a flow graph.
asyncio, httpx, json, re.
Manage secrets at
Settings → Secrets.
Files, Both Directions
The AI card is one of only two places a visitor can attach something (the other is a human handoff). The composer shows a paperclip and a microphone.In — what the visitor sends
A PDF is fetched and its text extracted server-side, because no model here takes
a PDF directly. If nothing could be extracted the model is told that explicitly,
rather than the attachment being quietly dropped.
Out — what the assistant sends
Asend_image or send_document call delivers the file to the visitor and
writes it into the dashboard transcript as its own message with a real link — so
a conversation full of images does not read as a conversation of empty replies.
What Gets Recorded
Every AI turn is stored so somebody reviewing the conversation can see what actually happened:- The reply, as the visitor read it
- Every function call, with its arguments and its result, shown in the timeline’s tool panel
- Every file sent, as its own message with the link
- The cost of the turn
Billing
An AI card is the only card that runs a model, and it is the only one that costs anything.- Accounts on per-message pricing are charged their per-AI-message rate for the turn.
- Everyone else is charged the real model cost, which is recorded on the message itself.
Billing
Plan, rates and the Widgets subscription
Writing A Good AI Card
Give it one job, not the whole product
Give it one job, not the whole product
An AI card that “handles anything” is a prompt nobody can test. Route the
known topics with Buttons cards and let the AI card take what is left —
then its instructions can be specific enough to be correct.
Collect before you hand over
Collect before you hand over
Ask for the order id on a scripted card first. The model then starts with
it in
x_vars instead of spending a turn asking, and your function can look
it up immediately.Say what to do when a function fails
Say what to do when a function fails
Errors reach the model as text. Without an instruction it will improvise.
“If a lookup fails, tell the person exactly what the error said and offer
to pass them to a person” is usually what you want.
Make the description say when, not what
Make the description say when, not what
The docstring already says what the function does. The Description field is
read as usage instructions — “use this whenever the person asks about a
delivery date” — and that is what makes the model call it at the right
moment.
Point the exit somewhere real
Point the exit somewhere real
When the assistant finishes, the flow takes the card’s single exit. Wire it
to an End card with a closing line, or back to your main menu — not to
nothing.
Limits
Next Steps
Variables and identity
What lands in
x_vars, and how uid worksCard types
The other thirteen cards