Agents in Business Central – part 1 – the architecture
Agents in Business Central 27.4 allow you to create custom agents that process tasks asynchronously using an orchestrator architecture. The post explains how agents are triggered via task creation, how the orchestrator manages execution with separate sessions and transactions, and how to handle incoming and outgoing messages programmatically.

post Discover Microsoft Business Central - The wonderful world of Business Central
"Since Business Central 27.4 minor update you can create your own agents inside Business Central."
Key points
- Custom agents (public preview since 27.4) need the Custom Agent capability enabled, the AGENT - ADMIN permission set, a 27.4+ sandbox and billing setup in the tenant
- Agents start working when a task is created with the Agent Task Builder codeunit; the Agent Task codeunit can restart, stop or check the status of tasks
- The orchestrator runs tasks asynchronously and in parallel, each in its own session and transaction with the agent as user
- Incoming emails can be handled by a Job Queue codeunit that uses the email conversation ID to add replies to an existing task via Agent Task Message Builder, including attachments
- Outgoing messages are found by output type and reviewed status, processed, and then marked as Sent with the Agent Message codeunit
Quotes
- “Since Business Central 27.4 minor update you can create your own agents inside Business Central.” (Establishes when custom agents became available and marks the beginning of the feature capability)
- “Each task can be seen as a separate user session, thus uncommitted data may not be viewable and concurrent modifications can collide.” (Important architectural consideration for developers implementing agent tasks to avoid data consistency issues)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- codeunit 4315 “Agent Task Builder”
- codeunit 4303 “Agent Task”
- codeunit 4316 “Agent Task Message Builder”
- codeunit 4307 “Agent Message”
Context
- Features: Custom agents, Agent task creation, Asynchronous execution, Message handling, Conversation tracking, Job Queue integration
- Versions: 27.4
Source: Discover MS BC - Bert Verbeek, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.