---
id: video/EwN3xb2q7vE
type: video
title: "What's New: Coding Business Central Agents with AI Development Toolkit"
summary: "Coding custom Business Central agents in AL with the AI development toolkit APIs: the agent project template in the VS Code extension, agent types, interfaces, setup pages, instances, tasks and messages, multi-turn interactions, agent session events, and exposing agents to other apps. Slide walkthrough with code examples, 16 minutes, published 2026-02-27."
tier: official
language: en
tags:
  - agent development
  - al coding
  - agent interfaces
  - task management
  - message validation
  - agent setup
  - agent instances
  - multi-turn interactions
  - api design
  - agent configuration
system: copilot
review:
  state: reviewed
  by: opus
  at: "2026-10-07T22:50:59.161Z"
  flags: []
generated:
  at: "2026-10-13T00:32:41.360Z"
  pipeline: 0.2.0
  prompts:
    extract-video: 1
    summarize-video: 2
  input_hash: cb16fc2c8fbce22ba0e9a1075c3e93aaadd36377ba72fcde919d1f5c5fa9154b
evidence:
  - kind: video
    url: https://www.youtube.com/watch?v=EwN3xb2q7vE&t=5s
    title: "What's New: Coding Business Central Agents with AI Development Toolkit"
    date: "2026-02-27T15:13:09.000Z"
    commit: null
    t: 5
    quote: Today we will see how we can use the APIs provided in Business Central to code our own agents.
  - kind: video
    url: https://www.youtube.com/watch?v=EwN3xb2q7vE&t=17s
    title: "What's New: Coding Business Central Agents with AI Development Toolkit"
    date: "2026-02-27T15:13:09.000Z"
    commit: null
    t: 17
    quote: you can get the latest version of the VS Code extension. And use the new project command to access our templates.
  - kind: video
    url: https://www.youtube.com/watch?v=EwN3xb2q7vE&t=302s
    title: "What's New: Coding Business Central Agents with AI Development Toolkit"
    date: "2026-02-27T15:13:09.000Z"
    commit: null
    t: 302
    quote: In Business Central, agents are modeled via instances which are also users in Business Central.
  - kind: video
    url: https://www.youtube.com/watch?v=EwN3xb2q7vE&t=432s
    title: "What's New: Coding Business Central Agents with AI Development Toolkit"
    date: "2026-02-27T15:13:09.000Z"
    commit: null
    t: 432
    quote: you will need to make your own table to track your own instances. It needs to be a table that has the user security
  - kind: video
    url: https://www.youtube.com/watch?v=EwN3xb2q7vE&t=626s
    title: "What's New: Coding Business Central Agents with AI Development Toolkit"
    date: "2026-02-27T15:13:09.000Z"
    commit: null
    t: 626
    quote: For tasks, you can imagine them as units of work for the agent. They are bound to a specific agent instance.
  - kind: video
    url: https://www.youtube.com/watch?v=EwN3xb2q7vE&t=659s
    title: "What's New: Coding Business Central Agents with AI Development Toolkit"
    date: "2026-02-27T15:13:09.000Z"
    commit: null
    t: 659
    quote: Multi-turn interactions are also supported because you can insert multiple input messages, and the agent might answer multiple times.
  - kind: video
    url: https://www.youtube.com/watch?v=EwN3xb2q7vE&t=884s
    title: "What's New: Coding Business Central Agents with AI Development Toolkit"
    date: "2026-02-27T15:13:09.000Z"
    commit: null
    t: 884
    quote: By default, the AL API only supports interacting with agents defined in your own app.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
video_id: EwN3xb2q7vE
channel: yt-microsoft
source_name: Microsoft Dynamics 365 Business Central (YouTube)
url: https://www.youtube.com/watch?v=EwN3xb2q7vE
published_at: "2026-02-27T15:13:09.000Z"
duration_s: 953
captions: full
audience:
  - developer
  - partner
chapters:
  - t: 0
    title: Introduction and Getting Started
  - t: 55
    title: Agent Type Design and Setup
  - t: 134
    title: Agent Interfaces and Message Validation
  - t: 288
    title: Agent Types versus Instances
  - t: 374
    title: Setup Pages and Configuration
  - t: 524
    title: Agent Management and KPI Pages
  - t: 602
    title: Tasks and Messages API
  - t: 740
    title: Multi-turn Interactions and Task Triggers
  - t: 811
    title: Getting Task Results and Agent Sessions
  - t: 884
    title: Exposing Agents to Other Apps
features:
  - name: Agent Type Definition
    status: unclear
    t: 55
    verified: false
    status_source: video
  - name: Agent Factory Interface
    status: unclear
    t: 134
    verified: false
    status_source: video
  - name: Agent Metadata Interface
    status: unclear
    t: 167
    verified: false
    status_source: video
  - name: Task Execution Interface
    status: unclear
    t: 190
    verified: false
    status_source: video
  - name: Message Validation API
    status: unclear
    t: 216
    verified: false
    status_source: video
  - name: Agent Instances
    status: unclear
    t: 288
    verified: false
    status_source: video
  - name: Agent Setup Page
    status: unclear
    t: 345
    verified: false
    status_source: video
  - name: Agent Setup Codeunit
    status: unclear
    t: 432
    verified: false
    status_source: video
  - name: Programmatic Agent Creation
    status: unclear
    t: 514
    verified: false
    status_source: video
  - name: Agent Instructions
    status: unclear
    t: 551
    verified: false
    status_source: video
  - name: Agent KPI Pages
    status: unclear
    t: 572
    verified: false
    status_source: video
  - name: Tasks API
    status: unclear
    t: 602
    verified: false
    status_source: video
  - name: Task and Message Model
    status: unclear
    t: 626
    verified: false
    status_source: video
  - name: Message Attachments
    status: unclear
    t: 706
    verified: false
    status_source: video
  - name: Multi-turn Agent Interactions
    status: unclear
    t: 740
    verified: false
    status_source: video
  - name: External ID for Messages
    status: unclear
    t: 755
    verified: false
    status_source: video
  - name: Agent Task Triggering
    status: unclear
    t: 776
    verified: false
    status_source: video
  - name: Agent Task Codeunit Management
    status: unclear
    t: 797
    verified: false
    status_source: video
  - name: Task Result Polling
    status: unclear
    t: 811
    verified: false
    status_source: video
  - name: Agent Session Events
    status: unclear
    t: 836
    verified: false
    status_source: video
  - name: Is Agent Session Procedure
    status: unclear
    t: 866
    verified: false
    status_source: video
  - name: Exposing Agents via API
    status: unclear
    t: 884
    verified: false
    status_source: video
objects_mentioned:
  - enum agent metadata provider enum
  - enum Copilot capability enum
  - interface agent factory interface
  - interface metadata interface
  - interface task execution interface
  - codeunit agent setup code unit
  - codeunit agent code unit
  - codeunit agent task code unit
  - codeunit task builder code unit
  - codeunit message builder code unit
  - codeunit agent session code unit
  - table setup table
quotes:
  - t: 5
    text: Today we will see how we can use the APIs provided in Business Central to code our own agents.
    check: exact
  - t: 17
    text: you can get the latest version of the VS Code extension. And use the new project command to access our templates.
    check: exact
  - t: 302
    text: In Business Central, agents are modeled via instances which are also users in Business Central.
    check: exact
  - t: 432
    text: you will need to make your own table to track your own instances. It needs to be a table that has the user security
    check: snapped
  - t: 626
    text: For tasks, you can imagine them as units of work for the agent. They are bound to a specific agent instance.
    check: exact
  - t: 659
    text: Multi-turn interactions are also supported because you can insert multiple input messages, and the agent might answer multiple times.
    check: exact
  - t: 884
    text: By default, the AL API only supports interacting with agents defined in your own app.
    check: exact
---

# What's New: Coding Business Central Agents with AI Development Toolkit

> Coding custom Business Central agents in AL with the AI development toolkit APIs: the agent project template in the VS Code extension, agent types, interfaces, setup pages, instances, tasks and messages, multi-turn interactions, agent session events, and exposing agents to other apps. Slide walkthrough with code examples, 16 minutes, published 2026-02-27.

[Watch on YouTube](https://www.youtube.com/watch?v=EwN3xb2q7vE) · Microsoft Dynamics 365 Business Central (YouTube) · 2026-02-27 · 15:53 · tier official · reviewed (checked by Opus)

## Overview

The video shows how to use the APIs in Business Central to code your own agents in AL. It starts with the agent type, which acts as a blueprint and is defined through enum extensions for the agent metadata provider and the Copilot capability, plus three interfaces: agent factory, agent metadata and task execution. These cover default settings, runtime behavior and message validation.

It then covers agent instances, which are also users in Business Central, and how to create them with setup pages and the agent setup codeunit, tracked in your own table. The second half covers the tasks and messages API, multi-turn interactions, triggering tasks, getting task results, agent session events, and exposing an agent to other apps through public codeunit functions.

## Key points

- Agents are modeled as instances, which are also users in Business Central. Each instance keeps its own permissions, profile, user settings and instructions.
- An agent type is defined with enum extensions for the agent metadata provider and Copilot capability. It uses the agent factory, agent metadata and task execution interfaces.
- The task execution interface supports input and output message validation. Examples are relevance checks, warnings on input messages, and adding a signature to output messages.
- You must make your own table to track agent instances, and it needs user security. Instances can be created from a setup page or programmatically through the agent codeunit, but only within a user session.
- Tasks are units of work bound to one agent instance. Multi-turn interactions are done by adding several input messages. The external ID field on messages ties them to something like an email thread.
- Polling the agent task status field to wait for results is suited to unit testing and non-production scenarios. Events that fire only in agent sessions are also covered, along with the is-agent-session procedure.
- By default the AL API only works with agents defined in your own app. To share an agent, expose public functions in a codeunit that other apps can call.

## Chapters

- [0:00](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=0s) Introduction and Getting Started
- [0:55](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=55s) Agent Type Design and Setup
- [2:14](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=134s) Agent Interfaces and Message Validation
- [4:48](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=288s) Agent Types versus Instances
- [6:14](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=374s) Setup Pages and Configuration
- [8:44](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=524s) Agent Management and KPI Pages
- [10:02](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=602s) Tasks and Messages API
- [12:20](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=740s) Multi-turn Interactions and Task Triggers
- [13:31](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=811s) Getting Task Results and Agent Sessions
- [14:44](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=884s) Exposing Agents to Other Apps

## Features

Every feature below: status not stated, demoed.

| Feature | At |
|---|---|
| Agent Type Definition | [0:55](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=55s) |
| Agent Factory Interface | [2:14](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=134s) |
| Agent Metadata Interface | [2:47](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=167s) |
| Task Execution Interface | [3:10](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=190s) |
| Message Validation API | [3:36](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=216s) |
| Agent Instances | [4:48](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=288s) |
| Agent Setup Page | [5:45](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=345s) |
| Agent Setup Codeunit | [7:12](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=432s) |
| Programmatic Agent Creation | [8:34](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=514s) |
| Agent Instructions | [9:11](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=551s) |
| Agent KPI Pages | [9:32](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=572s) |
| Tasks API | [10:02](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=602s) |
| Task and Message Model | [10:26](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=626s) |
| Message Attachments | [11:46](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=706s) |
| Multi-turn Agent Interactions | [12:20](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=740s) |
| External ID for Messages | [12:35](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=755s) |
| Agent Task Triggering | [12:56](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=776s) |
| Agent Task Codeunit Management | [13:17](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=797s) |
| Task Result Polling | [13:31](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=811s) |
| Agent Session Events | [13:56](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=836s) |
| Is Agent Session Procedure | [14:26](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=866s) |
| Exposing Agents via API | [14:44](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=884s) |

## AL objects mentioned

As heard in the captions. A name that matches one object page by exact type and name links to it; the others stay as named.

- enum "agent metadata provider enum" at [1:10](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=70s)
- enum "Copilot capability enum" at [1:23](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=83s)
- interface "agent factory interface" at [2:14](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=134s)
- interface "metadata interface" at [2:47](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=167s)
- interface "task execution interface" at [3:10](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=190s)
- codeunit "agent setup code unit" at [7:28](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=448s)
- codeunit "agent code unit" at [8:44](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=524s)
- codeunit "agent task code unit" at [10:13](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=613s)
- codeunit "task builder code unit" at [11:17](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=677s)
- codeunit "message builder code unit" at [11:59](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=719s)
- codeunit "agent session code unit" at [14:26](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=866s)
- table "setup table" at [11:17](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=677s)

Not found in BC28-30: enum "agent metadata provider enum", enum "Copilot capability enum", interface "agent factory interface", interface "metadata interface", interface "task execution interface", codeunit "agent setup code unit", codeunit "agent code unit", codeunit "agent task code unit", codeunit "task builder code unit", codeunit "message builder code unit", codeunit "agent session code unit", table "setup table".

## Quotes

- [0:05](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=5s) "Today we will see how we can use the APIs provided in Business Central to code our own agents."
- [0:17](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=17s) "you can get the latest version of the VS Code extension. And use the new project command to access our templates."
- [5:02](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=302s) "In Business Central, agents are modeled via instances which are also users in Business Central."
- [7:12](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=432s) "you will need to make your own table to track your own instances. It needs to be a table that has the user security"
- [10:26](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=626s) "For tasks, you can imagine them as units of work for the agent. They are bound to a specific agent instance."
- [10:59](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=659s) "Multi-turn interactions are also supported because you can insert multiple input messages, and the agent might answer multiple times."
- [14:44](https://www.youtube.com/watch?v=EwN3xb2q7vE&t=884s) "By default, the AL API only supports interacting with agents defined in your own app."

Presenters (as heard): Unknown Speaker.
