Skip to content

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.

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

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

  1. Every five minutes ClickRuntime checks the Realtime Database path you chose for entries added since its last check.

  2. Each new entry reaches your inbox as an email.

  3. It remembers the last entry it sent, so nothing arrives twice.

Before it runs live

  • Connect Firebase

What you get

RunsEvery 5 minutes
Get new Realtime Database entries by emailtoday, 9:00Succeeded
Email · New messageNew message from northwind-support Order 1042 has shipped.

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
  • 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

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.
get_notified_about_new_realtime_database_entries.pyexample
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?
Realtime Database push keys are generated in time order, so ordering by key behaves like ordering by creation time. Starting after the last key means the query returns only entries added since the previous run.
Do I need to set an index?
For ordering by key, no index is required. If you decide to order by another child field, such as a timestamp, Firebase may ask you to add an index rule to your database rules for good performance.
Can it send the data to Slack instead of email?
Yes. The notification can be a Slack message, an email or both. You can choose different destinations by path, so orders go to one channel and device messages go to another. Pick whichever channel your team watches.
What permissions does it need?
firebase.database read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's 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 new Realtime Database entries by email” from your assistant

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