Skip to content

Daily

Get a short review of every lost deal

When a deal moves to closed lost, you get a blameless write-up of what happened, based on the deal notes.

Runs
Daily
Apps
HubSpot
AI
Yes, uses the built-in AI allowance
Access
crm.objects.deals.read

Send this to your assistant

Create a ClickRuntime automation: every day at 6pm, find HubSpot deals that moved to closed lost since yesterday, write a short blameless review of each from its notes, and email it to me.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Every sales team has a closed-lost graveyard. Deals die for reasons that are rarely written down: the champion left, a competitor undercut on price, security review dragged for six weeks, the timing was wrong. Reps pick a dropdown reason like Price or No decision and move on. A leader asking why you lost 14 deals last quarter gets a pile of vague labels and no pattern, so the same mistakes repeat.

Each day, deals that moved into closed-lost since the last run are found, their notes and activity are read, and the built-in AI writes a short retrospective covering what happened, likely causes and what might have been done differently. The write-up is emailed to you.

It is aimed at sales leaders and revenue operations who want to learn from losses instead of just counting them.

What you get out of it

  • Losses turn into lessons

    A written retrospective on each lost deal captures reasons that a dropdown cannot. Over weeks, patterns such as repeated security objections become clear and fixable. Each lesson is documented, so a new rep can learn from a loss that happened before they joined, which shortens ramp time.

  • Win rates improve through pattern spotting

    When several write-ups mention the same competitor or stalled stage, you can adjust positioning, pricing or the sales process, which raises conversion on later deals. Small adjustments to messaging or pricing, informed by real losses, compound across every deal in the following quarters.

  • Coaching conversations are grounded

    A manager can discuss a specific lost deal with the rep using a neutral summary, instead of relying on memory or defending a version of events. That makes feedback fairer, because both sides can refer to the same facts and not to competing recollections.

  • Reviews happen while details are fresh

    A write-up the day after a loss is far more accurate than one assembled at quarter-end, when nobody remembers which email changed the mood of the deal. Early reviews also catch an easy fix, such as a missing follow-up, while another similar deal is still open.

  • Leadership sees why, not only how many

    Revenue reports show the count of lost deals. These summaries show the reasons, which is what executives need when they decide where to invest. Those insights shape hiring, product feedback and territory decisions, which makes the review worth far more than the lost deal itself.

How it works

What happens, step by step

  1. Once a day, the automation finds HubSpot deals that moved to closed lost since the last run.

  2. It skips any deal it has already reviewed, and reads the notes on each new one.

  3. AI writes a short, blameless review of what happened and what to try next time.

  4. The reviews are emailed to you, one paragraph per deal.

Before it runs live

  • Connect HubSpot

What you get

RunsDaily
Get a short review of every lost dealtoday, 9:00Succeeded
Email · Closed-lost reviews: 2 dealsAcme – Team plan Chose a cheaper tool after the pilot; pricing came up late. Next time: share pricing in the first call.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other HubSpot steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
ai_review_of_closed_lost_deals.pyexample
import re, time
from clickruntime import on_trigger, credentials, http, ai, state, notify, report_fetched

API = "https://api.hubapi.com/crm/v3/objects"

@on_trigger
def run(event):
    headers = {"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}
    since = state.get("since") or int((time.time() - 86400) * 1000)
    deals = http.post(f"{API}/deals/search", headers=headers, json={"properties": ["dealname", "amount", "closed_lost_reason"],
        "filterGroups": [{"filters": [{"propertyName": "dealstage", "operator": "EQ", "value": "closedlost"},
                                      {"propertyName": "hs_lastmodifieddate", "operator": "GT", "value": since}]}]}).json()["results"]
    report_fetched(len(deals))
    if not deals:
        return {"reviewed": 0}
    reviews = []
    for d in deals:
        note_ids = [n["id"] for n in http.get(f"{API}/deals/{d['id']}/associations/notes", headers=headers).json()["results"]]
        notes = [http.get(f"{API}/notes/{nid}", headers=headers, params={"properties": "hs_note_body"}).json()
                 ["properties"].get("hs_note_body") or "" for nid in note_ids[:10]]
        text = re.sub(r"<[^>]+>", " ", "\n".join(notes))[:6000]
        retro = ai.generate(f"Deal: {d['properties']['dealname']}\nReason: {d['properties'].get('closed_lost_reason')}\nNotes:\n{text}",
                            system="Write a short, blameless review: what happened, why we lost, what to try next time.",
                            max_output_tokens=250).text
        reviews.append(f"{d['properties']['dealname']}\n{retro}")
    notify.email_me(f"Closed-lost reviews: {len(deals)} deals", "\n\n".join(reviews))
    state.set("since", int(time.time() * 1000))
    return {"reviewed": len(deals)}

FAQ

Common questions

What does the AI read to write the review?
The deal's notes and associated activity in HubSpot. The quality of the review depends on what your team recorded, so deals with detailed notes give richer retrospectives than those with none. Detailed notes in, richer review out.
Will the review be sent to the deal owner too?
It goes to the address you choose. Sending it to the deal owner is possible, though some teams prefer that managers read it first, so the tone of feedback stays constructive and consistent. Tone matters here.
Does it need an AI key of my own?
No. The writing uses ClickRuntime's built-in AI. Your HubSpot connection is the only credential required, and it is stored as a secret in the ClickRuntime dashboard. Reviews are written by a built-in model, billed by no one separately.
What permissions does it need?
crm.objects.deals.read. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get a short review of every lost deal” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.