---
id: object/codeunit/4300
type: object
title: Codeunit 4300 "Agent Task Impl."
summary: Codeunit 4300 "Agent Task Impl." in System Application (System.Agents). 28 public procedures, 2 event subscribers. Introduced in BC25, still in BC30, changed in BC26-29.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: "25"
  last_changed: "29"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 34cf917e4df5c6d4f3ff5959c1029458f1d34e4e357ce453568e7422611f510d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Agent/Interaction/Internal/AgentTaskImpl.Codeunit.al
    title: src/System Application/App/Agent/Interaction/Internal/AgentTaskImpl.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10631
    - change/bcapps/10431
object_type: codeunit
object_id: 4300
name: Agent Task Impl.
namespace: System.Agents
app: System Application
extends: null
first_version: "25"
last_version: "30"
present_in:
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "26"
  - "27"
  - "28"
  - "29"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 30
  events: 0
  subscribers: 2
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 11
  implements: 0
---

# Codeunit 4300 "Agent Task Impl."

> Codeunit 4300 "Agent Task Impl." in System Application (System.Agents). 28 public procedures, 2 event subscribers. Introduced in BC25, still in BC30, changed in BC26-29.

System Application · System.Agents · BC25-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Agent/Interaction/Internal/AgentTaskImpl.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |

## Event subscriptions

- OnGetAgentTaskMessagePageId subscribes to Codeunit "System Action Triggers" GetAgentTaskMessagePageId
- OnGetGetPageSummary subscribes to Codeunit "System Action Triggers" GetPageSummary

## Procedures

- `GetStepsDoneCount(AgentTaskID: BigInteger): Integer`
- `GetStepsDoneCount(var AgentTask: Record "Agent Task"): Integer`
- `GetDetailsForAgentTaskLogEntry(var AgentTaskLogEntry: Record "Agent Task Log Entry"): Text`
- `ShowTaskLogEntries(AgentTaskID: BigInteger)`
- `ShowTaskLogEntries(var AgentTask: Record "Agent Task")`
- `ShowTask(var AgentTask: Record "Agent Task")`
- `CreateTask(AgentUserSecurityID: Guid; TaskTitle: Text[150]; ExternalID: Text[2048]; BillingContext: Enum "Agent Task Billing Context"; ModelId: Code[30]; var NewAgentTask: Record "Agent Task")`
- `AddMessage(From: Text[250]; MessageText: Text; ExternalMessageId: Text[2048]; var CurrentAgentTask: Record "Agent Task"; RequiresReview: Boolean): Record "Agent Task Message"`
- `StopTask(AgentTaskID: BigInteger; AgentTaskStatus: enum "Agent Task Status"; UserConfirm: Boolean)`
- `StopTask(var AgentTask: Record "Agent Task"; AgentTaskStatus: enum "Agent Task Status"; UserConfirm: Boolean)`
- `RestartTask(AgentTaskID: BigInteger; UserConfirm: Boolean)`
- `RestartTask(var AgentTask: Record "Agent Task"; UserConfirm: Boolean)`
- `TaskExists(AgentUserSecurityID: Guid; ConversationId: Text): Boolean`
- `GetDefaultEncoding(): TextEncoding`
- `SetTaskStatusToReadyIfPossible(AgentTaskID: BigInteger)`
- `SetTaskStatusToReadyIfPossible(var AgentTask: Record "Agent Task")`
- `CanAgentTaskBeSetToReady(AgentTaskID: BigInteger): Boolean`
- `CanAgentTaskBeSetToReady(var AgentTask: Record "Agent Task"): Boolean`
- `IsTaskRunning(AgentTaskID: BigInteger): Boolean`
- `IsTaskRunning(var AgentTask: Record "Agent Task"): Boolean`
- `IsTaskCompleted(AgentTaskID: BigInteger): Boolean`
- `IsTaskCompleted(var AgentTask: Record "Agent Task"): Boolean`
- `IsTaskStopped(AgentTaskID: BigInteger): Boolean`
- `IsTaskStopped(var AgentTask: Record "Agent Task"): Boolean`
- `ArchiveTask(AgentTaskID: BigInteger; UserConfirm: Boolean)`
- `TryGetAgentRecordFromTaskId(TaskId: Integer; var Agent: Record Agent): Boolean` (internal)
- `GetModelId(TaskId: BigInteger): Code[30]`
- `GetModelName(TaskId: BigInteger): Text[70]`

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 2718 "Page Summary Provider"](../codeunit/2718.md) (1 call: `OnGetGetPageSummary → GetPageSummary`)
- [Codeunit 4308 "Agent Message Impl."](../codeunit/4308.md) (1 call: `AddMessage → UpdateText`)

## Called by

- [Codeunit 4303 "Agent Task"](../codeunit/4303.md) (14 calls: `ArchiveTask → ArchiveTask`, `CanSetStatusToReady → CanAgentTaskBeSetToReady`, `GetLogEntryDetails → GetDetailsForAgentTaskLogEntry`, …)
- [Codeunit 4308 "Agent Message Impl."](../codeunit/4308.md) (2 calls: `AddAttachment → GetDefaultEncoding`, `DownloadAttachments → GetDefaultEncoding`)
- [Codeunit 4310 "Agent Task Builder Impl."](../codeunit/4310.md) (2 calls: `Create → CreateTask`, `Create → SetTaskStatusToReadyIfPossible`)
- [Page 4303 "Agent Task Log Entry List"](../page/4303.md) (2 calls: `UpdateControls → GetDetailsForAgentTaskLogEntry`, `UpdateControls → TryGetAgentRecordFromTaskId`)
- [Page 4312 "Agent Task Log Entry"](../page/4312.md) (2 calls: `SetAgentName → TryGetAgentRecordFromTaskId`, `UpdateControls → GetDetailsForAgentTaskLogEntry`)
- [Codeunit 4314 "Agent Task Log Entry"](../codeunit/4314.md) (1 call: `OnFeedbackEventForAgentTaskLogEntryTable → TryGetAgentRecordFromTaskId`)
- [Codeunit 4315 "Agent Task Builder"](../codeunit/4315.md) (1 call: `TaskExists → TaskExists`)
- [Codeunit 4329 "Agent User Feedback"](../codeunit/4329.md) (1 call: `InitializeAgentTaskContext → TryGetAgentRecordFromTaskId`)
- [Page 4300 "Agent Task List"](../page/4300.md) (1 call: `UpdateControls → GetStepsDoneCount`)
- [Page 4314 "Agent Task Log Entry ListPart"](../page/4314.md) (1 call: `UpdateControls → GetDetailsForAgentTaskLogEntry`)
- [Page 4322 "Agent Task Log Entry Part"](../page/4322.md) (1 call: `UpdateControls → GetDetailsForAgentTaskLogEntry`)

## Recent changes

- 2026-08-26 [#10631 Integration/main to releases 29.x 31a860b5](../../changes/bcapps/10631.md) (releases/29.x, BC29, feature)
- 2026-08-24 [#10431 [Agent Archiving] Fix broken reference links to archived agents and their tasks](../../changes/bcapps/10431.md) (main, BC30, fix)

## Across versions

- Present in: BC25-30
- Changed (declaration) in: BC26-29

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Agent Task Impl.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
