{"title":"Run an agent (preview)","url":"https://jonas-paprotka.de/docs/dev-itpro/ai/ai-development-toolkit-run-agent/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-run-agent, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-run-agent","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn how to trigger an agent in Business Central. Optimize agent behavior with structured guidelines and clear steps.","date":"2026-10-02","meta":{"topic":"concept-article"},"outline":[{"level":1,"title":"Run an agent (preview)","slug":"run-an-agent-preview","at":0,"chars":3558},{"level":2,"title":"Defining tasks","slug":"defining-tasks","at":904,"chars":1149},{"level":3,"title":"How to trigger your agent","slug":"how-to-trigger-your-agent","at":1092,"chars":961},{"level":2,"title":"Testing and continuous improvement","slug":"testing-and-continuous-improvement","at":2053,"chars":411},{"level":2,"title":"Related information","slug":"related-information","at":2464,"chars":1094}],"text":"# Run an agent (preview)\n[This article is prerelease documentation and is subject to change.]\n> IMPORTANT\n > This is a preview feature. Preview features might have restricted functionality and are subject to supplemental terms of use<https://www.microsoft.com/en-us/business-applications/legal/supp-powerplatform-preview/>.\n > The AI development toolkit is available in sandbox environments only. The Agent SDK for AL is available in sandbox environments and, starting from version 28.1, also in production environments.\n > This article is primarily intended for product owners, domain experts, consultants, and developers who want to experiment with AI capabilities in Business Central.\nTo get an agent up and running effectively, you need to configure its instructions, tasks, and permissions appropriately. See Write effective instructions for an agent (preview)<ai-development-toolkit-instructions>.\n## Defining tasks\nA task represents a specific unit of work that the agent needs to perform. Each task is associated with a set of instructions that guide the agent on how to complete it.\n### How to trigger your agent\nThere are two ways to trigger a task for your agent:\n1. Manually via the Agent Tasks page in Business Central through the Run task action. If you haven't defined a task, you can create one on the fly by providing the necessary details in the task creation dialog. See Create and activate an agent (preview)<ai-development-toolkit-agent-create>.\n2. Through the Tasks AL API, which allows for integrating both with UI elements such as actions and with events such as receiving an email or a sales order posting. See Integrate with the Tasks AL API<ai-development-toolkit-tasks-api>.\nWhen creating a task, you can specify an extra message that gets passed to the agent to complement the general instructions with specific details for that particular task. Each task you create appears in the agent's task queue, where the agent picks it up and processes it according to its instructions. Tasks can be stopped and restarted as needed.\n## Testing and continuous improvement\nOnce your agent is set up and tasks are created, it's important to monitor its performance and make adjustments as necessary. Use the insights gained from task executions to refine your agent's instructions and improve its effectiveness over time. Learn more about continuously improving your agent in Iterate and manage an agent (preview)<ai-development-toolkit-iterate>.\n## Related information\nOverview (preview)<https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-landing-page>\nDesigning and coding agents (preview)<ai-development-toolkit-overview>\nCreate and activate (preview)<ai-development-toolkit-agent-create>\nWrite effective instructions (preview)<ai-development-toolkit-instructions>\nInstruction keywords (preview)<ai-development-toolkit-instruction-keywords>\nIntegrate with the Tasks AL API (preview)<ai-development-toolkit-tasks-api>\nAttachment capabilities and limitations (preview)<ai-development-toolkit-attachments>\nSet up permissions and profiles (preview)<ai-development-toolkit-permissions-profiles>\nIterate and manage (preview)<ai-development-toolkit-iterate>\nFrequently asked questions (preview)<ai-development-toolkit-faq>\nBest practices for designing an agent (preview)<ai-development-toolkit-best-practices>\nCreate a Sales Validation Agent (preview)<ai-development-toolkit-sales-validation>\nTransparency note: Business Central AI development toolkit (preview)<transparency-note-ai-development-toolkit>"}