The moment it happens
Warn Slack about duplicate invoices before they're paid
When a new invoice arrives, it's checked against your Supabase records, saved with a status, and any likely duplicate is flagged in Slack.
- Runs
- The moment it happens
- Apps
- Slack, Supabase
- AI
- Not needed
- Access
- Supabase read+write; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: when a new invoice comes in at this link, check Supabase for one with the same vendor and amount in the last 60 days and warn #finance if it looks like a duplicate.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Duplicate invoices are one of the most common ways small companies overpay: a supplier sends the same invoice twice, or a scanned copy and the PDF both get entered. Each one looks fine on its own.
Checking every incoming invoice against recent ones by vendor, amount and number catches duplicates at the door, before anyone pays them.
What you get out of it
Stop paying twice
Likely duplicates are flagged before they reach a payment run.
Every invoice recorded
Each one is stored in Supabase with a clear status: new or possible duplicate.
Simple, explainable checks
The Slack message says exactly which earlier invoice it matched.
Works with any source
Scanners, email tools and accounting systems can all send invoices to the link.
How it works
What happens, step by step
A new invoice arrives at your automation's link.
ClickRuntime looks in your Supabase invoices table for the same invoice number, or the same vendor and amount in the last 60 days.
It saves the invoice with a status of new or possible duplicate.
Possible duplicates are posted to #finance in Slack with the matching invoice.
Before it runs live
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
- Connect Supabase
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
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
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Google Sheets
- Combine it with other Slack and Supabase steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from clickruntime import on_event, credentials, http, notify
SUPABASE = "https://your-project.supabase.co/rest/v1"
def sb(method, path, **kw):
key = credentials.secret("SUPABASE_KEY")
r = http.request(method, f"{SUPABASE}/{path}", **kw, headers={"apikey": key, "Authorization": f"Bearer {key}", "Prefer": "return=representation,resolution=merge-duplicates"})
return r.raise_for_status() or (r.json() if r.content else None)
@on_event
def handle(event):
inv = event.json or {}
vendor, amount, number = inv["vendor"].strip(), round(float(inv["amount"]), 2), inv.get("number", "")
since = date.today() - timedelta(days=60)
same_number = sb("GET", "invoices", params={"vendor": f"ilike.{vendor}", "number": f"eq.{number}"}) if number else []
same_amount = sb("GET", "invoices", params={"vendor": f"ilike.{vendor}", "amount": f"eq.{amount}", "received_on": f"gte.{since}"})
match = (same_number or same_amount or [None])[0]
sb("POST", "invoices", json={"vendor": vendor, "amount": amount, "number": number, "received_on": str(date.today()),
"status": "possible duplicate" if match else "new", "event_id": event.event_id})
if match:
notify.slack(f":warning: Possible duplicate: {vendor} {number} for {amount:,.2f} matches invoice {match['number']} "
f"received {match['received_on']}", channel="#finance")
return {"duplicate": bool(match)}FAQ
Common questions
What counts as a duplicate?
Is a flagged invoice deleted?
Can it check other records?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Score every new lead and post the hot ones to Slack
Each new lead gets an AI score and is saved to your Supabase leads table, and hot leads are posted to your sales channel straight away.
See how it worksPost members who've stopped checking in to Slack each morning
Every morning, Slack lists the members in your Supabase table who haven't checked in for 14 days, highlighting the ones new to the list since yesterday.
See how it worksStore new reviews in Supabase and send angry ones to Slack
Every 3 hours, new reviews are saved once in Supabase with a sentiment label, and negative ones go straight to Slack.
See how it worksKeep exploring
Set up “Warn Slack about duplicate invoices before they're paid” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.