Prompts
How to write the instructions each step follows, in ways that hold up in real conversations.
Start, Agent, Global and End steps each have a Prompt: the instructions the agent follows on that step. Three terms you'll see here:
- Step prompt: the instructions for one step.
- Persona: tone and standing rules, written once in the Persona card's Global Prompt and added to every Agent and Global step.
- Variable: a
{{...}}placeholder filled in from the conversation's own data. Type{{in a prompt to pick one.
Scope one prompt to one job
A step's prompt covers one exchange. When the job changes, add a step.
Not so good
You are a booking agent. Greet the caller, find out what they need, check whether
we cover their postcode, collect their name and number, offer three slots, take a
card deposit if the job is over two hours, and confirm everything back to them.Better
Find out what the caller needs doing and where they are.
Ask what the job is, then ask for their postcode. Do not discuss slots, prices or
payment. A later step handles those. Once you have both, you are done.A prompt with four goals gives you an agent that drifts between them. Split into steps, you can see the shape of the conversation on the canvas, and when something goes wrong there's just one step to fix.
End each turn with a handoff
End the prompt with something that hands the turn back to the caller: a question, a confirmation. If it doesn't, both sides end up waiting in silence. On an End step do the opposite: say what happens next, say goodbye, and don't ask anything new.
Name steps for the person reading the transcript
Step names show up in your call logs, not just on the canvas. Confirm slot and read back details tells you where a conversation went wrong. Agent 4 doesn't.
Use data from earlier in the conversation
| Variable | Filled with |
|---|---|
{{initial_context.X}} | A value known before the conversation started, such as a column from a campaign list |
{{gathered_context.X}} | A value written earlier in the conversation, such as digits from a Collect Digits step |
{{gathered_context.extracted_variables.X}} | A value the model took from what the person said at an earlier step |
{{gathered_context.tool_outputs.TOOL.X}} | A field from a contact lookup's reply (see Steps) |
{{current_time_Europe/London}} | The current time in that time zone |
{{current_weekday_Europe/London}} | Today's day name in that time zone |
Paths can go deeper too, so {{gathered_context.customer.address.city}} works as you'd expect.
Give every variable a fallback
A variable with no value is replaced by nothing at all, leaving a gap in the sentence.
Not so good
Thanks {{initial_context.first_name}}, I'll get that booked for you.Better
Thanks {{initial_context.first_name | there}}, I'll get that booked for you.Without the fallback, a contact with no first name hears "Thanks , I'll get that booked for
you." Add the | fallback whenever you write a variable.
A variable only has a value if something earlier in the conversation sets it. If a detail is collected on one branch, it's empty on every other branch.
Put persona in one place
Tone and standing rules, like never quote a price, belong in the Persona, written once. So do facts any step might need: opening hours, fees, the address. An agent can have only one Persona.
If you copy a persona into nine prompts, they drift apart the first time someone edits one. Written once, it can't.
Next
See which step should carry a prompt, how to join steps in the Builder, or how to let a prompt trigger an action with Tools and answer from your own documents with Knowledge.
Common questions
How long should a step's prompt be?
Short, with one job. When the job changes, add a step instead of making one prompt cover several goals.
How do I use information from earlier in the conversation?
Type two curly brackets in a prompt and pick a variable, such as a column from a campaign list or something the contact said earlier.
What happens if a variable has no value?
It is replaced with nothing, leaving a gap in the sentence. Add a fallback after a bar, like first_name | there, so the line still reads well.
Where do tone and standing rules go?
In the Persona card, written once. It is added to every Agent and Global step, so you do not repeat it in each prompt.