Skip to content

On a schedule

Get an email when someone mentions 'prod down'

New posts that mention your watch words reach you within minutes, without repeats.

Runs
On a schedule
Apps
Mattermost
AI
Not needed
Access
read

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, search Mattermost for 'prod down' or 'urgent' and email me any new posts with the channel and a link.

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

When production goes down, the first person to know is rarely the on-call engineer. It is whoever happens to be reading Mattermost, who types "prod down" in a channel and assumes someone else saw it. Messages like that get buried under lunch plans within minutes, and a manager can lose twenty minutes of an outage because no pager was involved and no one was assigned to watch the chat.

On a regular schedule, ClickRuntime searches Mattermost for posts containing your keyword, such as "prod down", skips any it has already reported, and emails you the new ones with the channel and author. The check runs by polling, so it does not need a special bot or slash command in the channel.

It helps small teams without a full paging setup, and it is equally handy for monitoring brand names, customer names or competitor mentions in shared channels.

What you get out of it

  • Outages are noticed minutes sooner

    Every minute of downtime costs revenue or trust. An email that quotes the exact message pulls the right person into the thread before the discussion has gone in circles. Seeing the exact words in an email also saves the first minutes of asking what happened.

  • No one needs to watch the chat all day

    Instead of relying on a person to keep a channel open, the search does that job. Engineers can focus on their work and still be reached when the phrase appears.

  • Each mention is reported once

    Tracking which posts were already seen means a long thread does not generate a new email every run. Your inbox shows only what is actually new. This also stops the same outage chatter from producing a dozen near-identical emails.

  • Works beyond emergencies

    The keyword can be a customer name, a product code or a competitor. A sales lead gets an email the moment a prospect's name appears in an internal channel, so important context is not missed.

  • Gaps in your alerting are exposed

    If people keep using chat to report problems, the alerts show how often it happens. That is a concrete argument for setting up proper monitoring and an on-call rota. You can then bring real numbers to that planning conversation.

  • Coverage while the on-call person is away

    If someone is in a meeting or on a flight, the email still reaches them or a backup. A phrase typed into a busy channel no longer depends on luck to be noticed.

How it works

What happens, step by step

  1. Every 5 minutes ClickRuntime searches your Mattermost team for posts that mention your watch words, such as "prod down" or "urgent".

  2. It skips any post it has already sent you.

  3. For each new match it looks up the channel name.

  4. You get one email listing each matching post with its channel and a link to open it.

Before it runs live

  • Connect Mattermost

What you get

RunsOn a schedule
Get an email when someone mentions 'prod down'today, 9:00Succeeded
Email · 1 Mattermost post matched[ops] prod down for EU customers, investigating https://chat.acme.com/_redirect/pl/9fk3

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 Mattermost 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.
keyword_alert.pyexample
from clickruntime import on_trigger, credentials, http, state, notify, report_fetched

BASE = "https://chat.acme.com"
TEAM_ID = "teamid123"

@on_trigger
def run(event):
    h = {"Authorization": f"Bearer {credentials.secret('MATTERMOST_TOKEN')}"}
    seen = set(state.get("seen") or [])
    hits = {}
    for term in ('"prod down"', "urgent"):
        r = http.post(f"{BASE}/api/v4/teams/{TEAM_ID}/posts/search", headers=h,
                      json={"terms": term, "is_or_search": False, "per_page": 50}).json()
        hits.update({pid: p for pid, p in r["posts"].items() if pid not in seen})
    report_fetched(len(hits))
    if not hits:
        return {"summary": "Nothing new"}
    lines = []
    for pid, p in hits.items():
        ch = http.get(f"{BASE}/api/v4/channels/{p['channel_id']}", headers=h).json()["display_name"]
        lines.append(f"[{ch}] {p['message'][:200]}\n{BASE}/_redirect/pl/{pid}")
    notify.email_me(f"{len(hits)} Mattermost post(s) matched", "\n\n".join(lines))
    state.set("seen", list(seen | set(hits))[-1000:])
    return {"matched": len(hits)}

FAQ

Common questions

How often does it check for the keyword?
It polls on a regular schedule, so there is a short delay between a message being posted and the email arriving. The interval is set when you configure it, with a few minutes being typical for this kind of alert.
Can it watch several keywords or phrases?
Yes. You can list as many terms as you like, such as "prod down", "site is down" and "outage". Each match is reported with the term it matched, so you can see why the email was sent.
Does it search private channels and direct messages?
It searches the channels the connected Mattermost account is allowed to see. Private channels are included only if that account is a member, and direct messages between other people are never visible to it. Everything else stays out of reach.
What permissions does it need?
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 an email when someone mentions 'prod down'” from your assistant

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