Custom Lightning Types (CLTs) allow developers to embed Lightning Web Components directly into Agentforce conversations, replacing the default text-based UI with rich forms and result cards. The integration works through three layers: Agent Script for orchestration, a Lightning Type Bundle mapping parameters to Apex data shapes and LWC components, and the LWC itself for rendering. The post walks through a step-by-step implementation covering Apex class definitions with @InvocableVariable, editor and renderer LWC components targeting lightning__AgentforceInput and lightning__AgentforceOutput, GenAiFunction metadata wiring, and the critical naming alignment required across all layers. CLTs are also the foundation of the Headless Experience Layer announced at TDX 2026, enabling rich agentic UI beyond Salesforce to platforms like Slack and ChatGPT.

8m read timeFrom developer.salesforce.com
Post cover image
Table of contents
What are custom Lightning types in Agentforce?Step 1: Prepare and deploy your Apex and LWCStep 2: Create the agent action assetStep 3: Define the action in Agent ScriptThe alignment checklistConclusionResourcesAbout the authors

Sort: