Every 5 minutes
Get new Realtime Database entries by email
New children under a database path reach your inbox shortly after they are written.
- Runs
- Every 5 minutes
- Apps
- Firebase
- AI
- Not needed
- Access
- firebase.database read
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, check /messages in my Realtime Database for keys after the last one you saw and email me each new entry's sender and text.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Firebase Realtime Database apps often keep their events as children under a path, such as new orders, chat reports or device check-ins. When something is added, the app knows, but the people running the business do not. The owner checks a console tree or an admin page now and then, and meanwhile a customer's order waits or a device that stopped reporting goes unnoticed. Both cost money.
Every five minutes, ClickRuntime fetches the path ordered by key, starting after the last key it saw, and sends a notification for every new child it finds. It saves the newest key afterward, so the next run begins from where this one ended.
This suits older or simpler apps where the Realtime Database is the main store and there is no other alerting.
What you get out of it
Hear about new orders promptly
A new child under an orders path becomes a message within minutes. The owner can start packing or contact the customer without watching a console. Faster fulfillment keeps customers happy and reduces cancellations.
Add monitoring to a simple app
Without writing server code, you get a notification each time something is added. That gives hobby and small business apps a basic level of operational awareness. It takes minutes to set up.
Detect silent failures through absence
If devices or users normally add entries each hour and the alerts stop, you notice that something is wrong. The silence itself becomes the signal. This is often the first sign of a failing device.
Never reread old entries
Ordering by key and resuming after the last one keeps queries small and cheap. You avoid downloading the whole path each time and only transfer what is new. Smaller reads also keep usage low.
Keep a human in the loop
Not every event should be automated. Notifications let a person look at unusual entries and decide what to do, using the data exactly as it was written. That judgment is hard to automate safely.
How it works
What happens, step by step
Every five minutes ClickRuntime checks the Realtime Database path you chose for entries added since its last check.
Each new entry reaches your inbox as an email.
It remembers the last entry it sent, so nothing arrives twice.
Before it runs live
- Connect Firebase
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 Slack
- Combine it with other Firebase steps into one automation
Under the hood
The code that runs this automation
import json
from clickruntime import on_trigger, credentials, http, notify, state, report_fetched
DB = "https://acme-prod-default-rtdb.firebaseio.com"
@on_trigger
def run(event):
last = state.get("last_key")
params = {"orderBy": json.dumps("$key"), "access_token": credentials.connection("google", "work")}
if last:
params["startAfter"] = json.dumps(last)
else:
params["limitToLast"] = 1
entries = http.get(f"{DB}/messages.json", params=params).json() or {}
new = sorted(entries.items()) if last else []
report_fetched(len(new))
if last and not new:
return {"new": 0}
for key, msg in new:
notify.email_me(f"New message from {msg.get('sender')}", str(msg.get("text")))
state.set("last_key", max(entries) if entries else last)
return {"new": len(new)}FAQ
Common questions
Why does it order by key?
Do I need to set an index?
Can it send the data to Slack instead of email?
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
Hear about every new Firestore document
A few minutes after a document lands in the collection you pick, you get its key fields in Slack or email.
See how it worksGet a morning count of new users and orders
Each morning you see how many documents yesterday added to each collection, next to the day before.
See how it worksExport Firestore to Cloud Storage nightly
Your Firestore data is exported to a dated folder each night, and you are told if an export fails.
See how it worksKeep exploring
Set up “Get new Realtime Database entries by email” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.