Skip to content

Weekly

Log a weekly HubSpot revenue forecast in a sheet

Every Monday your weighted pipeline forecast is added to your Forecast sheet and you get an email with the highlights.

Runs
Weekly
Apps
Google Sheets, HubSpot
AI
Optional
Access
HubSpot deals read; Sheets edit

Send this to your assistant

Create a ClickRuntime automation: every Monday, pull my open HubSpot deals with amount, stage and close date, work out a weighted forecast, add it to my 'Forecast' sheet and email me the highlights.

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

Finance and leadership want a forecast they can track over time, not a HubSpot dashboard that only shows today. Someone in sales ops exports deals each week, multiplies by stage probabilities in a spreadsheet and emails a summary, and if they're away, it doesn't happen.

This works out the weighted forecast from your open deals every Monday, appends it to a Forecast sheet so the history builds up week by week, and emails you the headline with an optional AI note on what moved.

What you get out of it

  • A forecast history you can chart

    One row per week shows how the forecast has moved across the quarter.

  • Uses your own stage probabilities

    Weights come from your HubSpot pipeline settings, so the sheet matches what sales sees.

  • Highlights in your inbox

    The email gives the total, this month's expected close and the biggest deals, so you don't need to open the sheet.

  • Commentary if you want it

    AI can add two or three sentences on what changed since last week; without AI, the numbers still arrive.

How it works

What happens, step by step

  1. Every Monday morning, ClickRuntime reads your open HubSpot deals and your pipeline stage probabilities.

  2. It weights each deal by its stage and adds up the totals, including what's expected this month.

  3. It adds a row with the week's figures to your Forecast sheet.

  4. You get an email with the highlights, with a short AI commentary if you've chosen one.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect HubSpot

What you get

RunsWeekly
Log a weekly HubSpot revenue forecast in a sheettoday, 9:00Succeeded
Email · Weekly forecastWeighted forecast: 214,300 from 42 open deals (pipeline 611,000). Expected to close this month: 58,900, led by the Contoso renewal.

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

  • Run it at a different time, more or less often, or only on weekdays
  • 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 Google Sheets and 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.
revenue_forecast_from_hubspot_deals_to_a_sheet.pyexample
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, notify
SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"
def hs(method, path, **kw):
    r = http.request(method, f"https://api.hubapi.com{path}", headers={"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}, **kw)
    return r.raise_for_status() or (r.json() if r.content else {})

@on_trigger
def run(event):
    probs = {s["id"]: float(s["metadata"].get("probability", 0)) for p in hs("GET", "/crm/v3/pipelines/deals")["results"] for s in p["stages"]}
    deals = [d["properties"] for d in hs("POST", "/crm/v3/objects/deals/search", json={"filterGroups": [{"filters": [{"propertyName": "hs_is_closed", "operator": "EQ", "value": "false"}]}],
             "properties": ["amount", "dealstage", "closedate"], "limit": 200})["results"]]
    w = lambda p: float(p.get("amount") or 0) * probs.get(p["dealstage"], 0)
    month = date.today().isoformat()[:7]
    total = sum(float(p.get("amount") or 0) for p in deals)
    weighted = sum(w(p) for p in deals)
    this_month = sum(w(p) for p in deals if (p.get("closedate") or "").startswith(month))
    row = [date.today().isoformat(), len(deals), round(total), round(weighted), round(this_month)]
    build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values().append(
        spreadsheetId=SHEET_ID, range="Forecast!A1", valueInputOption="RAW", body={"values": [row]}).execute()
    text = f"Open deals: {row[1]}\nPipeline: {row[2]:,}\nWeighted forecast: {row[3]:,}\nExpected this month: {row[4]:,}"
    try:
        text += "\n\n" + ai.generate("Two sentences of commentary on this sales forecast:\n" + text, max_output_tokens=120).text
    except ai.AIError:
        pass
    notify.email_me(f"Forecast for week of {row[0]}", text)
    return {"weighted": row[3]}

FAQ

Common questions

What goes in each row?
The date, the number of open deals, the total pipeline, the weighted forecast and the weighted amount expected to close this month and next.
Can it cover more than one pipeline?
Yes. It reads stage probabilities from every deal pipeline, or you can limit it to one, such as New business.
Can the summary go to Slack too?
Yes. The same highlights can be posted to a Slack channel as well as, or instead of, the email.
What permissions does it need?
HubSpot deals read; Sheets edit. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do 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 “Log a weekly HubSpot revenue forecast in a sheet” from your assistant

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