Create and Assign Actions to Agentforce Agents in Salesforce

I created an Agentforce Agent for one of our clients who uses Salesforce to manage their business operations.

After creating the agent, the next step was to decide what tasks the AI agent should perform automatically. For this, we created Agentforce Actions and connected them with Salesforce Flows and logic.

These actions allow the agent to fetch customer details, check related records such as Accounts or Cases, and update record information when the user provides a prompt.

In this article, we will learn how to create and assign actions to Agentforce agents in Salesforce so the AI agent can automatically perform tasks such as fetching data, updating records, and assisting users without manual effort.

Agentforce Actions in Salesforce

Whenever we give a prompt to an Agentforce agent, the agent can perform the task because of the actions assigned to it.

Actions are the components that actually perform work in Salesforce. They handle tasks such as creating a draft order, booking an appointment, or fetching record details from Salesforce.

We will create both standard and custom actions to meet the organization’s business needs. Each action is designed to solve a specific task.

Custom actions can be built using Salesforce Flows, Apex, and prompt templates, enabling the Agentforce agent to perform intelligent, automated actions based on user prompts.

  • Standard Actions: When we enable the agent, the actions provided by Salesforce are standard.
  • Custom Action: Salesforce users create custom actions to address business-specific tasks.

The following are ways to create custom actions in Salesforce:

  1. External Services: No-code integration with external APIs.
  2. Apex: Salesforce programming language.
  3. Flows: No code Salesforce automation tool.
  4. Prompt Template: Reusable prompts written with natural language.

Create and Assign Actions to Agentforce Agents in Salesforce

In the step below, I have created a custom action using a Salesforce flow so that when agents need automation, the flow can be used as a custom action.

So, let’s take a scenario to create a custom action in Agentforce. The agent has to automatically create a task or activity record on an account or any other standard or custom object.

Since users work on multiple accounts, this requires many clicks, so it would be very helpful if their AI assistant could handle it. For that, let’s create a custom action using the flow.

Important: We can only use invokable or auto launched flows to create the custom action to assign to and agents in Agentforce.

1. Create an Auto-Launched Flow to Automate the Process

Navigate to Setup -> In Quick Find, search for Flows -> Click New Flow button -> Select Auto-launched Flow-> Click Create button.