A comprehensive package for integrating Salesforce Agentforce Agents and AI Models directly into Salesforce Flows and Lightning Pages. This project provides a production-ready chat interface with native integration patterns that require no Connected Apps, no Secrets, and no manual OAuth management.
The package provides three distinct AI interaction architectures:
- Use Case: Interact with configured Agentforce Agents (Service Agents, Employee Agents, etc.).
- Backend: Native Apex Controller (
AgentforceAgentController). - Setup: Zero-config authentication (uses current user session).
- Features: Real-time streaming, agent greetings, animated joining indicator, configurable auto-start with delay, dynamic placeholders.
- Best For: Deploying Agentforce personas with custom topics and actions into Flow screens.
- Use Case: Direct LLM interaction (GPT-4, Claude, etc.) for general chat.
- Backend: Native Apex Controller (
ModelsAPIChatGenerations) using Salesforce Models API. - Setup: Requires Einstein licensing only.
- Features: typing simulation, usage/credit tracking, multi-model support.
- Best For: Simple Q&A, summarization, and content generation tasks.
- Use Case: Launch and render Salesforce Flows inside Agentforce as interactive components.
- Backend: Native Flow Engine.
- Status: Beta (Currently supports UI rendering only; output variable capture planned for GA).
- Features: Dynamic multi-step UI, full Flow screen support, native Agentforce integration.
- Best For: Guiding users through complex data collection or business processes visually.
Starting with Version 2.2, the requirement for Connected Apps and Named Credentials has been removed. The system now uses native Salesforce Apex Controllers for all interactions.
When adding the flowAgentforceAgentChat component to a Flow or Page:
- Agentforce Agent API Name: Use the API Name of your agent (e.g.,
Service_Agent) instead of the ID. - Default Starting Message: (Optional) Text to pre-fill or auto-send.
- Auto-Start: Set to
Trueto send the default message automatically. - Auto-Start Delay: (Default 2000ms) Delay before the auto-sent message is triggered.
Assign the Flow Agentforce Chat Access permission set to all users. Users must also have the standard Einstein Agent User permission set assigned by your administrator.
See the SETUP_GUIDE.md for a detailed breakdown of each implementation option and performance optimization tips.
- 401 Unauthorized: Ensure the user has the Flow Agentforce Chat Access permission set assigned.
- 404 Not Found: Verify you are using the Agent API Name (not the 18-character ID).
- Message Formatting: The Apex controller automatically parses JSON responses (e.g.
{"type":"Text","value":"..."}) into plain text for the UI.
MIT License - Developed for the Salesforce community.