Skip to content

Weekly

Publish a weekly analysis of your sheet data in Notion

Every Monday last week's rows in your sheet are analysed and a report page with findings and likely causes is published in Notion.

Runs
Weekly
Apps
Google Sheets, Notion
AI
Yes, uses the built-in AI allowance
Access
Sheet read; Notion insert

Send this to your assistant

Create a ClickRuntime automation: every Monday, analyse last week's rows in my Invoice exceptions sheet and publish a report with the main causes in Notion, then email me the link.

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

A finance lead at a wholesale business logs every invoice exception in a sheet: wrong prices, missing purchase orders, duplicate bills. The log grows every week, but nobody has time to step back and ask which suppliers or causes keep coming up. The same problems repeat because the pattern is never written down.

This automation takes last week's rows each Monday, works out the totals by supplier and type, and has AI write a short report on what stands out and the likely causes. The report is published as a Notion page where the team already keeps its notes, and you get an email with the link.

What you get out of it

  • Patterns become visible

    Totals by supplier and cause show where the repeat problems are. One clear finding can be worth more than a hundred individual fixes.

  • A report nobody has to write

    The weekly analysis appears without anyone setting aside time for it. The team reads and discusses instead of compiling.

  • A history of every week

    Each report is its own Notion page, so you can compare this month with last and see whether a fix worked.

  • Works for other kinds of logs

    Spend, feedback or contract checks follow the same pattern. Any sheet with one row per item and a date can feed a weekly report.

How it works

What happens, step by step

  1. Every Monday, ClickRuntime reads the rows from the past week in your sheet.

  2. It counts the rows and adds up the amounts by supplier and by type.

  3. AI writes a short report on what stands out and the likely causes.

  4. The report is published as a new page in Notion, and you get an email with the link.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Notion and share the database you want it to use

What you get

RunsWeekly
Publish a weekly analysis of your sheet data in Notiontoday, 9:00Succeeded
Notion · Finance reportsExceptions report, week from 13 Oct: 23 exceptions, 9 from Northwind Supplies, mostly missing PO numbers.

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 Notion 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.
weekly_ai_analysis_of_sheet_data_published_to_notion.pyexample
from collections import Counter
from datetime import date, timedelta
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, notify

SHEET_ID, REPORTS_DB = "your-spreadsheet-id", "your-notion-database-id"

@on_trigger
def run(event):
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
    rows = sheets.values().get(spreadsheetId=SHEET_ID, range="Exceptions!A2:E").execute().get("values", [])
    since = (date.today() - timedelta(days=7)).isoformat()
    week = [r for r in rows if len(r) >= 3 and r[0] >= since]
    if not week:
        return {"rows": 0}
    stats = f"{len(week)} exceptions. By supplier: {Counter(r[1] for r in week).most_common(5)}. By type: {Counter(r[2] for r in week).most_common(5)}."
    sample = "\n".join(" | ".join(r) for r in week[:80])
    try:
        report = ai.generate(f"{stats}\n\nRows:\n{sample}", system="Write a short root-cause report: key findings, likely causes, suggested fixes.", max_output_tokens=1000).text
    except ai.AIError:
        report = stats
    paras = [{"object": "block", "type": "paragraph", "paragraph": {"rich_text": [{"text": {"content": p[:1900]}}]}} for p in report.split("\n\n") if p.strip()]
    page = http.post("https://api.notion.com/v1/pages", headers={"Authorization": f"Bearer {credentials.connection('notion', 'work')}", "Notion-Version": "2022-06-28"}, json={
        "parent": {"database_id": REPORTS_DB}, "properties": {"Name": {"title": [{"text": {"content": f"Exceptions report, week from {since}"}}]}},
        "children": paras}).json()
    notify.email_me("Weekly exceptions report published", f"{stats}\n\n{page['url']}")
    return {"rows": len(week)}

FAQ

Common questions

What does the sheet need?
One row per item with a date in the first column, plus columns such as supplier, type and amount. Only rows from the past seven days are used.
Are the numbers calculated by AI?
No. Counts and totals are calculated directly from the rows. AI only writes the commentary around them.
Who can see the report in Notion?
Anyone with access to the Notion page or database it is published in. Pick a location the right people can open.
What permissions does it need?
Sheet read; Notion insert. 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 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 “Publish a weekly analysis of your sheet data in Notion” from your assistant

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