Workflows, explained
Everything a workflow can do, how a run works and how to fix one, with examples you can play on the right.
01Overview
1.1What a workflow is
A workflow does something in your server when something happens, without any code. It starts with one When step (a trigger: someone joins, a message is sent, a time of day). Lines join it to checks, which split the run into Yes and No, and to actions, which do something in Discord. A run follows the lines and ends where a line ends.
1.2Your first one in 5 minutes
- Open Workflows and press New workflow. Pick Start empty, or a template to skip ahead.
- Set the When step to Member joins. It gives the rest of the workflow a member to work with.
- Add an Account age check set to 7 days. It says Yes when the account is newer than that.
- On Yes: Send a message to your mod channel:
New account: {member} ({member.created}). - On No: Give a role, like Member. Mello’s own role has to be above it in Server Settings → Roles.
- Open the Preview tab, then switch it on. The preview runs it with a pretend member; nothing happens in Discord.
02Free and Premium
2.1Limits
Workflows are free. Premium raises the limits and adds the Premium steps.
| Free | Premium | |
|---|---|---|
| Workflows | … | … |
| Steps in one workflow | … | … |
| Random chance paths | … | … |
| Scheduled workflows | … | … |
| Longest wait | … | … |
03Variables
Variables put real names, numbers and links into a workflow’s text. Write them in curly braces; Mello fills them in when the step runs.
3.1In any text
These come from the When step. A When step without a member, like On a schedule,
has no {member}: saving tells you when a step needs something its When step doesn’t
give.
| Write | Becomes | When |
|---|---|---|
{member} | a ping: @frzn | there’s a member |
{member.name} | frzn | there’s a member |
{member.id} | their Discord id | there’s a member |
{member.created} | 3 years ago | there’s a member |
{server} | the server’s name | always |
{channel} | #general | message triggers |
{message} | the message text | message triggers |
{emoji} | the emoji | reaction triggers |
Messages only ever ping the member: never roles, never everyone.
3.2Saved variables
A Set a variable step keeps a value for this run only, for one member, or for the
whole server. Read it anywhere as {var.name}. When a member and the server
both have one with the same name, the member’s value wins. Saved values are read again after a
wait, so a run that waited sees the newest value.
3.3Counters
Add to a counter adds (or takes away, with a minus number) for a member or the whole
server. Counters add in the database one at a time, so two runs at once never lose a count.
3.4From outside Mello
{webhook.name} holds the top-level values sent to a Webhook received link, and {response.field} the fields read by Get from a link. Both are Premium
steps.
04Triggers (When)
Every workflow has exactly one When step. Its own filters (a channel, some words, skip bots) are checked first.
4.1In Discord
4.2From a Mello module
Other Mello modules can start a workflow. Things that happen while a workflow is running don’t start another one, so workflows can’t loop through a module.
4.3Schedules and webhooks
On a schedule runs every day, week or month at a set time, in the server’s time zone (Bot settings). Free servers get one scheduled workflow. If Mello or the server is away at that time, that run is skipped, not caught up.
Webhook received gets a secret link when you save. Send it JSON (up to 16 KB, 30 calls a minute); “Make a new link” replaces it. Custom slash command adds a command to that server only; it answers privately with “Done.” or why the run stopped.
05Actions (Do)
5.1Messages
5.2Members
Mello’s role has to be above any role it gives or takes. Kick and Ban run at most 5 times an hour per workflow.
5.3Channels
5.4Outside Mello
Links must be public https addresses (no private or local ones). Answers can be up to 100 KB and have 8 seconds to arrive.
06Checks
A check has a Yes and a No dot. Join each to the step that should run next, or leave one empty to end the run there.
6.1Compare and match
If / otherwise compares any {variable}: is, isn’t, contains, starts with, more, less, empty. The others check one thing about the member, the message or the time.
6.2Random chance
Random chance has 2 to 10 paths (A to J), each with a share of at least 1%; the shares add up to 100. Each run picks one path by its share. Free servers get … paths.
6.3Once per member
Once per member says Yes the first time for each member, or at most once every so often (a cooldown). Use it so a greeting or a tip doesn’t repeat.
07Flow
7.1Waits
Wait pauses a run for up to … on Free and … on Premium. Wait until (Premium) waits for a time of day. A waiting run is saved, so a restart doesn’t lose it. If the workflow is switched off or deleted meanwhile, the run ends as stopped.
7.2Repeat for each
Repeat for each (Premium) runs the next steps once for each member with a role, up to 100, with that member as the run’s member. Waits can’t come after it, and a repeat can’t sit inside another repeat.
7.3Run another workflow
Run another workflow (Premium) runs one of your other workflows as part of this run, at most 3 deep. Waits inside it aren’t followed. Stop ends the run on purpose.
08How a run works
8.1Order of steps
The When step’s filters are checked first. Then the steps run one after another: a check follows its Yes or No line, and the run ends where a line ends. A step with no line into it never runs (the builder marks it “Not connected yet”). Lines can’t go back into the When step or form a circle.
8.2Preview
The builder’s Preview tab runs the workflow with a pretend member: a new account (3 days old) or an older one (2 years), plus a test message for message triggers. Nothing happens in Discord. Waits are skipped so you see the whole run, and Random chance takes its first path. The player on this page uses the same preview.
8.3Run log
Every run is written to the run log with who it ran for and a line per step; each workflow keeps its last 50. The Workflows list shows how many times each ran, when it last ran and its last error.
09Edge cases
9.1Closed DMs
If a member’s DMs are closed, Send a DM is skipped and the run goes on. The same goes for a reaction that can’t be added.
9.2Deleted channels and roles
A channel or role that was deleted, a missing permission, or a role above Mello’s stops the run as failed, with the reason in the run log. A channel or role made again has a new id, so pick it again in the step.
- Mello never reacts to its own messages, to webhook posts or to system messages.
- Message edited or deleted only sees messages Mello still has in memory.
- A run that’s halfway through when Mello restarts is lost; runs that are waiting are kept.
10Rate limits
10.130 runs a minute
One workflow runs at most 30 times a minute. That keeps a busy server, or two workflows that set each other off through roles, from flooding a channel. A Webhook received link takes 30 calls a minute.
10.2Kicks and bans
Kick and Ban run at most 5 times an hour per workflow, so a mistake can’t empty your server.
11Turning it on
11.1Switch on
Each workflow has its own switch. New workflows from a template or the Marketplace start switched off, so you can check them first. Templates that change the server (give a role, kick) ask you to accept that.
11.2Pause everything
While the Workflows module is off or paused, nothing runs: no events, schedules, webhook links, commands, or waits that end.
12Troubleshooting
12.1Why a run stopped
| What you see | What to do |
|---|---|
| Not connected yet | A step has no line into it. Join it to the step before. |
| “Send a DM” needs a member, and “On a schedule” doesn’t have one. | Saving says this when a step needs something the When step doesn’t give. Pick another When step or step. |
| Mello's role must be above @Role. | Move Mello’s role above it in Server Settings → Roles. |
| Mello is missing a permission for this step. | Give Mello that permission in the channel or in Server Settings. |
| Mello doesn't give @Role: it has moderator or admin permissions. | Mello never hands out roles with moderator or admin powers. Pick a role without them. |
| The channel no longer exists. / The role no longer exists. | Pick it again in the step. |
| Something went wrong in this step | Try again; if it keeps happening, tell us in the support server. |
12.2Nothing happens
- Check that the Workflows module and the workflow are both switched on, and not paused.
- Check the When step’s filters: the channel, the words, and Skip bots.
- Open the run log. No run means the When step didn’t match; a run shows where it stopped.
- Run it in the Preview tab with a new and an older account.
13Best practices
- Start from a template, then change it. It’s quicker and the steps are already joined.
- Preview before you switch on, with both a new account and an older one.
- Put Once per member in front of greetings and tips so they don’t repeat.
- Keep Kick, Ban and Time out behind a check, and post a note to a mod channel when they run.
- Give saved variables short, clear names in lowercase, like
thanksorstreak. - Put a short Wait before a welcome DM, so it arrives after they’ve had a look around.
14FAQ
Why didn’t the Preview wait?
The preview skips waits so you can see the whole run at once. Real runs wait.
Can workflows set each other off?
Run another workflow runs one on purpose. Module events raised during a run are ignored, so they can’t loop. Workflows that change roles can start each other through Role given or taken; the 30 runs a minute limit stops a runaway.
What happens to waiting runs when I switch a workflow off?
They end as stopped and show in the run log.
Is it really free?
Yes. Free servers get … workflows of up to … steps; Premium raises that and adds the Premium steps.