Skip to content

Every hour

Get an accounting summary for each new EDI or export file in Drive

When a new EDI or accounting export lands in your Drive folder, it is indexed and you get an email summarising its bookings.

Runs
Every hour
Apps
Google Drive, Pinecone
AI
Yes, uses the built-in AI allowance
Access
Drive read; Pinecone write

Send this to your assistant

Create a ClickRuntime automation: every hour, check my Drive Accounting exports folder for new files, store their contents in Pinecone and email me a report of the bookings: totals by account, largest items and anything unusual.

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

EDI messages and accounting exports are full of detail but hard to read. Finance teams receive them daily from partners and systems, and checking each one by hand for totals and odd entries is slow, so problems surface at month-end instead of on the day.

Finance staff, bookkeepers and operations managers use it to get a readable summary of every file as it arrives, and to keep the contents searchable for later questions.

What you get out of it

  • Readable summaries

    Totals, largest items and unusual entries are written out in plain language.

  • Problems caught early

    Odd amounts or unexpected accounts are flagged the day the file arrives.

  • Searchable history

    Every file's contents are indexed, so you can later ask when a supplier was last booked.

  • No change to how files arrive

    Partners and systems keep dropping files in the same folder.

How it works

What happens, step by step

  1. Every hour, ClickRuntime checks your Drive folder for files added since its last check.

  2. Each new file is read and its contents are added to your Pinecone index in chunks.

  3. AI writes a short accounting report: totals by account, largest items and anything unusual.

  4. The report is emailed to you.

Before it runs live

  • Connect Google Drive
  • Connect Pinecone

What you get

RunsEvery hour
Get an accounting summary for each new EDI or export file in Drivetoday, 9:00Succeeded
Email · Accounting reportAccounting report: northwind_invoices_1018.edi · 42 invoices, 18,240.00 EUR · Largest: Acme Freight 3,900.00 · Unusual: one credit note of -1,200.00

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 Google Drive and Pinecone 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.
turn_edi_accounting_files_in_drive_into_reports.pyexample
import json
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, credentials, http, state, notify, ai

Q = "'your-folder-id' in parents and trashed=false and mimeType='application/vnd.google-apps.document'"
HOST, NS = "https://docs-abc123.svc.aped-1234.pinecone.io", "company"  # your index host and namespace
def upsert(records):
    http.post(f"{HOST}/records/namespaces/{NS}/upsert", data="\n".join(json.dumps(r) for r in records[:96]), headers={
        "Api-Key": credentials.secret("PINECONE_API_KEY"), "X-Pinecone-API-Version": "2025-04", "Content-Type": "application/x-ndjson"}).raise_for_status()

@on_trigger
def run(event):
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).files()
    since = state.get("since") or "2026-01-01T00:00:00Z"
    new = drive.list(q=f"'{FOLDER}' in parents and createdTime > '{since}' and trashed=false",
                     fields="files(id,name,createdTime)").execute()["files"]
    report_fetched(len(new))
    if not new:
        return {"new": 0}
    for f in new:
        text = drive.get_media(fileId=f["id"]).execute().decode("utf-8", "ignore")
        upsert([{"_id": f"{f['id']}#{n}", "chunk_text": text[i:i + 1500], "file_name": f["name"]}
                for n, i in enumerate(range(0, len(text), 1500))])
        report = ai.generate("Summarise this accounting/EDI file for a finance team: totals by account, the five largest "
                             f"items, and anything unusual. Plain text.\n\n{text[:20000]}", max_output_tokens=900).text
        notify.email_me(f"Accounting report: {f['name']}", report + ("\n\n(Summary covers the first part of a large file.)"
                                                                    if len(text) > 20000 else ""))
    state.set("since", max(f["createdTime"] for f in new))
    return {"files": len(new)}

FAQ

Common questions

Which file types work?
Text-based files such as EDI messages, CSV and other plain exports. Spreadsheets work if saved as CSV.
How large can a file be?
Typical daily exports are fine. Very large files are summarised from their first part, and the email says so.
What counts as unusual?
Amounts far larger than the rest, negative entries where they are not expected, and accounts that rarely appear. You can describe your own rules.
What permissions does it need?
Drive read; Pinecone write. 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 an accounting summary for each new EDI or export file in Drive” from your assistant

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