> ## Documentation Index
> Fetch the complete documentation index at: https://docs.curebot.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows

> When something happens in your server, check things, then do steps: branch, wait for days, ask with buttons, repeat, and run on a schedule. No code.

A workflow is a map of steps that cure follows by itself whenever something happens. It starts at a **trigger**, and every step after it is linked to the one before:

> **When** a member joins, **wait** 3 days, then **check** whether they have the *Verified* role. **If not**, kick them. **If they do**, DM them a welcome.

That one workflow replaces a moderator remembering to check every new member, every day, forever. Workflows can branch, merge, pause for up to 30 days, ask members questions with buttons, repeat parts of themselves, make channels and threads, run cure's own features and talk to other apps.

> [!NOTE]
>
> Workflows are built on the dashboard: **Dashboard → Automation → Workflows**. You need **Automation** access in [dashboard access](https://docs.curebot.site/start/dashboard-access.md) to change them, or view access to look.

## Start from a template

**Workflows** lists ready-made workflows under **Start from a template**. Each one opens in the editor switched off, as a normal workflow you can change:

| Template | Does |
| - | - |
| **Staff application review** | A form opens a private thread; your staff press Accept or Decline; the role and a DM follow |
| **Ticket follow-up** | An hour after a ticket closes, asks in DMs whether it was solved, and opens a new ticket if not |
| **Close quiet tickets** | Three days after a ticket opens, asks if it's still needed, and closes it on no or no answer |
| **Low modmail rating follow-up** | A 1 or 2 star modmail rating alerts your staff and sends the member an apology |
| **Urgent modmail alert** | Modmail mentioning a scam, a hacked account or something urgent pings your staff |
| **Bump milestones** | Counts each member's /bump uses with another bot, and rewards every 10th |
| **Trial role that ends** | Takes your trial role away again after 7 days, and tells them |
| **Website down alert** | Checks a web address every 30 minutes and tells staff when it doesn't answer properly |
| **Live chat thread** | When your stream goes live, opens a thread for it, and locks it 6 hours later |
| **Welcome back** | Greets members who rejoin differently from first-timers |

Each one does something cure's own features can't do alone: wait days, ask and branch on the answer, keep count, or link features and other apps together.

Roles and channels differ in every server, so templates leave them empty. The editor's [problems list](#problems) says what to pick before it saves.

![The Workflows page with the template gallery highlighted](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflows-templates.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=aa077bdc0f79ffa5bdafe6288cf841d9)

Workflows, with Start from a template under your workflows.

## The editor

Open a workflow, or press **New workflow**, and the editor fills the whole window.

| Part | What it does |
| - | - |
| **Top bar** | Back to the list, the workflow's name, on or off, undo and redo, **Test**, and **Save** |
| **Add a step** (left) | Every step, grouped and searchable. Click one to add it, or drag it onto the canvas |
| **Canvas** (middle) | Your steps and the links between them |
| **Settings** (right) | The selected step's settings. With nothing selected, an overview, recent runs and shortcuts |

![The workflow editor with four numbered areas](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflow-editor.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=6b44b67fa5c26f6d88740d13d7b59040)

1 the top bar, 2 Add a step, 3 the canvas, 4 the selected step's settings.

On phones the canvas fills the screen. **Add a step** and a step's settings open as sheets from the bottom, and undo and redo sit with the zoom buttons.

### Moving around

* **Drag empty space** to move around. On a trackpad or with a mouse wheel, scroll.
* **Zoom** with Ctrl (⌘ on a Mac) and scroll, by pinching, or with the **+** and **−** buttons. **Fit** shows the whole workflow.
* The **map** in the corner shows where you are. Click it to jump there.
* Press **F** to fit and **+** or **−** to zoom.

### Adding and linking steps

Each step has a dot on its left (where a run comes in) and one or more labelled dots on its right (where a run goes next). A check has **Yes** and **No**; most actions have **Then** and **If it fails**.

**1. Add after a step**

Select a step, then click one in **Add a step**. The new step goes to its right, already linked from its first free output.

**2. Link two steps**

Drag from an output dot onto another step.

**3. Add a step exactly where it goes**

Drag from an output dot into empty space and let go. A small menu opens there: pick a step and it's added, already linked.

**4. Remove a link**

Click the line, then **Remove link** (or press Delete).

![Dragging from a step's output dot into empty space opens Add a step here](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflow-linking.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=0a555cdfd5950f3796d73e392d144473)

1 drag from an output dot, 2 let go in empty space and pick the step to add there.

Drag a step by its body to move it. Steps placed higher up run first when one output leads to several steps (see [how a run moves](#how-a-run-moves)).

A step that no run can reach is faded and marked **Not linked to the trigger**. It's kept, but it never runs until you link it in.

### Keys

| Keys | Does |
| - | - |
| Delete or Backspace | Removes the selected step or link |
| Ctrl Z, Ctrl Shift Z (or Ctrl Y) | Undo, redo |
| Ctrl D | Copies the selected step |
| Ctrl S | Saves |
| F | Fits the workflow on screen |
| + and − | Zoom |
| Escape | Closes the menu, then the selection, then the editor |

On a Mac, use ⌘ instead of Ctrl.

### Problems

The editor checks the workflow as you build it:

* **Errors** stop it saving: a step missing a role, channel or message; a check with nothing to compare; a step that can't be undone without **I understand**; a step that doesn't fit the trigger; a workflow switched on with no action linked.
* **Warnings** save fine but are worth a look: a step not linked to the trigger, a check with nothing after it, a repeat with nothing to repeat.

Steps with an error get a red outline and a count; steps with a warning get a grey count. The **problems** button in the top bar opens the full list, and clicking one takes you to its step. A step's own problems also show at the top of its settings. If cure refuses something when you save, that's added to the list too.

![The problems button and the problems list](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflow-problems.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=a7c030d9d4f80f75a4d4997d41dbee81)

1 the problems button, 2 the list. Click a problem to go to its step.

### Saving

Nothing changes in your server until you press **Save**. If you try to leave with unsaved changes, cure asks first: keep editing, leave without saving, or save and leave. The link in your address bar (`…/workflows?workflow=…`) opens the same workflow, so you can send it to another staff member.

Switch a workflow **On** in the top bar, or straight from the list, to start it running.

## How a run moves

When the trigger happens, a **run** starts at the trigger and follows the links:

* **One path at a time.** If an output leads to several steps, they run from top to bottom as drawn, and each path runs to its end before the next one starts.
* **Paths can merge.** A step linked from two places runs once for each arrival.
* **Paths can loop back.** Link a later step back to an earlier one, and the run goes round again, until a limit stops it.
* **Failures carry on.** If an action fails (a missing permission, a deleted role), the run follows **If it fails** when that's linked, and otherwise carries on down **Then**. The failure is in the run's log either way.
* **Stop** ends the whole run, even if other paths are still waiting their turn.

> [!NOTE]
>
> Things a workflow does never start another workflow. A rule like "when someone is banned, ban them" can't loop, and one workflow's role change won't set off another workflow's "role is given".

## Triggers

The trigger is the first step, and every workflow has exactly one. Select it to change it.

| Group | Triggers |
| - | - |
| **Members** | A member joins, leaves, passes verification, gets or loses a role, changes nickname, starts or stops boosting, levels up, has a birthday, makes an invite, is unbanned |
| **Time** | On a schedule |
| **Other bots** | Someone uses another bot's command |
| **Voice** | A member joins voice, leaves voice, starts streaming |
| **Messages and threads** | A message is sent, edited or deleted; a reaction is added or removed; a thread is started or archived |
| **Forums** | A forum post is made, someone replies in one, a tag is added to a post |
| **Channels** | A channel is made, a channel is deleted |
| **Tickets and forms** | A ticket is opened, claimed or closed; a form is sent |
| **Modmail** | A thread opens, a member sends a message, a thread closes, a member rates a thread |
| **Giveaways** | A giveaway starts, ends, or a member wins one |
| **Moderation** | A member is warned, timed out, kicked, banned or jailed; an appeal is sent or decided |
| **Twitch** | A stream goes live, a stream ends |

The editor only offers steps and checks that make sense for your trigger. If you change the trigger later, steps that no longer fit are marked **This step needs a different trigger**.

### Who the "member" is

Most triggers are about a member: the person who joined, sent the message, opened the ticket, won the giveaway. Steps like **Give a role** and **DM the member** act on them.

A few triggers have no member behind them: **On a schedule**, **A channel is made** and **A channel is deleted**. cure stands in for the member, so member steps are hidden for those.

For **Someone uses another bot's command**, the member is the person who *ran* the command (see [below](#another-bots-command)).

### On a schedule

Pick **On a schedule** and choose how it repeats:

| Repeats | Settings |
| - | - |
| **Once** | A date and time |
| **Every few minutes, hours or days** | From every 10 minutes to every 30 days |
| **Daily, or on some weekdays** | A time, and the days. Pick none for every day |
| **Monthly** | A time, and a day of the month |

Each schedule has its own **time zone**, set to your browser's when you make it. Times stay put when the clocks change: "every day at 09:00" is 09:00 all year. A time skipped when clocks go forward runs just after the gap, and a time that happens twice runs once. A monthly schedule on the 31st runs on the last day of shorter months.

If cure was offline when a schedule was due, it runs once when cure is back, then carries on at its usual times. It never runs every missed time in a row.

![Schedule settings on the trigger](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflow-schedule.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=7a321abc8a701bf5a3ee980d20c1750d)

A schedule that runs every 30 minutes, in its own time zone.

### Another bot's command

Discord doesn't tell bots when someone uses *another* bot's slash command, only when that bot answers. So this trigger starts when the other bot replies to the command.

**1. Copy the command**

In Discord, type `/`, find the other bot's command, right-click it (long-press on phones) and copy its mention. It looks like `</bump:947088344167366698>`.

**2. Paste it**

Select the trigger, pick **Someone uses another bot's command**, and paste it into **Command**. You can also type just the name, like `bump`.

**3. Optional: the bot**

If two bots have a command with the same name, put the one you mean in **Bot ID**.

In the run:

* The **member** is the person who ran the command, so you can thank, reward or remind *them*.
* The **message** is the other bot's answer, so **React to the message** and **Reply to the message** act on it.
* `{command.name}`, `{bot.name}` and `{bot.id}` say what was used. A command like `/config set` counts for `config` too.

![Another bot's command on the trigger](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflow-bot-command.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=3877e36c53002ed62f3e1e35a0eeafa1)

The command pasted from Discord, and the optional bot ID.

## Steps

### Flow steps

| Step | Outputs | What it does |
| - | - | - |
| **Check** | Yes, No | Tests one or more things. **All match** goes down Yes only if every test passes; **Any matches** if at least one does. With nothing to test, it always goes Yes |
| **Wait** | Then | Pauses from 1 second to 30 days |
| **Ask with buttons** | One per answer, No answer | Posts a question with up to 5 buttons and waits for an answer |
| **Repeat** | Each time, When done | Runs everything linked to **Each time** 1 to 25 times, then carries on from **When done**. `{loop.index}` is the pass number |
| **Stop** | none | Ends the run |
| **Note** | none | A note for your staff. Never runs, never linked |

Any step can have a **Step name**, shown on the canvas instead of its default title. "Kick unverified" reads better than "Kick them".

### Waits that survive restarts

A wait of **a minute or more** is saved: the run stops there, and cure carries it on when the time comes, even if cure restarted in between. When it carries on, the member, channel and message are looked up again, so a check after a wait sees the member *as they are by then*. That's what makes "wait 3 days, then check for the Verified role" work.

Shorter waits just pause, and are lost if cure restarts during them.

You can see every run that's waiting in **Workflows → Waiting**, and cancel any of them. A waiting run is dropped if its workflow is turned off, and cancelled if it's deleted. If you edit a workflow while runs are waiting, they carry on with the steps it has now.

### Ask with buttons

Ask a question and go a different way for each answer.

| Setting | What it means |
| - | - |
| **Question** | The text, with variables. It pings the member unless it's in their DMs or anyone can answer |
| **Answers** | 1 to 5 buttons. Each one is an output on the step |
| **Wait for an answer** | 30 seconds to 7 days. After that the step goes down **No answer** |
| **Ask in** | Where it happened, the member's DMs, or a channel you pick |
| **Who can answer** | Only the member, or anyone |

The answer picked is `{answer}`, its number (1 to 5) is `{answer.number}`, and the ID of whoever pressed it is `{answer.user}`. Once answered, the buttons grey out and the message says who answered. Like long waits, questions survive restarts.

![An ask step on the canvas and its settings](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflow-ask.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=b46822894697d56378f153ecc9faf488)

1 an ask step with an output per answer and one for no answer, 2 its settings.

![](https://docs.curebot.site/images/cure-avatar.jpg)

cureAPPToday at 4:12 PM

@sukii Want pings for announcements?

Answer in 1 day

### Checks

A check tests things about what happened. The editor lists the ones that fit your trigger.

| About | Tests |
| - | - |
| **The member** | Is a bot, account age in days, has or lacks a role, is boosting, days since they joined, their ID |
| **The message** | Its text, length, files attached, has a link, mentions in it |
| **Where** | Channel, channel type (text, voice, announcement, forum, stage, category, thread), channel name, voice channel |
| **The event** | Reaction, ticket panel, reason, appeal decision, new level, giveaway prize, post tags and title, thread title, command name, bot ID, form, modmail topic and rating, Twitch streamer |
| **Time and luck** | Hour of the day (UTC), day of the week (UTC), random chance in percent |
| **Anything** | **Any value or `{variable}`**: write any text with variables in it and compare it, like `{var:count}` is over `10`, or `{http.status}` is `200` |

Numbers compare with *is over* and *is under*; text with *is*, *is not* and *contains*. Text comparisons ignore upper and lower case.

### Actions

> [accordion] Messages
>
> | Action | Settings |
> | - | - |
> | **Send a message** | Write it, or pick a design from [Message Studio](https://docs.curebot.site/studio/messages.md). Posts where it happened, or in a channel you pick |
> | **DM the member** | The same, in their DMs. Nothing happens if their DMs are closed |
> | **Reply to the message** | Replies to the message that started the run |
> | **React to the message** | An emoji |
> | **Pin**, **Unpin**, **Delete**, **Move the message** | The message that started the run. Delete and move need confirming |
> | **Start a thread on the message** | A thread name |
> | **Publish an announcement** | Publishes the message it started from, or the last one this run sent, to every server following the announcement channel |
> | **Start a poll** | A question, 2 to 10 answers (55 characters each), how many hours it runs (up to 768), and whether people can pick more than one |

> [accordion] Channels
>
> | Action | Settings |
> | - | - |
> | **Make a channel** | A name (variables work, like `help-{user.name}`), the kind (text, voice, announcement, forum, stage, category), a category, a topic, and **Only the member and cure can see it** |
> | **Copy a channel** | Copies a channel with its permissions, with an optional new name |
> | **Rename a channel** | A new name |
> | **Move a channel to a category** | A category, or none |
> | **Set a channel's topic** | The topic |
> | **Set slowmode** | Seconds, 0 to 21,600. 0 turns it off |
> | **Lock** and **Unlock a channel** | Stops (or lets) everyone, or one role, send messages, make threads and react. In voice, it stops joining. In a thread, it locks the thread |
> | **Change channel permissions** | For the member, everyone, a role, or an ID or variable: permissions to allow, deny, or reset to the default |
> | **Clear messages** | Deletes the last 1 to 100 messages, or only the member's. Messages older than 14 days stay. Needs confirming |
> | **Delete a channel** | With a reason. Needs confirming |

> [accordion] Threads, forums and announcements
>
> | Action | Settings |
> | - | - |
> | **Make a forum post** | A forum, a title, the first message, and tags by name |
> | **Start a thread in a channel** | A name, an optional first message, and **Private, with the member added** |
> | **Add someone to a thread**, **Remove someone from a thread** | The member, or someone by ID or variable |
> | **Rename**, **Lock**, **Unlock**, **Close** and **Reopen a thread** | The thread it happened in, or one made earlier |
> | **Add** and **Remove a tag** | A tag on the forum post it happened in |
> | **Follow an announcement channel** | Posts an announcement channel's messages in another channel |

> [accordion] Members
>
> | Action | Settings |
> | - | - |
> | **Give a role**, **Remove a role** | A role below cure's highest role |
> | **Change their nickname** | Up to 32 characters, variables work |
> | **Give XP** | A whole number. A minus sign takes XP away |
> | **Give points**, **Give coins**, **Take coins** | 1 to 1,000,000 |
> | **Move them to a voice channel**, **Disconnect them from voice** | A voice channel |
> | **Remind them later** | After how long (30m, 2h, 3d, up to a year), the reminder, and optionally a channel to ping them in instead of a DM. It's the same as [`,remind`](https://docs.curebot.site/community/reminders) |

> [accordion] Tickets
>
> | Action | Settings |
> | - | - |
> | **Open a ticket for them** | A ticket panel |
> | **Close the ticket**, **Rename the ticket**, **Add a role to the ticket** | The ticket it happened in |

> [accordion] Moderation
>
> | Action | Settings |
> | - | - |
> | **Warn**, **Jail**, **Kick**, **Ban them** | A reason. Each one is a case in their history. Jail, kick and ban need confirming |
> | **Time them out**, **End their timeout** | How long, like 10m |
> | **Note it in their history** | A note |

> [accordion] cure's features
>
> | Action | Settings |
> | - | - |
> | **Play music** | A song, link or search. Plays in the member's voice channel, or one you pick |
> | **Control the music** | Skip, pause, resume, shuffle, clear the queue, or stop and leave |
> | **Start a giveaway** | A prize, how long (1 minute to 60 days) and how many winners (up to 20). The member is the host |
> | **Run a custom command** | One of your [custom commands](https://docs.curebot.site/studio/custom-commands.md): one of its functions by name, or its command script. It runs as the member |
> | **Cancel waiting runs** | Stops this workflow's (or another's, or every workflow's) waiting runs for this member |

> [accordion] Data and logic
>
> | Action | Settings |
> | - | - |
> | **Set a variable** | A name and a value. Keep it for this run, for the member, or for the server |
> | **Add to a variable** | A name and how much to add (a minus sign takes away). Empty counts as 0 |
> | **Pick at random** | Choices, one per line |
> | **Random number** | From and to, both included |
> | **Do a sum** | Add, take away, times, divide, remainder, smaller or bigger of, power, round, round up or down, without minus sign |
> | **Change some text** | Upper or lower case, count characters, trim, reverse, first word, replace, cut a piece, contains, repeat |
> | **Send a web request** | A URL, method, body and headers. See [web requests](#web-requests) |

### Steps that can't be undone

Ban, kick, jail, delete the message, move the message, clear messages and delete a channel each need **I understand this can't be undone** turned on before the workflow saves. Until then the step says **Needs confirming** on the canvas.

### Channels made earlier in a run

A channel field can point at the channel the run is about, a channel you pick, or something the run made:

| Choice | Means |
| - | - |
| **Where it happened** | The channel of the message, thread or voice channel it started from (the default) |
| **The channel made earlier** | The channel a **Make a channel** or **Copy a channel** step made earlier in this run |
| **The thread made earlier** | The thread or post a **Start a thread** or **Make a forum post** step made |

So "make a channel, then post in it" is two steps: **Make a channel**, then **Send a message** with **The channel made earlier**.

## Variables

Variables fill in text when a step runs. Select the trigger to see the list for it.

**The member and server**: `{user.mention}`, `{user.name}`, `{user.display_name}`, `{user.id}`, `{server.name}`, and the rest of the [script variables](https://docs.curebot.site/studio/scripts.md).

**From the trigger**: each trigger adds its own, for example:

| Trigger | Variables |
| - | - |
| A member levels up | `{level}`, `{level.previous}` |
| A ticket is opened or closed | `{ticket.number}`, `{ticket.panel}`, `{ticket.reason}` |
| A member is warned, timed out, kicked, banned or jailed | `{case.reason}`, `{case.id}`, `{case.moderator}` |
| An appeal is decided | `{appeal.decision}` (accepted or denied) |
| A giveaway starts, ends or is won | `{giveaway.prize}`, `{giveaway.winners}`, `{giveaway.entries}` |
| Someone uses another bot's command | `{command.name}`, `{bot.name}`, `{bot.id}`, `{message.content}` |
| On a schedule | `{schedule}`, `{schedule.at}` |
| A channel is made or deleted | `{channel.name}`, `{channel.mention}` |
| A form is sent | `{form.name}`, and each answer as `{form.<field ID>}` |
| It's a member's birthday | `{birthday.age}` |
| A modmail thread opens, gets a message, closes or is rated | `{modmail.topic}`, `{message.content}`, `{modmail.reason}`, `{modmail.rating}` |
| A nickname changes | `{nickname.before}`, `{nickname.after}` |
| A message is edited | `{message.before}`, `{message.content}` |
| A Twitch stream goes live | `{twitch.user.name}`, `{twitch.stream.title}`, `{twitch.stream.url}`, `{twitch.stream.category}` |

**From the run**:

| Variable | Is |
| - | - |
| `{var:name}` | A variable this run set, with **Set a variable**, a sum, a random pick or a text change |
| `{mvar:name}` | A variable saved for the member |
| `{svar:name}` | A variable saved for the server |
| `{answer}` | The answer to the last question |
| `{created.channel.mention}`, `{created.thread.mention}` | What a step made |
| `{http.status}`, `{http.body}`, `{http.json.key}` | The last web request's answer |
| `{loop.index}` | Which pass of a repeat this is |
| `{workflow.name}` | This workflow |

> [!TIP]
>
> Saved variables are shared with [custom commands](https://docs.curebot.site/studio/custom-commands.md). A workflow can add to `{mvar:warnings}` and a custom command can show it, or the other way round. See every saved value in **Custom commands → Variables**.

A run's own variables (`{var:…}`) last for the whole run, including after waits and questions. Saved ones last until something changes them. A server keeps up to 200 saved variables, and each member up to 50.

## Web requests

**Send a web request** talks to another app: a spreadsheet, your own website, a game server.

| Setting | What it means |
| - | - |
| **URL** | An `https://` address. Variables in it are made URL-safe |
| **Method** | GET, POST, PUT, PATCH or DELETE |
| **Body** | Sent with POST, PUT and PATCH. Variables work. If it starts with `{` or `[`, it's sent as JSON |
| **Headers** | One per line, like `Authorization: Bearer abc123`. Up to 10 |

After it runs, `{http.status}` is the status (like `200`), `{http.body}` the first 1,500 characters of the answer, and if the answer is JSON, each value is `{http.json.<key>}`, with dots for nested values: `{http.json.user.name}`. A status of 400 or more counts as failing, so **If it fails** can handle it.

> [!WARNING]
>
> cure refuses addresses on private networks (like `127.0.0.1` or `192.168.…`), waits 8 seconds at most, doesn't follow redirects, and lets each server's workflows send 30 requests a minute. Don't put secrets you wouldn't share with your staff into a request: anyone who can edit workflows can see them.

## Testing

Press **Test** in the top bar. Pick a channel, and for message or reaction triggers type some text or an emoji, then **Run test**. cure runs the workflow with you as the member:

* Checks are real: it looks at your roles, the channel, the text you typed.
* Nothing is sent, given, changed or saved. Waits don't wait, and questions take their first answer.
* The canvas lights up the path it would take. Steps it wouldn't reach fade, and each check shows what it saw.

If you change the workflow after testing, run the test again.

![A test run lighting up the path](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflow-test.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=3f483bd1a2ca24fa1286149815225554)

1 Test, 2 the result: the path it would take, and what each check saw.

## Runs, logs and waiting runs

The list page has three tabs:

* **Workflows**: every workflow, with its trigger, how many steps and runs it has, when it last ran, and its on switch.
* **Waiting**: runs paused at a wait or a question, when each one carries on, and a button to cancel it.
* **Recent runs**: what happened, newest first: how many actions worked, which failed and why, and when a run stopped at a limit or is waiting. These are kept since cure last started.

![The Waiting tab with one waiting run](https://mintcdn.com/cure/JT6OLTifSCrGzVw3/images/screenshots/workflows-waiting.png?fit=max\&auto=format\&n=JT6OLTifSCrGzVw3\&q=85\&s=8917ec6b09face65bf6975019d24d061)

A run waiting at a wait or question, with the button to cancel it.

Open a workflow and its overview shows its own recent runs too.

## Limits

| Limit | Amount |
| - | - |
| Workflows per server | 50 |
| Steps per workflow | 80 |
| Links per workflow | 160 |
| Steps one run can pass through | 50 |
| Times one step can run in one run | 25 |
| Runs a minute, per workflow | 25 |
| Checks in one check step | 10 |
| Repeat | 1 to 25 times |
| Wait | 1 second to 30 days |
| Question | 30 seconds to 7 days, up to 5 answers |
| Runs waiting, per workflow | 500 |
| Things waiting, per server (waits, questions and reminders) | 2,000 |
| Web requests a minute, per server | 30 |

A run that reaches a limit stops, and its log says which one. The run limits also stop a path that loops back on itself forever.

## Recipes

> [accordion] Verify or kick after 3 days
>
> 1. Trigger: **A member joins**.
> 2. **Wait** 3 days.
> 3. **Check**: Member roles don't include *Verified*.
> 4. From **Yes**: **Kick them**, reason "Didn't verify in 3 days". Turn on **I understand**.
> 5. From **No**: **DM the member**: `Thanks for verifying, {user.name}`.
>
> To also stop the wait the moment they verify, make a second workflow: **A member passes verification** → **Cancel waiting runs** of the first one.

> [accordion] Thank whoever bumps, and remind them in 2 hours
>
> 1. Trigger: **Someone uses another bot's command**, command `</bump:…>` pasted from Discord.
> 2. **React to the message**: 👍.
> 3. **Give coins**: 50.
> 4. **Remind them later**: after 2h, "Time to /bump again", ping them in the bump channel.

> [accordion] Question of the day
>
> 1. Trigger: **On a schedule**, daily at 12:00 in your time zone.
> 2. **Pick at random**, save as `question`, with one question per line.
> 3. **Make a forum post** in your QOTD forum, title "Question of the day", first message `{var:question}`.

> [accordion] Private help channels that clean up after themselves
>
> 1. Trigger: **A reaction is added**, with a **Check**: Reaction is 🎫 and Channel is #get-help.
> 2. **Make a channel**: name `help-{user.name}`, category *Support*, **Only the member and cure can see it** on.
> 3. **Change channel permissions**: channel **The channel made earlier**, for your *Helpers* role, allow ViewChannel and SendMessages.
> 4. **Send a message** in **The channel made earlier**: `{user.mention}, tell us what's wrong.`
> 5. **Wait** 1 day, then **Delete a channel**: **The channel made earlier**. Turn on **I understand**.

> [accordion] Ask before giving a ping role
>
> 1. Trigger: **A member joins**.
> 2. **Wait** 10 minutes.
> 3. **Ask with buttons** in their DMs: "Want pings for game nights?" with **Yes please** and **No thanks**, waiting 1 day.
> 4. From **Yes please**: **Give a role**: *Game nights*.
> 5. From **No answer**: nothing, or a **Note** saying so for your staff.

> [accordion] Count warnings and act on the third
>
> 1. Trigger: **A member is warned**.
> 2. **Add to a variable**: name `warnings`, add 1, kept for the member.
> 3. **Check**: **Any value or `{variable}`** `{mvar:warnings}` is over `2`.
> 4. From **Yes**: **Time them out** for 1d, then **Set a variable** `warnings` to `0` for the member.

> [accordion] Post new tickets to a spreadsheet
>
> 1. Trigger: **A ticket is opened**.
> 2. **Send a web request**: POST to your Google Apps Script or Zapier URL, body `{"number": "{ticket.number}", "panel": "{ticket.panel}", "user": "{user.name}"}`.
> 3. From **If it fails**: **Send a message** in #staff-logs: `Couldn't log ticket {ticket.number}: {http.status}`.

> [accordion] Weekly announcement, published to followers
>
> 1. Trigger: **On a schedule**, daily at 18:00, only Fridays.
> 2. **Send a message** in #announcements with your weekly design.
> 3. **Publish an announcement**: **The last one this run sent**.

## Workflows or custom commands?

Both are built from blocks without code, and they share saved variables.

| | Workflows | [Custom commands](https://docs.curebot.site/studio/custom-commands.md) |
| - | - | - |
| **Starts from** | 49 triggers: events, schedules and other bots' commands | A command someone types, a few events, buttons |
| **Shape** | A map: branches, merges, loops | A stack of blocks, Scratch-style |
| **Waits** | Up to 30 days, survives restarts | Up to 15 seconds per run |
| **Questions** | Buttons, up to 7 days | Their next message, up to 60 seconds |
| **Best for** | Server automation that runs by itself | Commands and buttons members use |

They work together: a workflow can **Run a custom command**, and a custom command's buttons can do what a workflow can't.

## Troubleshooting

> [accordion] It doesn't run at all
>
> * Is it switched **On**? Check the list.
> * Is it saved? The top bar says **Unsaved changes** until you press Save.
> * Are its steps linked to the trigger? Faded steps aren't.
> * Look in **Recent runs**: "conditions did not match" means a check went down **No**. Run a **Test** to see what the check saw.
> * Things a workflow does never start another workflow, so a role given by one workflow won't start another's "a role is given".

> [accordion] An action fails
>
> The run's log says why. The usual reasons:
>
> * **cure's role is too low.** Move it above the roles it gives, takes or manages, and above members it kicks, bans or renames.
> * **A missing permission**, like Manage Channels to make channels or Manage Messages to pin.
> * **Something was deleted**: a role, channel or saved design. Deleting a role or channel removes the steps that used it and links the steps around them.
> * **The step needs something the event doesn't have**: Reply needs a message, Close the ticket needs a ticket.

> [accordion] Another bot's command doesn't start it
>
> The trigger starts when the bot *answers* the command. If the bot answers only to the person who ran it (a reply only they can see), Discord doesn't show cure the answer either. Check the command name matches what the bot shows under its reply, and leave **Bot ID** empty unless you need it.

> [accordion] A schedule runs at the wrong time
>
> Check the schedule's **time zone**. It's set to your browser's when you make it, and staff in other countries see the same zone. Times are wall-clock times there.

> [accordion] A run stopped early
>
> Its log says "stopped after 50 steps" or "one step ran 25 times". Look for a path that links back on itself, or split a big workflow into two.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.