SBU

Automating the energy sales cycle

Energy broking is a timing business, and the timing was sitting unused in the CRM.

What we did CodeLeap built a headless automation layer across Salesforce, an LLM and the client's email, which calculates each customer's savings, writes and sends a personalised approach, classifies the reply and drafts the response, with an 85 per cent confidence threshold deciding what runs automatically and what waits for a person.

SBU — Sales automation case study SBU

SBU (Switch Business Utilities) is a UK energy broker that places gas and electricity contracts for business customers. In this market the deal usually goes to whoever quotes first and follows up hardest, and the opportunity to win came and went with each customer's contract end date, sitting in Salesforce with nothing acting on it. CodeLeap built an automation layer that reads their CRM, calculates each customer's savings, writes and sends a personalised approach email, reads the reply, drafts the response and prepares the paperwork.

Product features

  • Salesforce opportunity sync

    Accounts, Contacts, Opportunities and Contracts synchronise from the client's Salesforce organisation daily, pulling only what has changed since the last run so the sync stays fast as the pipeline grows. Energy-specific fields including contract end dates and MPAN and MPRN supply identifiers are mapped through to drive everything downstream.

  • Contract-expiry trigger engine

    Outreach is driven entirely by how close a customer is to the end of their current contract, with opportunities sorted automatically into cadence bands from awareness through to a hot-close band in the final three months, plus an urgent trigger inside fourteen days. Each band has its own timing and tone, so a customer is approached when the approach is worth making.

  • AI-generated personalised outreach

    Claude writes each outbound email from the opportunity record, the customer's contract details and the history of previous contact, rather than filling placeholders in a fixed template. Every email carries the savings figure calculated for that specific customer.

  • Pricing and savings engine

    A calculation engine works out what a customer spends now and what they would spend on a proposed contract, splitting annual usage across day and night rates and adding standing charges across the year. Rates live in a configuration table the client's own team edits, so commercial assumptions change without a code release.

  • Inbound reply classification and AI-drafted replies

    Replies are read by the LLM and classified by intent with a confidence score, so a question about standing charges is handled differently from a request to proceed. The system then drafts a response in the context of the whole thread and holds it for the sales team to approve, edit or discard.

  • Confidence-gated automation

    Automated actions are gated on the model's own confidence, with a threshold at 85 per cent. Drafts above it are eligible for automatic sending, anything below waits for a person, and the same gate governs automatic stage changes written back to Salesforce.

  • Automated Letter of Authority generation

    A Letter of Authority is the document a customer signs to let a broker approach suppliers on their behalf, and producing one used to be a manual step. The platform pulls the details from Salesforce, populates the template and attaches the finished document to the outgoing email, so the paperwork travels with the approach.

  • Operations console

    The system is deliberately headless and runs inside the tools the team already uses, with a hardened admin console covering opportunities, generated emails, drafts, conversation threads, attachments and rate configuration. Access is protected by two-factor authentication, and heavy actions run as background jobs so the console stays responsive.

Challenge

A customer is worth approaching in the window before their existing contract ends, that window is visible in the CRM as a date, and the broker who arrives first with a credible number usually wins. SBU had the data and the relationships, but everything between the date in Salesforce and the signed contract was manual: noticing the renewal, looking up usage, calculating the saving in a spreadsheet, writing the email, remembering to follow up, answering the reply and preparing the Letter of Authority.

That work is what caps a broker's capacity, well below the number of opportunities already sitting in the database. The task was to automate the whole chain without asking the team to leave Salesforce or learn a new system, using AI where judgement was genuinely needed and deterministic logic for anything involving money. There was also a commercial constraint, because the client's Salesforce edition did not include API access as standard and an upgrade to a higher tier was not an acceptable cost.

Solution

CodeLeap built a headless automation platform that sits between Salesforce, an LLM and the client's email, and drives the sales cycle end to end. Opportunities synchronise daily, the trigger engine sorts them by proximity to contract expiry, the pricing engine calculates each customer's savings from their own usage and the client's editable rate table, and Claude writes a personalised approach email built on those numbers. Replies come back into the same system, where they are classified by intent and answered with an AI-drafted response, and a Letter of Authority is generated and attached automatically so the deal can progress the moment a customer agrees.

Confidence thresholds decide what happens without a human and what waits for review, which let the client increase the level of automation as trust in the system grew. The Salesforce API constraint was resolved by negotiating access on their existing plan, so the integration went live without a tier upgrade. Within three months the team was generating five times the qualified leads it had handled before, without adding headcount.

Tech stack

The tech chosen was our speciality, enabling fast development of reliable automation and a maintainable infrastructure.

Backend
Python, Django, PostgreSQL, Celery for background processing
Hosting
AWS, with infrastructure managed as code
AI
Anthropic Claude for email generation, reply classification and reply drafting
Integrations
Salesforce CRM, managed email delivery and inbound routing, Companies House data enrichment

Keep exploring

Let's build something that pays for itself

Our team of experts can help you evaluate innovation opportunities for your business.

  1. 1 Send your enquiry
  2. 2 We get in touch within 24 hours
  3. 3 We send you a detailed proposal

Prefer to reach us directly? Email us at hello@codeleap.co.uk or call us at +44 (0) 330 122 1101

Book a consultation