Writing clear, structured prompts helps your AI Agent behave more accurately and respond naturally. This guide covers how to write effective prompts for AI Agents on respond.io, including both Instructions and Actions.
Instructions vs. actions
Type | Purpose |
|---|---|
Instructions | Guides the AI Agentâs overall behavior, tone, and goal with step-by-step instructions |
Actions | Tells the AI Agent exactly when to perform these actions and how to do it (e.g. assign, close, update fields) |
Writing instructions

When creating instructions, structure them clearly so AI Agent always knows who it is, how to behave, and what steps to follow. We recommend breaking down instructions into four parts.
Element | What it does | Example |
|---|---|---|
Context | Set the scene for AI Agent. Explain who itâs talking to, and what the main goal of the conversation is. | - Youâre speaking to someone reaching out to the company. |
Role & communication style | Define how AI Agent should act and sound. Include its role, tone, and rules for communication. | - Youâre a polite, professional and efficient receptionist. |
Flow | Lay out the conversation step by step. This tells AI Agent exactly how to guide the interaction. | 1. Greet and ask: âHi 2. Based on their reply, infer intent: 3. Always thank them and let them know someone will assist shortly. 4. Ask if thereâs anything else to pass along. If not, close the conversation politely. |
Boundaries | Defines what AI Agent should not attempt (e.g. legal advice, medical diagnosis, financial advice, stock checking, ). | Do not provide: |
Follow-up | Tells the AI Agent to send an automatic message if the Contact doesnât reply within a set time (up to 1 day and up to 5 times per prompt). | If the Contact doesnât reply after 6 hours, follow up to check if theyâre still interested. |
Note: AI Agent instructions support up to 10,000 characters. If you exceed the limit, youâll be prompted to shorten your instructions before saving.
Tips for instructions
Writing clear, structured instructions helps your AI Agent behave consistently. Below is a best-practice example for a Lead Qualification Sales Agent and the key tips to follow.
# CONTEXT
* You're chatting with someone exploring our product (new, returning, or browsing). Your goal is to guide them to the right product or plan.
# ROLE & COMMUNICATION STYLE
* Be warm, helpful, and relaxedânever pushy. Ask one question at a time. Keep replies short, clear, and encouraging.
# TOP-LEVEL FLOW
1. Greet and welcome the Contact (Contact name $contact.firstname).
2. Ask, collect, and save Contact fields: name, email, and phone (all required).
3. Ask about their needs: **"Do you have a budget in mind? đ"**
## QUALIFY LEAD
1. **Qualified:** If budget â„ 100000, recommend a product based on their answers using the Knowledge Source.
1.1 If they show interest, ask: **âWould you like to book a demo or talk to someone?â**
1.2 If yes, assign to @Sales Team and update the lifecycle stage to Hot Lead. If not ready, let them know you're here if they need help later.
2. **Unqualified:** If budget < 100000, continue answering any questions they have.
# BOUNDARIES
1. Do not inform the contact that they are qualified or unqualified. Gracefully proceed with the flow.Use canonical terms (the exact names and actions from your Workspace):
Teams/agents: e.g.
@Support Team,@Sales Team,@Jane DoeActions: e.g. Assign to, Close conversation, Update Lifecycle stages, Update Contact fields
Contact fields: e.g. Name field, Email field, Phone field â so data is saved/updated correctly
Structure your instructions clearly:
Break steps into logical order (Greet â Ask â Decide â Assign)
Use point form instead of paragraphs (Shift + Enter for line breaks)
Use headers (# H1, ## H2) for each section. For example:
# CONTEXT # ROLES AND COMMUNICATION STYLE # TOP-LEVEL FLOW ## SUB-LEVEL FLOW # BOUNDARIES
Keep language clean and usable:
Write in clear, conversational English (other languages work too if canonical terms are preserved)
Use symbols (=, <, :) for comparisons or conditions
Keep grammar/spelling correct
Use emojis sparingly (to stay approachable but professional)
Be clear about capabilities:
State what the Agent can and cannot do
Donât overload instructions with details â use Actions for execution (e.g. assigning, closing, updating fields)
Organize by flows and scenarios:
Start with a top-level flow (e.g. Greet â Ask â Decide â Assign)
Break it into scenarios for common situations
Example: In the Sales Agent prompt above, âQualifying Leadâ is its own scenario
This makes prompts easier to read, update, and maintain
Writing action prompts

Action prompts are used when AI Agent performs something before sending a reply â like assigning a chat or closing the conversation.
These should be short, specific, and focused on execution.
How to write them
For each action, describe:
When it should happen (the condition)
What the Agent should do
Action | Prompt Example | Optional Customizations |
|---|---|---|
Assign to agent or team | âIf the contact says they want to speak to someone, assign to the @Sales team.â | You can specify how the assignment is made (e.g. round robin or least open conversation). |
Close conversation | âIf the issue is resolved or the Contact says âthanksâ, close the conversation and write a summary.â | You can decide whether a summary is generated when a conversation is closed. By default, a summary is created â specify âdo not generate a summaryâ if you want to turn it off. You can also set rules for which closing notes to include. |
Update Contact field | âIf the Contact shares their company name, update the Company field.â | You can define the exact value to save (e.g. âonly save if email ends with @companyname.comâ). |
Update Lifecycle stage | âIf they express interest in buying, update Lifecycle stage to âQualifiedâ.â | You can specify exactly which Lifecycle stage name should be applied. |
Tips for actions
AI Agents can be told what to do in two places:
Instructions box
Here you usually write your step-by-step flows, e.g. âGreet â Ask â Assign â Closeâ.
These are sequential instructions, meaning they run in order like a script.
Actions settings
Here you can configure non-sequential rules, e.g. âIf user asks for a human â Assign to @Support Teamâ.
These donât depend on the flow; they can trigger anytime.
For best accuracy, itâs recommended to cover actions in both places (instructions and action settings). This way AI Agent always knows what to do.
If you only add them in the instructions box, make sure the respective actions are enabled too â otherwise AI Agent wonât be able to execute them, even if your instructions mention them.
Writing prompts for follow-ups
AI Agents can automatically send follow-up messages when a Contact doesnât respond after a specific time â helping you keep conversations going and increase engagement.
To enable this, add clear follow-up instructions in the Instructions section of the AI Agent configuration page.
Hereâs an example showing how an AI Agent handles follow-ups, responses, and conversation closure:
If the customer doesn't reply after 2 minutes, send a gentle follow-up like: "Hey, you still there? No rush, just checking in." If there's still no reply, close the conversation, update lifecycle to Cold Lead, and say "I'll close the conversation. Feel free to ping me anytime you wish to continue!"How this works:
After 2 minutes of no response, AI Agent automatically sends the follow-up message.
If the Contact still doesnât respond after that, AI Agent executes the next actions in the prompt â closing the conversation, updating Lifecycle status, and sending the final message.
If the Contact replies before the last action in your prompt, all remaining follow-up actions are cancelled and the conversation continues as normal.
This example shows how you can chain multiple steps into a single follow-up flow within your prompt.
Follow-up basics
AI Agent checks if the Contact hasnât replied after the time you specify in your prompt.
If no response is received within that time, AI Agent sends the follow-up message you define.
Follow-up sequence stops automatically if:
The Contact replies before the scheduled time
The conversation is unassigned or closed
AI Agent determines the Contact is no longer interested, has said goodbye, or the objective is achieved
You can include one or multiple follow-ups in your prompt to handle different scenarios or escalation steps.
If youâve written follow-up instructions before the Follow-Up feature was launched, youâll need to resave your template for the changes to take effect.
Follow-Up Limits
Each follow-up must be scheduled within 24 hours (1 day) of the previous message.
You can include up to 5 follow-ups per prompt, each with its own timing, message, and actions (e.g., send a reminder, assign a user, or close the conversation).
AI Agent will follow the timing defined in your prompt, but messages sent outside WhatsAppâs 24-hour window may fail to deliver.
After the final follow-up, AI Agent continues any remaining actions defined in your prompt (e.g., assigning or sending messages).
Using the prompt optimizer

When editing instructions or action prompts, you can use the prompt optimizer tool to improve clarity and phrasing while keeping the original intent.
Use it when:
You want a more polished or structured version of your prompt
Youâre not sure how to phrase things clearly
Youâre starting from scratch and want guidance
Simply click Optimize, review the suggested rewrite, and adjust if needed.
This works for both general instructions and specific actions like assigning conversations or closing chats.
Using variables
Variables make responses feel personal and accurate.
Variable | Use |
|---|---|
| Mentions user and team names |
| Pulls info from contact fields (e.g. $contact.email) |
Variables can be used in both instructions and actions â especially when gathering or referencing Contact details.
Using the @ variable

The @ variable allows AI Agents to assign a conversation to a specific team, human agent, or another AI Agent based on the instructions or action prompt.
It supports routing that mimics manual assignments made in the Inbox â making it especially useful in templated actions.
Use case | Prompt example | What happens |
|---|---|---|
Assign to a specific team | âIf the Contact is asking about product pricing or discounts, assign the conversation to @Sales.â | Routes the conversation directly to the Sales team |
Assign to a specific agent | âIf the Contact has a pending order issue they discussed with David before, assign the conversation to @David Lee.â | Assigns the conversation to a specific human agent in your Workspace |
Assign to another AI Agent | âIf the Contact needs troubleshooting help, assign the conversation to @Support Agent.â | Hands off the conversation to another AI Agent you have configured |
If Contact requests help from a human | âIf the Contact asks to speak with a real person at any time, assign the conversation to any team using round robin.â | Assigns to the next available team in a fair rotation |
If unsure of the right team | âIf you cannot determine the topic or team after two clarification questions, assign the conversation to anyone by least open conversations.â | Routes the conversation to the anyone in the workspace with the fewest active conversations |
Assign to a specific team by round robin or least open conversation | âIf the Contact is asking about product pricing or discounts, assign the conversation to @Sales by Round robin / Least opened conversationâ | Routes the conversation to the anyone in a team by either round robin or with the fewest active conversations |
Tips for variables
Use clear logic in your action prompts (e.g. âIf the Contact asks about pricing, assign to @Sales.â).
If possible, align your Workspace team structure with how you want to use AI Agents for routing.
Using Contact field variables in prompts

You can use $contact.fieldName to dynamically reference a Contactâs existing information. These are especially useful when:
You want AI Agent to personalize its greeting or response
You need to verify or confirm details the Contact has previously shared
You want to avoid asking for info thatâs already available
Use case | Prompt with variable |
|---|---|
Confirming a Contactâs name | âHi |
Verifying email before sending a quote | âI see your email is |
Referencing status in a follow-up | âIt looks like your current status is |
Personalizing based on previous inquiry | âThanks for reaching out again about |
Confirming preferred language or region | âWould you like to continue in |
Tips for Contact field variables
Contact field variables personalize your Agentâs responses and help it save or update customer data automatically.
What happens behind the scenes: When AI Agent is generating a reply, variables are swapped with the actual value from the Contact profile.
Example:
$contact.nameâ becomes âWilsonâ in the conversation.
What AI actually sees: AI Agent only sees the value (âWilsonâ), not the variable label (
$contact.name).
Why this matters
If you just write âthe email you gave earlierâ, AI Agent wonât know you meant
$contact.emailâ it will only see the value (like wilson@email.com), and could get confused if multiple emails are mentioned.By always referencing the field name and the value (e.g., Email:
$contact.email, Phone number:$contact.phone), you make it crystal clear which piece of information youâre talking about.If you want AI Agent to save or update a field, be explicit and mention the field ID in your prompt:
Example: âSave and update the email field if the user provides a new one.â

Prompt examples
Now that youâve learned how to structure prompts, use variables, and write clear instructions, letâs look at some full examples. These compare good prompts vs bad prompts so you can see how the best practices come together in real life.
Example 1
Good prompt
# CONTEXT
* Guide pricing-page visitors to the right plan.
# ROLE & COMMUNICATION STYLE
* Warm, concise; one question at a time.
# TOP-LEVEL FLOW
1) Greet the customer using their name: $contact.firstname
2) Ask & save **Name field**, **Email field**, **Phone field**
3) Ask budget
## SCENARIOS
* If budget â„ 100000 â Recommend plan; ask demo
- If yes â **Assign to @Sales Team**; **Update Lifecycle stages** â **Hot Lead**
* Else â Answer questions; keep chat helpful
# BOUNDARIES
* Can: Recommend, **Assign to**, **Update Contact fields**, **Update Lifecycle stages**
* Cannot: Offer discounts or take paymentsWhy this works:
Clear headers, top-level flow, scenarios.
Fast to read, easy to maintain.
Bad prompt
Hey welcome! get their info and budget, recommend something, maybe send to sales if theyâre big.
If theyâre not sure, just keep chatting and donât say theyâre qualified or whatever. weâll figure it out later and close it.Why this doesn't work:
No headers, no sections, no sequence.
Readers must guess the order and actions.
Example 2
Good prompt
# CONTEXT
* Triage product issues and route correctly.
# ROLES AND COMMUNICATION STYLE
* Calm, professional, friendly đ
# TOP-LEVEL FLOW
1) Greet the customer with their name: $contact.firstname
2) Ask for a brief summary and steps already tried
## SCENARIOS
* Urgent (login blocked | data loss | outage) â **Assign to @Support Team**; set expectations
* Non-urgent â Provide steps/help doc; if resolved **Close conversation**; else **Assign to @Support Team**
# BOUNDARIES
* Can: Share guides.
* Cannot: Access billing, reset passwords, change ownership.Why this works:
Clean, professional English with precise terms.
Canonical actions/teams/fields are used verbatim.
Bad prompt
hi there pls help user with issues
- if its urgent ping tech team.
- grab name/email/phone if u can.
- if theyâre vip send to sales team. close when done n mark hot leadWhy this doesn't work:
Slang/typos (âplsâ, âsuppot teemâ), vague actions, inconsistent capitalization.
No canonical team names or action verbs.
Example 3
Good prompt
# CONTEXT
* Handle enterprise feature requests and handoffs.
# ROLES AND COMMUNICATION STYLE
* Transparent, not pushy.
# TOP-LEVEL FLOW
1) Ask and update: **Name field**, **Email field**, **Phone field**
2) Confirm needs and budget
## ACTION STEPS (Correct Order)
* Demo requested AND budget â„ 100000:
1) Recommend plan; confirm demo
2) **Assign to @Sales Team**
3) **Update Lifecycle stages** â **Hot Lead**
4) Summarize next steps; confirm
5) **Close conversation**
* Info only / not ready:
- Share overview; keep Q&A
- **Close conversation** only after they confirm done
# BOUNDARIES
* Can: Recommend plans.
* Cannot: Offer discounts, modify contracts.
Why this works:
Each action has prerequisites and exact order.
Separate step lists remove ambiguity.
Bad prompt
If someone asks for enterprise features:
- close the chat to keep it tidy
- then mark them Hot Lead and later assign sales if they reply again.
- Get email if needed.Why this doesn't work:
Assigns before identifying; updates lifecycle randomly; closes too early.
No clear triggers for each action.
FAQs and Troubleshooting
I included a follow-up in my prompt, but itâs not working. Why?
Here are a few possible reasons why your follow-up prompt isnât working as expected:
Follow-up duration too long: The time you set is over 24 hours. Follow-ups must be within 1 day.
Prompt not saved after updates: If your prompt was created before the Follow-Up feature was launched, youâll need to resave your template for it to take effect.
Conversation status: Follow-ups wonât run if the conversation is closed or unassigned, or if the AI Agent detects the Contact is no longer interested, has said goodbye, or the objective is achieved.
System error: If everything looks right but it still doesnât work, try saving again. If the issue persists, reach out to your workspace admin or support.
I instructed the AI Agent to follow up twice, but there are three follow-ups in total. Why?
When you include an instruction like âFollow up twice, then close the conversationâ, the AI will:
Send two follow-up messages, as instructed.
Then send one final message while performing the closing action.
Thatâs why youâll see three total messages â one message is always tied to the close action.
If you only want two messages in total, write your prompt more specifically. For example:
Follow up after 2 minutes. Then if thereâs still no reply after another 2 minutes, close the conversation and tell the customer they can reach out anytime to continue.
The Contactâs WhatsApp window closed before the follow-up. What happens next?
If a WhatsApp conversation window closes before the follow-up is sent, the AI Agent will still execute the follow-up sequence as usual.
The message itself will fail to send (since itâs outside WhatsAppâs 24-hour limit).
The AI Agent will still complete the follow-up actions (e.g., closing the conversation or updating Lifecycle).
Users will see a failed-to-send icon next to the unsent message in the Inbox.
Need help with your AI Agent?
Our Support team is here for you anytime.