Explore HXL Widgets in Agentforce Employee Agents in Lightning Experience
Learning Objectives
After completing this unit, you’ll be able to:
- Explain how an Agentforce action output is associated with an HXL widget.
- Describe how an HXL widget appears in an Agentforce Employee Agent conversation in Lightning Experience.
From Action Output to an HXL Widget
In the first unit, you learned that Agentforce Employee Agents in Lightning Experience are a supported HXL surface. Then, you explored the HXL building blocks and learned how to create and preview a widget in the HXL Playground.
Now let’s look at what happens after the HXL widget and its custom Lightning type (CLT) are deployed to your Salesforce org.
For this flow to work, the relevant Agentforce action must be available to the appropriate subagent. When a user sends a request to an Agentforce Employee Agent in Lightning Experience, Agentforce routes the request to an appropriate subagent. The subagent invokes an Agentforce action, and the action returns structured output.
By default, Agentforce presents the action output in a standard format. To present the same structured output as an HXL widget, select the widget’s custom Lightning type (CLT) when you configure the Agentforce action.

The renderer linked to the CLT then displays the structured output in the HXL widget.
See the Result in the Conversation
From the user’s perspective, the experience begins with a regular request to the Agentforce Employee Agent in Lightning Experience.
Agentforce routes the request to the appropriate subagent, the subagent invokes an action, and Agentforce displays the structured output in the HXL widget.
The renderer maps the structured output to the widget attributes. Agentforce then displays the HXL widget as part of the response in the conversation.
The action continues to return the same structured output. The CLT, renderer, and HXL widget determine how Agentforce presents that output.
Put It All Together
Here’s how the resources work together in an Agentforce Employee Agent conversation in Lightning Experience.
- The subagent handles a matching request and invokes the action.
- The Agentforce action returns structured output.
- The action output is associated with the CLT used by the HXL widget.
- Agentforce uses the selected CLT and its renderer to display the structured output in the HXL widget.
- Agentforce displays the HXL widget in the conversation.
Together, these resources make a deployed HXL widget part of an Agentforce response.
Great work! You now understand how the Salesforce Headless Experience Layer works. Once you build a widget to render your data on one channel, such as ChatGPT, you can use it on any other channel—even ones that don't exist yet. Build it once, use it everywhere. That's the power of HXL.