Agents in Business Central – part 2 – the prompt
When building agents in Microsoft Dynamics 365 Business Central, one of the most powerful tools at your disposal isn’t code — it’s instructions. The way you guide and structure your agent’s behavior determines whether it becomes a reliable assistant or a confused chatbot. Good prompting isn’t optional; it’s essential.
But in the Business Central Agents you can include specific sentences that triggers platform features
If you want to learn about the architecture first you can read that in part 1:
Agents in Business Central – part 1 – the architecture – Discover Microsoft Business Central
Start with a Strong Instruction Framework
Every agent needs direction. Not just tasks, but principles. A resilient instruction set usually has three core components:

1. Responsibilities
Define what the agent is accountable for. This sets scope and boundaries.
Examples include:
- What decisions it may take independently
- When it must stop and ask the user
- What data it should handle
- Which workflows it participates in
A well-defined responsibility section prevents unintended behavior and helps the agent prioritize correctly.
2. Guidelines
This acts like your “rulebook.” Guidelines shape the agent’s personality, safety boundaries, and decision-making style.
They can include:
- Tone (e.g., professional, concise, polite)
- When to ask for clarification
- How to handle missing or incomplete information
- How to present results
Guidelines are especially important in complex or multi-step processes.
3. Task Instructions
This is where the agent receives concrete steps — the procedural knowledge.
Typical structure:
- Ordered lists
- Sub‑steps
- Deep nesting for complex tasks
These instructions act as a workflow backbone. The more explicit your instructions, the more reliable the agent becomes.
Business Central Agent –Specific instructions
Business Central’s Agent has particular behaviors that benefit from explicit instructions. These patterns help prevent errors while keeping humans in control.
1. Ask for help
Human oversight is essential, and your instructions should teach the agent when to pause.
- Ask for assistance when data is missing or unclear.
If the agent cannot find for example an item, record, or required field, it should not guess. Instead, it asks the user for clarification.
You can instruct: If items are not found, then ask for assistance - Request a user review for important steps.
After generating a document or preparing a key transaction, the agent pauses and requests approval before continuing. This keeps control where it matters.
For example: Once the Sales Quote has been created, request a review before proceeding
When that is doen you get a notification in Business Central to review it (In this example he cannot find the Kawaii Wooden door):


2. Using Memory Effectively
Agents can remember certain things, but not everything — and understanding the difference is key to designing strong prompts.
What an Agent memorized standard:
- Actions it has performed
- Results of list searches
- Values you explicitly instruct it to memorize
What it cannot Memorize
- The full state of every page it visits
This memory model protects performance but still allows context continuity.
Example workflow:
- Tell the agent to open a Purchase Invoice.
- Instruct it to memorize the “Vendor Invoice No.”
- Memorize the Vendor Invoice No.
- Reuse that value later in the instructions:
- Set the value of field XXX with the Vendor Invoice No. stored in the memory
This creates powerful multi-step logic without requiring persistent global memory.
3. Using Tools Based on Page Context
Business Central agents can perform different actions depending on the type of page they are on. Your instructions can guide them to use tools like:
- Sending a message
- Searching the current page
- Selecting a row
- Executing an action
- Setting a field value
- and allot more!
You can find the page specific tools in the “Agent Tasks” action, then “View Log Entries”.
If you select a log entry you can click on “View Details”:

4. Page‑Specific Instructions
One advanced technique is using conditional logic to adapt instructions based on what page the agent is currently interacting with.
This method allows you to:
- Provide detailed instructions only when needed
- Avoid overwhelming the main prompt
- Keep rare or complex page behaviors separate
- Improve performance and prompt caching
- Give the agent page-specific intelligence
This is especially useful for long workflows where only a few pages require very detailed instructions.
You van start the page specific instructions with:
{% if page.id == <pagenumber> -%}
And end with:
{% endif -%}
For example specific instructions for the “Item List”:

Leave a Reply