Create an Apex-Based Lightning Type

Create Apex-based Lightning types when you define schemas with Apex.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations
User Permissions Needed
To create and manage prompt templates in Prompt Builder:

Prompt Template Manager permission set

  • Manage Prompt Templates
  • Execute Prompt Templates

OR

Customize Application permission set

  1. Create an Apex class that defines the output structure. Ensure the Apex class implements: AICopilot.GenAIPromptTemplateOutput.
  2. In Setup, search and select Lightning Types.
  3. Create a Lightning type and associate it with the existing Apex class.
  4. Click Save.

Apex-based Lightning types appear in Setup and used in Prompt Builder.