Agentforce League : (Holiday Challenge) - 23rd Dec 2025
The holiday season is upon us, and what better way to celebrate than by combining festive cheer with cutting-edge AI technology? This year’s Agentforce 360 League Holiday Challenge presented us with a delightful opportunity to build something meaningful—an Employee Agent that creates personalized greeting cards, moving beyond generic WhatsApp forwards to deliver truly customized holiday wishes.
The Use Case: Personalization Meets Automation
The challenge was straightforward: build an intelligent agent that generates personalized holiday greeting cards through conversation. Users simply chat with the agent to create customized greetings for colleagues, friends, and family.
The workflow:
- Collect sender and recipient information
- Understand their relationship
- Generate a personalized AI message
- Select a visual template
- Generate the final greeting card via external service
- Deliver a downloadable link
This demonstrates Agentforce’s ability to orchestrate prompt templates, external APIs, custom Lightning Web Components, and conversational AI into one seamless experience.
Getting Started: The Foundation
The challenge provided a head start with a pre-built SFDX project repository containing necessary Apex classes, Lightning Web Components, and static resources. After cloning the repository and deploying it to a trial org, the tasks focused on configuration and connecting the pieces together.
Building the Solution: Key Implementation Steps
Task 1: Creating the Prompt Template
I created a Flex Prompt Template called HolidayGreetingPrompt that accepts relationship type as input. The template includes tone guidelines—professional messages for colleagues and bosses, heartfelt messages for friends and family—with a 300-character limit to fit greeting card designs.
Task 2: External Service Integration
This involved setting up the connection to the greeting card generation service:
- Created an External Credential with no authentication
- Set up a Named Credential pointing to the external endpoint
- Updated the HolidayGreetingGenerator Apex class with a POST request configuration (120-second timeout)
The external service processes the message, template, and recipient data, returning a downloadable greeting card link.
Task 3: Converting the Prompt to an Agent Action
The prompt template was wrapped into an Agent Action with clear instructions. A crucial configuration was enabling “Show in conversation” for the response, allowing users to review and approve the generated message before proceeding.
Task 4: Image Generation Action
The second Agent Action invokes the external service through Apex. It uses the custom HolidayTemplateSelector Lightning Web Component for visual template selection and outputs the download URL as Rich Text for clickable hyperlinks.
Task 5: Orchestrating the Holiday Agent
The Holiday Agent was configured with a “Holiday Card Creation” topic and specific instructions:
- Collect sender and recipient names
- Generate and get approval for the greeting message
- Display template selector
- Call external service
- Present the downloadable link with festive closing
Unexpected Agent Behavior
During testing, I encountered an interesting deviation from the expected flow. When I requested a greeting card for “ABSYZ,” the agent demonstrated intelligent inference by automatically categorizing the relationship as “Business Partner” without explicitly asking me to specify it.
This behavior highlights both the power and unpredictability of AI agents. The agent likely recognized “ABSYZ” as a business entity (rather than a personal name) and made a contextual assumption about the professional nature of the relationship. While this shows sophisticated reasoning, it also underscores the importance of thorough testing to understand how agents interpret various inputs.
In typical scenarios with personal names, the agent follows the prescribed flow of asking for relationship clarification. However, with other kinds of names, it leverages its training to make informed assumptions. This adaptability can be seen as either a feature or a bug, depending on your use case requirements.
Key Learnings and Takeaways
This challenge effectively demonstrated several powerful Agentforce capabilities:
Orchestration Complexity: The agent seamlessly coordinated multiple actions—prompt template execution, user input collection via custom LWCs, external API calls, and conversational flow management.
Contextual Understanding: The agent’s ability to infer relationship types from context (as seen with the ABSYZ example) showcases its natural language understanding capabilities.
User Experience Design: Features like message approval before proceeding and visual template selection create a user-centric experience that balances automation with control.
Integration Flexibility: The ease of integrating external services through Named Credentials and Apex actions demonstrates Salesforce’s robust platform capabilities.
Resources and Helpful Links
Agentforce Documentation
Prompt Templates
External Service Integration
Apex Integration
Lightning Web Components
Author: Tejas Jain
