Create an instance of an agent in an org. Must provide a connection to an org
and the agent (Bot) API name or ID as part of AgentOptions.
Activates the agent.
void
Deactivates the agent.
void
Queries BotDefinition and BotVersions (limited to 10) for the bot metadata and assigns:
Returns the ID for this agent.
The ID of the agent (The Bot ID).
Returns the latest bot version metadata.
the latest bot version metadata
StaticcompileBetaCreates agent JSON from compiling the Agent as a string on the server.
The connection to the org
Promise
StaticcreateCreates an agent from a configuration, optionally saving the agent in an org.
a Connection to an org.
a SfProject for a local DX project.
a configuration for creating or previewing an agent.
the agent definition
StaticcreateBetaCreates Agent as string using agent job spec data.
The connection to the org
The agent specification data
Promise
StaticcreateCreate an agent spec from provided data.
a Connection to an org.
The configuration used to generate an agent spec.
the agent job spec
StaticlistList all agents in the current project.
a SfProject for a local DX project.
StaticlistLists all agents in the org.
a Connection to an org.
the list of agents
StaticpublishBetaPublish an AgentJson representation to the org
The connection to the org
The Salesforce project
The agent JSON with name
The publish response
A client side representation of an agent within an org. Also provides utilities such as creating agents, listing agents, and creating agent specs.
Examples
Create a new instance and get the ID (uses the
BotID):const id = new Agent({connection, name}).getId();Create a new agent in the org:
const myAgent = await Agent.create(connection, project, options);List all agents in the local project:
const agentList = await Agent.list(project);