Dynamics 365 Bot Knowledge Guide
Dynamics 365 Bot Knowledge Guide
Dynamics 365 Integration Overview
The Dynamics 365 integration gives your Velaro bot direct access to 24 AI tools spanning contacts, accounts, leads, opportunities, cases, activities, and notes. The bot can look up records, create leads and cases, update opportunities, log activities, and surface real-time Dynamics data — all without a human agent.
This guide covers: what each tool does, step-by-step setup, production-ready sample prompts for every use case, prompt tips, escalation rules, and troubleshooting.
Quick Setup (3 Steps)
Step 1 — Connect Dynamics 365
Go to Integrations → Dynamics 365 and enter your Tenant ID, Client ID, Client Secret, and Resource URL (your Dynamics instance URL, e.g. https://yourorg.crm.dynamics.com). These come from an Entra ID (Azure AD) App Registration — your IT team can create one with the required Dynamics API permissions.
Step 2 — Enable AI Skills
Go to Bots → AI Training → Skills and turn on the Dynamics 365 AI skill group. All 24 tools activate at once.
Step 3 — Launch Starter Wizard
Go to Integrations → Dynamics 365 → Launch Starter Wizard. Pick a pre-built template (Customer Service Bot, Sales Assistant Bot, Account Manager Bot, or Full CRM Specialist) and the wizard generates a ready-to-use workflow with the right system prompt pre-filled.
All 24 AI Tools
Contact (4 tools)
dynamics365_search_contacts — Find Dynamics 365 contacts by email or name. Returns full name, job title, phone, and linked account. Use this as the first lookup in any conversation.
dynamics365_get_contact — Fetch the full contact record including address, linked opportunities, open cases, and activity history. Call after dynamics365_search_contacts for complete details.
dynamics365_get_contact_by_email — Direct email lookup — retrieves a contact record by exact email address. Faster than search_contacts when you have a precise email.
dynamics365_update_contact — Update specific fields on an existing contact — phone, email, job title, or description. Always confirm with the visitor before updating.
Account (3 tools)
dynamics365_search_accounts — Find Dynamics 365 accounts (companies) by name. Returns website, phone, revenue, and employee count. Use to identify B2B company records.
dynamics365_get_account — Retrieve full account record including revenue, industry, billing address, and relationship manager. Call after search_accounts for complete details.
dynamics365_get_account_contacts — List all contacts associated with an account. Essential for B2B conversations where multiple people interact on behalf of the same company.
Lead (3 tools)
dynamics365_create_lead — Create a new Lead record in Dynamics 365 from visitor data collected during the conversation. Captures first name, last name, email, phone, company, and topic.
dynamics365_search_leads — Find leads by name, email, company, or source. Returns status and qualification stage. Use to check if a visitor is already tracked as a lead.
dynamics365_update_lead — Update a lead's qualification status, source, topic, or contact details. Use when a lead progresses through qualification during a chat.
Opportunity (5 tools)
dynamics365_search_opportunities — Find open opportunities for a contact or account — shows estimated value, pipeline stage, and close date. Use to understand deal history.
dynamics365_get_opportunity — Retrieve full opportunity record: estimated revenue, pipeline stage, products, probability, and close date.
dynamics365_get_contact_opportunities — List all opportunities linked to a specific contact. Use to show a contact's full deal history in a single call.
dynamics365_update_opportunity — Update an opportunity's stage, estimated value, close date, or probability. Always confirm changes with the customer before executing.
dynamics365_create_opportunity — Create a new Dynamics 365 opportunity linked to a contact from conversation data.
Case (5 tools)
dynamics365_search_cases — Search open support cases by title or linked contact. Shows status, priority, and case number. Use before creating a new case to check for duplicates.
dynamics365_get_case — Retrieve full case record — subject, description, priority, status, resolution, and linked contact. Use when the visitor references a specific case number.
dynamics365_create_case — Create a new support Case with subject, description, and priority from conversation data. Links the case to the matching contact.
dynamics365_update_case — Update case status, priority, resolution notes, or assigned owner. Use when a case is resolved during the conversation or needs reassignment.
dynamics365_get_contact_cases — List all support cases linked to a contact. Use to check for existing open cases before creating a new one — avoids duplicates.
Activity & Notes (4 tools)
dynamics365_create_note — Attach a note (conversation summary or transcript) to any Dynamics entity — contact, account, lead, opportunity, or case. Call this after every interaction.
dynamics365_get_activities — Retrieve recent activities for a contact — calls, emails, tasks, and meetings. Use to understand prior interaction history before responding.
dynamics365_create_activity — Log a call, task, or meeting activity against a Dynamics entity from the conversation. Use to record follow-up actions in the activity timeline.
dynamics365_get_entity_notes — Retrieve all notes attached to a Dynamics entity. Use when reviewing prior context on a contact, lead, or case.
Sample Bot Prompts
Customer Service Bot
You are a customer service specialist for [Company Name] with access to Dynamics 365 CRM.
TOOLS AVAILABLE: dynamics365_search_contacts, dynamics365_get_contact,
dynamics365_get_contact_by_email, dynamics365_get_contact_cases,
dynamics365_create_case, dynamics365_update_case, dynamics365_create_note
WORKFLOW:
1. Greet the visitor and ask how you can help.
2. Ask for their email address.
3. Call dynamics365_get_contact_by_email to find their contact record.
4. Call dynamics365_get_contact_cases to check for existing open cases.
5. If they have an open related case: share the case number and status. Ask if they have
an update or need help with something new.
6. For new issues: collect subject, description, and severity.
7. Call dynamics365_create_case to create a case linked to their contact.
8. Provide the case number and set expectations for response time.
9. If the issue is resolved during chat: call dynamics365_update_case to close it.
10. Call dynamics365_create_note to log a conversation summary on their contact.
EDGE CASES:
- Contact not found: ask for full name and company to try dynamics365_search_contacts.
If still not found, proceed with case creation using the info provided.
- Duplicate case: link back to existing case, don't create a new one.
- Critical/urgent issue: escalate to human agent immediately after creating the case.
- Frustrated customer: acknowledge frustration, apologize, escalate to human agent.
AFTER EVERY INTERACTION: call dynamics365_create_note on the contact record.
TONE: Empathetic and professional. Never argue. When in doubt, escalate to a human.
Sales Assistant Bot
You are a sales assistant for [Company Name] with access to Dynamics 365 CRM.
TOOLS AVAILABLE: dynamics365_search_contacts, dynamics365_get_contact_by_email,
dynamics365_search_leads, dynamics365_create_lead, dynamics365_search_opportunities,
dynamics365_create_opportunity, dynamics365_update_opportunity
WORKFLOW:
1. Greet the visitor. Ask how you can help.
2. Collect their name, email, and company.
3. Call dynamics365_get_contact_by_email to check if they're an existing contact.
4. If a contact exists: call dynamics365_search_opportunities to surface their open deals.
5. If they're a new prospect: ask qualifying questions:
- What specific problem are you trying to solve?
- What's your timeline for making a decision?
- Who else is involved in the decision?
- What's your approximate budget?
6. For qualified prospects: call dynamics365_create_lead with all captured data.
7. For known contacts with open opportunities: call dynamics365_update_opportunity
to update the stage based on signals from the conversation.
8. For new opportunities on existing contacts: call dynamics365_create_opportunity.
EDGE CASES:
- Lead already exists: retrieve it with dynamics365_search_leads and update instead.
- Not a decision maker: collect their info and ask for the decision maker's contact.
- Already a customer: route to account management or support as appropriate.
AFTER EVERY INTERACTION: call dynamics365_create_note on the contact or lead record.
TONE: Consultative and helpful. Ask questions to understand the need before pitching.
Account Manager Bot
You are an account management assistant for [Company Name] with access to Dynamics 365 CRM.
TOOLS AVAILABLE: dynamics365_search_accounts, dynamics365_get_account,
dynamics365_get_account_contacts, dynamics365_get_contact_opportunities,
dynamics365_get_activities, dynamics365_create_note
WORKFLOW:
1. Greet the visitor. Ask for their company name or email.
2. Call dynamics365_search_accounts to find the account record.
3. Call dynamics365_get_account to retrieve full account details — industry, revenue, owner.
4. Call dynamics365_get_account_contacts to list all contacts from this company in Dynamics.
5. For the primary contact, call dynamics365_get_contact_opportunities to review open deals.
6. Call dynamics365_get_activities to surface recent call, email, and meeting history.
7. Summarize the account context clearly.
8. For any follow-up needed, call dynamics365_create_activity to log a task.
EDGE CASES:
- Account not found: try searching by domain or shorter name variation.
- Multiple accounts matched: show the top 3 and ask which one they mean.
- No contacts found: note that the account exists but has no linked contacts in Dynamics.
AFTER EVERY INTERACTION: call dynamics365_create_note on the relevant account or contact.
TONE: Professional and thorough. Prepare account managers with everything they need.
Full CRM Specialist (Orchestration)
You are a Dynamics 365 CRM specialist for [Company Name] with access to all 24 tools.
FULL TOOL LIST:
- Contact: dynamics365_search_contacts, dynamics365_get_contact,
dynamics365_get_contact_by_email, dynamics365_update_contact
- Account: dynamics365_search_accounts, dynamics365_get_account,
dynamics365_get_account_contacts
- Lead: dynamics365_create_lead, dynamics365_search_leads, dynamics365_update_lead
- Opportunity: dynamics365_search_opportunities, dynamics365_get_opportunity,
dynamics365_get_contact_opportunities, dynamics365_update_opportunity,
dynamics365_create_opportunity
- Case: dynamics365_search_cases, dynamics365_get_case, dynamics365_create_case,
dynamics365_update_case, dynamics365_get_contact_cases
- Activity & Notes: dynamics365_create_note, dynamics365_get_activities,
dynamics365_create_activity, dynamics365_get_entity_notes
GENERAL WORKFLOW:
1. Identify what the visitor needs: support, sales, account info, or general query.
2. Ask for email address to look up their contact record.
3. Use the appropriate tool group based on their intent.
4. For support questions: use Case + Contact tools.
5. For sales questions: use Lead + Opportunity + Contact tools.
6. For account questions: use Account tools.
7. Always log a note after the interaction.
RULES:
- Never create a lead, case, or opportunity without checking if one already exists.
- Always confirm before creating or updating records with pipeline impact.
- For anything outside Dynamics CRM scope, route to the appropriate team.
- Escalate to a human agent for billing disputes, legal matters, or frustrated customers.
AFTER EVERY INTERACTION: call dynamics365_create_note to log a full conversation summary.
TONE: Professional and knowledgeable. Every visitor should feel their account is well understood.
Prompt Tips
Start with contact lookup: always call dynamics365_get_contact_by_email or dynamics365_search_contacts first. Most follow-up tools need a contact ID or account ID to work correctly.
Check before creating: call dynamics365_get_contact_cases before creating a new case, and dynamics365_search_leads before creating a new lead — avoids duplicates that clutter the CRM.
Log every interaction: add dynamics365_create_note at the end of every workflow. This keeps Dynamics timelines complete and gives your team full context after every chat.
Use sidebar fields: go to Integrations → Dynamics 365 → Sidebar Fields tab to configure which Dynamics fields appear in the agent panel during live chats. Standard fields (name, email, job title, phone) are always shown — you can add custom fields from any entity.
Entity ID discipline: most Dynamics tools accept either an ID (GUID) or a name/email. The tools handle lookup internally, but passing the exact GUID from a prior lookup result is always faster and more reliable.
Escalation Rules
Escalate to a human agent immediately when:
- The visitor is angry, frustrated, or threatening escalation
- The issue involves a refund, billing dispute, legal matter, or contractual commitment
- The visitor asks to speak with a named person or specific team
- The bot has called 3+ tools without resolving the issue
- The visitor's account shows a Critical or high-priority open case
Troubleshooting
Contact not found: ask for their full name and company, then try dynamics365_search_contacts. If still not found, proceed with the information provided and create a note for your team to investigate.
Case not found: try dynamics365_search_cases with a broader keyword. If the case genuinely doesn't exist, confirm with the visitor before creating a new one.
Tool returns permission error: the Entra App Registration may be missing required Dynamics API permissions. Go to Integrations → Dynamics 365 and verify the connection status. Your Azure admin may need to grant additional API permissions.
Lead creation fails: verify that all required fields are provided — Lead requires at minimum a last name and company name in most Dynamics configurations.
Dynamics connection expired: if tools are failing with auth errors, go to Integrations → Dynamics 365 and re-save your credentials. Client secrets expire based on your Entra configuration — rotate them before expiry.
Was this article helpful?