---
cuppy_hub: salesforce
cuppy_path: reference/dx/agentforce-metadata-types.md
cuppy_section: docs
cuppy_doc: 83GR-6AZ4
cuppy_doc_uuid: 11bf1250-f769-4682-ba90-514411429a86
cuppy_permalink: https://cuppy.io/salesforce/d/83GR-6AZ4
cuppy_version: 2
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/dx/agentforce-metadata-types
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 9cac904bb17069f869d257f2f71c3549f45070d7f8cc7f56175cc17e3b88a2fe
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---


# Agentforce metadata types

## Two ways an agent exists in source

| Model | Files | Where it comes from |
|---|---|---|
| **Agent Script** (the current, recommended Agentforce DX workflow) | `aiAuthoringBundles/<Agent>/<Agent>.agent` (the script) + `<Agent>.bundle-meta.xml` (`<bundleType>AGENT</bundleType>`), plus the published `Bot` / `BotVersion` | `sf agent generate authoring-bundle`, or `sf project generate --template agent` (`reference/agentforce/agent-script.md`) |
| **Classic** (built in Agentforce Builder, or from `sf agent create`) | `Bot` + `BotVersion`, a `GenAiPlannerBundle`, `GenAiPlugin` topics, `GenAiFunction` actions | Retrieve from the org (`--root-type-with-dependencies Bot`) |

Agent Script calls topics **subagents** (`subagent <name>:` blocks). Classic metadata still calls them topics, as `GenAiPlugin`.

## The types

| Type | Folder, file | What it is |
|---|---|---|
| `Bot` (decomposed) | `bots/<Agent>/<Agent>.bot-meta.xml` + `v1.botVersion-meta.xml` | The agent and its versions |
| `GenAiPlannerBundle` (bundle) | `genAiPlannerBundles/<Agent>/<Agent>.genAiPlannerBundle` | The agent's planner: `plannerType` (Coral Cloud: `AiCopilot__ReAct`), its topics (`genAiPlugins/genAiPluginName`) and agent-level actions (`genAiFunctions/genAiFunctionName`) |
| `GenAiPlugin` | `genAiPlugins/<Topic>.genAiPlugin-meta.xml` | A **topic**: description, scope and instructions, `canEscalate`, and its actions (`genAiFunctions/functionName`) |
| `GenAiFunction` (bundle) | `genAiFunctions/<Action>/<Action>.genAiFunction-meta.xml` + `input/schema.json` + `output/schema.json` | An **action**: `invocationTarget` (an Apex class, flow or prompt template API name), `invocationTargetType` (`apex`, `flow`…), `isConfirmationRequired`, progress message; the schemas describe inputs and outputs to the reasoning engine |
| Standard actions | Referenced by name, not files: `EmployeeCopilot__QueryRecords`, `EmployeeCopilot__SummarizeRecord`, `EmployeeCopilot__GetRecordDetails`, `EmployeeCopilot__AnswerQuestionsWithKnowledge` | Salesforce-provided actions |
| `AiAuthoringBundle` (bundle) | `aiAuthoringBundles/<Agent>/` | An Agent Script agent |
| `GenAiPromptTemplate` | `genAiPromptTemplates/<Name>.genAiPromptTemplate-meta.xml` | A Prompt Builder template (family 6); `GenAiPromptTemplateActv` is its activation |
| `AiEvaluationDefinition` | `aiEvaluationDefinitions/<Name>.aiEvaluationDefinition-meta.xml` | An agent test suite (`reference/agentforce/agent-testing.md`); `AiTestingDefinition` is also registered |
| `DataObjectSearchIndexConf` | `dataObjectSearchIndexConfs` | A Data 360 search index configuration (`reference/data360/search-indexes-and-retrievers.md`) |
| `LightningTypeBundle` | `lightningTypes/<Name>/` | Custom input and output rendering for actions |
| Also registered | `AiAgentDefinition`, `AiAgentDefinitionVersion`, `AIApplication`, `AiAgentScorerDefinition`, `ExternalAIModel` | Newer AI types. At API 68.0+ `sf agent publish` retrieves an agent as `AiAgentDefinition` + `AiAgentDefinitionVersion` instead of `Bot`/`GenAiPlugin`/`GenAiFunction` (`reference/agentforce/agent-script-actions-and-targets.md`). The hub's reading: generate or retrieve them rather than hand-writing them |

How the names chain: **Bot → GenAiPlannerBundle → GenAiPlugin (topic) → GenAiFunction (action) → `invocationTarget` (Apex class, flow, prompt template)**. Each link is a plain API name, so a rename breaks the chain silently until deploy time.

## Moving a whole agent

Salesforce's agent project template deploys with this manifest (wildcards per type, `<version>` set to the project's API version):

```xml
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types><members>*</members><name>AiAuthoringBundle</name></types>
    <types><members>*</members><name>ApexClass</name></types>
    <types><members>*</members><name>Bot</name></types>
    <types><members>*</members><name>BotVersion</name></types>
    <types><members>*</members><name>Flow</name></types>
    <types><members>*</members><name>GenAiPlannerBundle</name></types>
    <types><members>*</members><name>GenAiPromptTemplate</name></types>
    <types><members>*</members><name>PermissionSet</name></types>
    <types><members>*</members><name>PermissionSetGroup</name></types>
    <version>66.0</version>
</Package>
```

For a classic agent, add `GenAiPlugin` and `GenAiFunction`. Deploy actions (Apex, flows, prompt templates) **before**, or in the same deploy as, the agent that references them.


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
