Agentforce Examples

This section provides example Agentforce implementations to help you get started building and using agents. Each example explains the main concepts it demonstrates and gives you what you need to build it yourself.

The Headless Instructions column identifies examples with guidance on how to build and deploy using an AI coding agent.

The multi-surface examples show you how to complete the steps using Headless, Canvas (Salesforce UI), and sometimes Agent Script by choosing the tab for your preferred method.

Build and deploy a complete Agentforce solution from start to finish.

ExampleDescriptionHeadless Instructions
Build the Palonia Resort Demo with a Coding AgentUse an AI coding assistant to build and deploy a complete solution — custom objects, sample data, a flow, a Lightning web component, a prompt template, and a service agent — to your org.Yes
Customer Support AgentA support agent that verifies a customer’s identity and looks up their orders — built three ways: headlessly with an AI coding agent, with code in Agent Script, or with clicks in Canvas.Yes
Build and Deploy an Enhanced Chat AgentBuild a chat agent, test and activate it, and deploy it to an Enhanced Chat v2 channel.Yes
Ground an Agent with Agentforce Data LibrariesBuild an agent, ground it with an Agentforce data library, test, and activate it.Yes
Optimize an Agent by Analyzing Production DataAnalyze production data to identify suboptimal agent responses. Your AI assistant identifies root causes, turns them into durable test cases, and suggests fixes, which you validate against a full test suite in your testing environment, such as a sandbox, before promoting to production.Yes
Collect Customer Information to Create a RecordAn agent that collects required details across multiple turns, then creates a record through a flow — with safeguards against dropped values, duplicate records, and false confirmations.No

Learn specific Agent Script techniques through focused, code-first examples.

ExampleDescription
Enforce Subagent Sequencing With VariablesA step-based interview agent that enforces question order while handling natural conversation.
Agent Script PatternsReusable patterns for common Agent Script use cases and workflows.
Agent Script RecipesSample implementations that demonstrate Agent Script features and techniques.

Ground your agent in your own knowledge and add custom logic that the standard actions don’t cover.

ExampleDescriptionHeadless Instructions
Ground an Agent with an Agentforce Data LibraryBuild an agent, ground it with an Agentforce data library, test, and activate it.Yes
Demystify Jargon with KnowledgeEnsure that your grounded agent understands your organization’s evolving jargon without having to update your information sources.No
Custom Apex Action for Complex QueriesA custom action built in Apex to search product inventory.No