Manage an Agent with Agentforce DX

You can activate or deactivate an agent right from VS Code or with a CLI command.

Activating an agent makes it available to users on the channels that your agent is connected to. Deactivating the agent ends its open interactions, and makes it unreachable for all connections.

  1. In VS Code, open your Salesforce DX project.

  2. In Explorer, navigate in your package directory to one of the metadata component files that makes up your agent:

    • Bot (file extension .bot-meta.xml in the bots directory)
    • BotVersion (file extension .botVersion-meta.xml in the bots directory)
  3. Right-click the metadata component file and select AFDX: Activate Agent or AFDX: Deactivate Agent. VS Code genAiPlannerBundle MD file open and commands to activate or deactivate the agent from a right-click.

    When activating an agent, if it has more than one version, you're prompted to select the version you want to activate.

  1. Open a terminal (macOS, Linux) or command prompt (Windows). Or use the integrated terminal in VS Code.

  2. Run the agent activate command to activate an agent in your org. Specify the --target-org flag if you haven't set the org as your default. For example:

    The command displays the agents that are currently inactive. Use the arrow keys to select the agent you want to activate, then press Return. If there are multiple versions of the agent, you're prompted for the version you want to activate.

    If you know the version and API name of your agent, you can use the --version and --api-name flags to immediately activate it without being prompted.

Run the agent deactivate command in a similar way to deactivate active agents.