Headless Agentforce Examples

These end-to-end examples put the headless tools together. Each one builds a working agent without the UI, so you can see how Agent Script, Agentforce DX, custom actions, and the APIs fit together in a real project.

Examples 

ExampleWhat You Build
Build and Deploy the Palonia Resort Demo with a Coding AgentUse an AI coding assistant to build a complete Agentforce solution (custom objects, sample data, a flow, a Lightning web component, a prompt template, and a service agent) and deploy it to your org.
Build a Customer Support AgentBuild a customer support agent that verifies a customer’s identity and looks up their orders. Follow the Headless path to describe the agent in natural language and let an AI coding agent generate the Agent Script.
Build and Deploy an Enhanced Chat AgentBuild a chat agent, test and activate it, and deploy it to an Enhanced Chat v2 channel.

Prerequisites 

Let’s set up your org for headless development and choose a headless development tool.

Step 1: Set Up a Salesforce Developer Edition Org 

To sign up, see Salesforce Developer Edition. If you’d prefer to use a different Salesforce org, verify that Einstein and Agentforce are both enabled. Your user permissions and other org settings can affect your ability to complete all the steps in the examples.

Don’t run the examples on a production org because we are making changes in your org.

Note

Step 2: Enable Einstein and Agentforce 

  1. Log in to the Salesforce Developer Edition org.
  2. Provision and set up Data 360, and then enable Einstein Generative AI and Agentforce. See Set Up Einstein Generative AI and Agentforce.

Step 3: Install and Authorize Salesforce CLI 

  1. To see if Salesforce CLI is already installed, run the sf version command from the command line. If it’s already installed, run sf update to update to the latest version.
  2. If Salesforce CLI isn’t installed, install it.
  3. To authorize your org, run this terminal command.
1sf org login web --alias headless
  1. When the login window appears, log in to your org and click Allow.
  2. Ensure that you have the required permissions to publish and preview an agent in your org.
  3. In your terminal, run sf org list. If you see the headless org alias in the list, you’re successfully authenticated.

Step 4: Choose a Headless Development Tool 

Headless Agentforce development doesn’t lock you into a single toolchain. The right choice for you depends on your preferences and the requirements for your development environment.

Two common starting points are Agentforce Vibes or third-party AI coding tools, such as Claude Code, grounded with the Salesforce skills library. For more information, see Headless Development Tools.

Claude Code Plugin (Optional) 

If you’re using Claude Code, run this command in your terminal to install the salesforce-development plugin.

1claude plugin install salesforce-development@claude-plugins-official

This plugin includes a broad set of skills for Salesforce headless development. The plugin includes the agentforce-generate, agentforce-test, and agentforce-observe skills, which are focused on working with Agentforce agents.

Agentforce Vibes (Optional) 

Agentforce Vibes is an AI-powered coding companion that helps you build and modify Salesforce apps and agents using natural language. Instead of manually writing Agent Script code or running CLI commands, you describe what you want, and Agentforce Vibes does the work. Under the hood, Agentforce Vibes uses Agentforce DX, the pro-code toolset for building agents. Agentforce Vibes comes with specialized skills for developing agents. These skills activate automatically based on your prompts.

See Get Started with Agentforce Vibes in the Agentforce Vibes Developer Guide.

Step 5: Start Building 

Before we start: A note on working with your AI assistant

Throughout these headless examples, you use large language models (LLMs) to build agents in your org. Because LLMs are probabilistic, outputs can vary from run to run. If you encounter an error or an unexpected result, describe what happened to the LLM in plain language and your AI assistant will help you diagnose and fix the issue. With this conversational approach, you iterate quickly and reach a working solution.

See Also