All posts
6 min read

How I built an AI agent in Salesforce that cuts quote creation from 20 minutes to 60 seconds

A walkthrough of the architecture, prompt design, and Salesforce integration patterns behind an in-org AI agent that creates opportunities, accounts, contacts, quotes, and quote line items from a single natural-language message.

Most Salesforce users accept that creating a full quote is just one of those things that takes time. You open the opportunity, add the account, find the contact, create the quote, search through the product catalogue, add the line items, check the pricing, submit for approval. On a good day, 10 minutes. On a bad day, 20. Multiply that across a sales team and you're losing hours every week to a process that should be instant. I decided to fix it.

What I built

Using Claude's API and Salesforce Lightning Web Components, I built an AI agent that lives directly inside Salesforce. Sales reps open it like any other component — no switching tabs, no separate tools, no learning curve. They just talk to it. They can say something like: 'Create an opportunity for Acme Ltd, contact is John Smith, we need a survey quote for three units' — and the agent handles everything. It searches for existing accounts and contacts before creating new ones, avoiding duplicates. It finds the right products from the catalogue, flags seasonal availability if something is out of season, and builds the quote line items based on what was discussed. The whole process — opportunity, account, contact, quote, line items, approval submission — takes around 60 seconds.

The technical side

The architecture is straightforward. The Lightning Web Component captures the conversation and sends it to Claude's API via an Apex callout. Claude processes the natural language, understands the intent, and returns structured instructions. The LWC then executes those instructions against the Salesforce data model. Rather than asking Claude to do everything, I used Apex to handle the heavy Salesforce operations. Claude handles the understanding. Salesforce handles the execution. Each full transaction costs approximately 3p.

The smart features that make it actually useful

Duplicate detection — if a contact already exists, the agent finds them rather than creating a duplicate. Intelligent product matching — if there are multiple product types, the agent presents all options and asks which to add. Seasonal validation — if a rep tries to add a product outside its season, the agent flags it and shows the valid dates. Quick start buttons — pre-built conversation starters for common workflows.

The result

A workflow that previously took 10 to 20 minutes now takes around 60 seconds. Live in production, used daily by 150+ users.

What this means for your business

If your sales team uses Salesforce and spends significant time on manual data entry, quoting, or record creation — this is solvable. The same architecture can be adapted to almost any repetitive Salesforce workflow. You don't need a large development team or a six-figure budget. You need the right architecture, the right AI model, and someone who understands both Salesforce and AI. That's exactly what JR Solutions does.

Interested in what an AI agent could do for your Salesforce workflows? Get in touch at james@jr-solutions.co.uk — happy to jump on a call and talk through what's possible.