Prompt engineering in Salesforce is the practice of crafting inputs that guide AI models to produce accurate, relevant, and policy‑compliant responses within Salesforce products and workflows. It spans the full prompt lifecycle – design, examples, constraints, chaining, evaluation, monitoring, iteration, and emphasizes accuracy and safety when prompts interact with CRM data and business logic.
Prompting in Salesforce covers a range of techniques that map to different use cases. Below are concise, production-focused descriptions of each category and when to use them.
Table of Contents
1. Zero-Shot Prompts
Direct instructions without examples. Best for simple, open tasks like brainstorming or short summaries. Avoid precise, actionable tasks because a lack of context increases ambiguity.
Prompt Example:
- Summarize this meeting transcript and make a list of action steps for each participant.
- Create a block of code that sends a push notification when a website is updated.
Issue with Zero-Shot Prompts: When it comes to specific and actionable tasks, zero-shot prompts can give the model too wide a framework for producing helpful results.
2. Few-Shot Prompts
Provide a handful of examples to demonstrate the desired structure and tone. Use for record summaries, templated emails, and any task where consistent formatting matters.
Prompt Example:
You’re a Salesforce support agent. Based on the case information, write a concise summary in this format:
Case: Resolution: Next Steps
| Example 1 | Case: Customer reports that the dashboard is not loading on mobile devices. Resolution: Cleared browser cache and verified dashboard settings for mobile compatibility. Next Steps: Follow up in 2 days to confirm functionality. |
| Example 2 | Case: User cannot reset password using the self-service portal Resolution: Reset the user’s password manually and update portal configuration settings. Next Steps: Monitor for similar issues across other users. |
| Now summarize this case | Case: Client unable to upload large files (>20MB) through the Experience Cloud site. Example AI Response (Expected Output) Resolution: Adjusted the file upload size limits in the site configuration and enabled large file support. Next Steps: Notify the client of the update and verify successful upload by the end of the week. |
3. Chain-of-Thought Prompts
Ask the model to show intermediate reasoning steps before the final answer. Use for multi-step logic, auditing decisions, or tasks where traceability of reasoning is required.
Prompt Example: Chain-of-Thought Prompting in Lead Qualification
You’re an assistant helping a sales rep qualify a lead. Think step-by-step before assigning a status of Hot, Warm, or Cold based on:
- Lead Source
- Industry
- Budget
- Purchase Timeline
| Example 1 | Lead Source: Referral | Industry: Tech | Budget: $80,00 | Timeline: 1 month Reasoning: Referral source suggests strong intent. The tech industry often has a quick turnaround. The budget is high, and the timeline is short. Qualification: Hot |
| Example 2 | Lead Source: Web | Industry: Nonprofit | Budget: $5,000 | Timeline: 6 months Reasoning: A web lead can be cold unless paired with urgency. The budget is low, and the timeline is far out. Qualification: Cold |
| Now, qualify this lead. | Lead Source: Event | Industry: Healthcare | Budget: $25,000 | Timeline: 2 months AI Response (Expected Output): Reasoning: Event leads indicate interest, especially if attended in person. Healthcare is a stable industry. The budget is moderate, and the timeline is reasonable. Qualification: Warm |
Risks: Chain-of-thought increases latency—use caching or hybrid pipelines for time‑sensitive flows.
4. Role-Based Prompting
Assign a persona or job function to steer tone and decision style. Use when outputs must reflect a specific role’s language or business perspective and combine with merge fields for personalization.
Example: Role-Based Prompting in a Sales Context
In this scenario, you are building a GPT assistant to help sales representatives compose follow-up emails after discovery calls, and you want the model to think and write like a Salesforce account executive.
Prompt: Act as a Salesforce account executive. You’ve just had a discovery call with a prospective customer. Draft a follow-up email that:
- Recaps the key pain points
- Highlights how Salesforce can help
- Includes a CTA for the next meeting
Use a tone that’s professional, confident, and focused on value.
Details from the call:
- Customer struggles with disconnected data across sales and service.
- They’re using spreadsheets and legacy tools.
- Interested in improving cross-team collaboration and visibility.
Example AI Response (Expected Output)
Subject: Next Steps on Connecting Your Sales & Service Teams
Hi [Customer Name],
Great speaking with you earlier! I appreciated learning more about the challenges your team is facing, especially around disconnected systems and the reliance on spreadsheets.
As we discussed, Salesforce Customer 360 can help unify your sales and service data in one platform – giving your teams real-time visibility and making collaboration seamless.
Let’s schedule a follow-up to explore how this could look in your environment. How’s your availability early next week?
Best,
[Your Name]
Account Executive, Salesforce
5. Conversational Prompts
Design multi-turn flows that adapt to user input. Use for guided onboarding, interactive troubleshooting, or any scenario where clarifying questions improve outcomes.
Prompt Example: Picture a flow that walks a new Salesforce admin through their first org setup. Rather than presenting everything at once, the AI leads them step‑by‑step: asking clarifying questions, offering options, and creating an interactive, real-time onboarding experience.
Prompt: You’re a helpful Salesforce onboarding assistant. Ask clarifying questions, walk the user through setup tasks step-by-step, and offer suggestions when needed. Make the experience feel like a live conversation.
AI Output Example (Expected Output):
Hi there! Welcome to Salesforce! I’m here to help you get your org set up.
First things first: are you planning to use Salesforce mainly for Sales, Service, or both?
(Once user responds: “Sales”)
Great! Let’s start by setting up your lead and opportunity stages. Do you already have a defined sales process, or would you like to use Salesforce’s default pipeline to begin with?
6. Counterfactual Prompts
Request alternate scenarios to analyze what might have changed an outcome. Use for retrospectives, lost‑deal analysis, and scenario planning to surface actionable improvements.
Prompt Example: Imagine you’re building an AI assistant for sales managers that analyzes lost deals and recommends how different key factors might have changed the outcome.
Prompt: You’re a sales coach analyzing lost opportunities. Based on the opportunity data, explain why the deal was lost and then offer a counterfactual scenario: what could have changed to win the deal?
Input Details:
- Opportunity: Lost
- Deal Size: $45,000
- Close Date: Missed by 2 weeks
- Decision Maker: Not involved
- Competitor: BigDigital
- Primary Objection: Platform felt too complex
- Rep Notes: Demo focused heavily on features, not outcomes
Example AI Response (Expected Output):
The deal was lost primarily because the decision maker wasn’t engaged during the buying process, and the demo emphasized features rather than outcomes—making the product seem complex and less accessible.
Counterfactual:
If the decision maker had been involved earlier—and the demo had focused on business impact rather than product depth—the customer might have seen more value and alignment. A simplified, outcome-focused presentation could have improved buy-in and potentially secured the deal.
7. Creative Prompts
Encourage originality for marketing, naming, or ideation tasks. Use looser constraints and multiple variants to surface diverse options, then apply validation or human review for selection.
Prompt Example: Build an AI assistant that helps marketers brainstorm names for a Salesforce campaign focused on customer loyalty and long‑term relationships. The goal is to have thoughtful, brand‑aligned ideas suitable for digital and event marketing.
Prompt: Act as a creative marketer at Salesforce. Generate five campaign name ideas that emphasize connection, trust, and long‑term partnership. Make them engage, brand‑aligned, and suitable for digital and event use.
Example AI Response (Expected Output):
- Forever Forward
- Trailblazer Together
- Built to Last
- Trusted by Design
- Momentum Matters
Choosing the Right Prompt at the Right Phase

- Crawl: Prioritize speed and safety; use zero-shot and creative prompts to explore capabilities without automating actions. Keep outputs read-only and logged.
- Walk: Introduce few‑shot, role-based, and conversational prompts in controlled pilots; add schema enforcement, golden‑file tests, and human review gates. Measure business KPIs alongside model metrics.
- Run: Enable chain‑of‑thought and counterfactual prompting only after robust verification, latency tuning, and governance; require explainability snippets and confidence thresholds before automated execution
Final Thoughts
Prompt engineering is an operational discipline: define success up front, design structured, validated prompts, test against representative inputs, monitor outcomes in production, and iterate with traceability. Treat prompts like code -versioned, tested, and reviewed, so they remain reliable interfaces between human intent and model behavior.
Most Reads:
- Salesforce TDX 2026 Training & Certifications: A Complete Guide for Trailblazers
- Prompt Engineering Framework: How to Design Reliable, Production-Ready AI Prompts
- Salesforce Business Rules Engine (BRE) Explained: Smarter Decisioning Beyond Apex & Custom Metadata
- Salesforce Deployment Explained: Packaging vs CI/CD (When to Use Each and Why It Matters)
Resources
- [Salesforce Developer]- (Join Now)
- [Salesforce Success Community] (https://success.salesforce.com/)
For more insights, trends, and news related to Salesforce, stay tuned with Salesforce Trail

Somenath Dhar
With over 26 years of experience in the IT industry, I am a seasoned professional specializing in Salesforce architecture, program management, and enterprise solution design. My career spans diverse domains including pre-sales, managed services, fresh implementations, DevOps consulting, and delivery management, where I have consistently driven innovation and operational excellence. For more than 13 years, I have focused on Salesforce solutions, leading the design, development, and architecture of complex enterprise platforms. As a Salesforce Sales Solution Architect (SSA) for nearly a decade, I have successfully delivered scalable solutions across Sales, Service, Experience, Marketing, Financial Services, and Insurance Clouds. My expertise extends to pre-sales estimations, enabling organizations to align technical feasibility with business strategy. I bring nearly 20 years of experience in designing distributed applications and cloud platforms, complemented by hands-on proficiency with Einstein for Sales and Service Clouds, Salesforce Agentforce implementations, and advanced data modeling. My technical acumen includes Apex programming, triggers, and Lightning Web Components (LWC), ensuring robust and future-ready solutions. Beyond solution delivery, I have played a pivotal role in leading Centers of Excellence (COEs), competency building, and mentoring teams to adopt best practices in Salesforce DevOps strategy—an area where I have contributed nine years of consultancy and architectural leadership. Driven by a passion for technology and transformation, I continue to help enterprises harness Salesforce and cloud innovation to achieve sustainable growth and customer success.
- Somenath Dhar#molongui-disabled-link


