Skip to content

Every 15 minutes

Summarise new contracts in Drive and email the key terms

Every PDF added to your Contracts folder gets a summary document in Drive and an email to you with the key terms.

Runs
Every 15 minutes
Apps
Gmail, Google Drive
AI
Yes, uses the built-in AI allowance
Access
Drive read+write; Gmail gmail.send

Send this to your assistant

Create a ClickRuntime automation: when a new PDF appears in my Drive 'Contracts' folder, extract the parties, dates, value and notice period, save a summary document in Drive 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

An operations manager at a growing agency signs client contracts, supplier agreements and NDAs every week, and they all end up in one Drive folder. When a renewal comes up or a client asks about notice periods, he opens a thirty-page PDF and searches for the clause.

A short summary of each contract, written as soon as it is filed, gives you the parties, dates, value and notice terms at a glance. Small businesses without a legal team use it to keep track of what they have agreed to and when obligations fall due.

What you get out of it

  • Key terms without reading the whole contract

    The summary pulls out parties, start and end dates, value and notice period, which covers most questions people ask about a contract.

  • Renewal dates do not surprise you

    With end dates and notice periods written down the day a contract arrives, it is easy to put renewals in the calendar.

  • A summary next to every contract

    The summary document sits in Drive beside the PDF, so anyone with access to the folder can find it.

  • You know when a new contract is filed

    The email tells you as soon as a colleague adds a contract, so nothing is signed and forgotten.

How it works

What happens, step by step

  1. Every few minutes ClickRuntime checks your Drive Contracts folder for new PDFs.

  2. It skips any file it has already summarised.

  3. AI reads the contract and picks out the parties, dates, value, payment terms and notice period.

  4. A summary document is saved in Drive and you get an email with the key terms and a link.

Before it runs live

  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
  • Connect Google Drive

What you get

RunsEvery 15 minutes
Summarise new contracts in Drive and email the key termstoday, 9:00Succeeded
Email · Contract summaryNorthwind Media services agreement: 12 months from 1 Nov, 36,000 EUR, invoiced monthly, 60 days' notice before 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

  • 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 Gmail and Google Drive 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.
new_drive_pdfs_summarised_and_emailed.pyexample
import io
from pypdf import PdfReader
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, credentials, state, notify, ai, report_fetched

FOLDER_ID = "your-contracts-folder-id"

@on_trigger
def run(event):
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    seen = set(state.get("seen") or [])
    files = drive.files().list(q=f"'{FOLDER_ID}' in parents and mimeType='application/pdf' and trashed=false", fields="files(id,name)").execute()["files"]
    new = [f for f in files if f["id"] not in seen]
    report_fetched(len(new))
    if not new:
        return {"summary": "Nothing new"}
    for f in new:
        pdf = drive.files().get_media(fileId=f["id"]).execute()
        text = "".join(p.extract_text() or "" for p in PdfReader(io.BytesIO(pdf)).pages)[:20000]
        summary = ai.generate(f"Summarise this contract: parties, dates, value, payment terms, notice period, unusual clauses.\n{text}", max_output_tokens=600).text
        doc = drive.files().create(body={"name": f"Summary - {f['name']}", "parents": [FOLDER_ID], "mimeType": "application/vnd.google-apps.document"},
                                   media_body=MediaIoBaseUpload(io.BytesIO(summary.encode()), mimetype="text/plain"), fields="webViewLink").execute()
        notify.email_me(f"Contract summary: {f['name']}", f"{summary}\n\n{doc['webViewLink']}")
        seen.add(f["id"])
    state.set("seen", list(seen)[-1000:])
    return {"summarised": len(new)}

FAQ

Common questions

What details are pulled out?
Parties, effective date, end date, contract value, payment terms, notice period and any unusual clauses. You can add other fields that matter to your business.
Is the summary a replacement for reading the contract?
No. It is a quick reference to help you find and track contracts. For decisions with legal weight, check the original wording.
Does it work with scanned contracts?
It works best with PDFs that contain text. Scanned images without readable text are noted in the email so you can review them by hand.
What permissions does it need?
Drive read+write; Gmail gmail.send. 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 “Summarise new contracts in Drive and email the key terms” from your assistant

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