Skip to content

The moment it happens

Add a slash command that runs your automation

Typing a command in Mattermost does the job and posts the result in the channel for everyone.

Runs
The moment it happens
Apps
Mattermost
AI
Not needed
Access
create slash command (team admin) + create_post

Send this to your assistant

Create a ClickRuntime automation: make a /meet slash command for our Mattermost team that creates a video call link and posts it in the channel where it was typed.

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

Some jobs happen in chat but have to be completed somewhere else. A support lead types in a channel asking someone to refund an order, a marketer asks a colleague to pull this week's numbers, or an ops person needs a server restarted. Each time a person has to switch tools, find the right screen and report back, and the answer never reaches the conversation that started it.

You create a slash command in Mattermost, such as /report, and point it at ClickRuntime. When someone types it, ClickRuntime verifies the command token, runs the action you defined and replies with `response_type: in_channel`, so the answer is visible to everyone in the channel. It runs the instant the command is sent.

Teams use it to put small, repeatable actions into the place where the request is made.

What you get out of it

  • Requests and results stay in one place

    The person asking and the people watching see the outcome in the same thread. Nobody has to ask whether it was done or copy results from another tool. No one needs to ask whether it was done or copy results across.

  • Routine tasks become one-line commands

    A report that took five clicks across two tools becomes a short command anyone on the team can type. Less time is spent on mechanical steps, and fewer questions go to the one person who knows how.

  • Only genuine commands are accepted

    Verifying the command token means requests from other sources are rejected. That protects any action that sends emails, changes records or spends money. Mattermost sends a secret token with each command, and the check runs before the action starts, so unknown callers get nothing.

  • Answers are visible to the channel

    With an in-channel reply, a teammate sees that the report was already run and does not repeat it. It also leaves an easy trail of who did what and when.

  • New teammates can use it on day one

    A short command is easier to remember than a list of steps and logins. People can run a standard task without being trained on the underlying tool. That lowers the training burden for any team that has regular turnover.

  • Less switching between tools

    Each trip to another screen interrupts the conversation and invites mistakes. Keeping the action in chat means people finish the task while the context is still fresh in their minds.

How it works

What happens, step by step

  1. When someone types your slash command in Mattermost, Mattermost passes it to ClickRuntime straight away.

  2. The automation first checks the command really came from your Mattermost, and ignores it otherwise.

  3. It runs the action, in this example creating a new video call room with its own link.

  4. It posts the result in the same channel for everyone, such as "@maya started a call" with the link.

Before it runs live

  • Connect Mattermost
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Add a slash command that runs your automationjust nowSucceeded
Mattermost · #design@maya started a call: https://meet.jit.si/acme-Xq3vT9kP

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.
slash_command_that_runs_an_action.pyexample
import hmac, secrets
from clickruntime import on_event, credentials, http

BASE = "https://chat.acme.com/api/v4"

@on_event
def handle(event):
    form = event.json or {}
    if not hmac.compare_digest(form.get("token", ""), credentials.secret("MATTERMOST_COMMAND_TOKEN")):
        return {"error": "bad token"}
    room = f"https://meet.jit.si/acme-{secrets.token_urlsafe(8)}"
    http.post(f"{BASE}/posts", headers={"Authorization": f"Bearer {credentials.secret('MATTERMOST_TOKEN')}"},
              json={"channel_id": form["channel_id"],
                    "message": f"@{form['user_name']} started a call: {room}"}).raise_for_status()
    return {"room": room}

FAQ

Common questions

Who can run the slash command?
Anyone with access to the channel where Mattermost allows the command. You can limit it by team or channel in Mattermost, and the action itself can check the user name before it runs anything sensitive.
Can the reply be private to the person who ran it?
Yes. Mattermost lets a command reply either to the whole channel or only to the sender. This setup replies in the channel by default, but you can choose an ephemeral reply for anything confidential. Use this for anything confidential.
How fast does it need to respond?
Mattermost expects a quick answer to a slash command, within a few seconds. For quick actions this is fine, and for longer ones it is common to reply right away and post the result as a follow-up message.
What permissions does it need?
create slash command (team admin) + create_post. 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 for each event the app sends.
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 “Add a slash command that runs your automation” from your assistant

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