# Discourse Automation

**URL:** https://meta.discourse.org/t/discourse-automation/195773
**Category:** Plugin
**Tags:** official, automation, included-in-core
**Created:** [July 2, 2021, 1:10pm UTC](https://meta.discourse.org/t/discourse-automation/195773 "2021-07-02T13:10:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [July 2, 2021, 1:10pm UTC](https://meta.discourse.org/t/discourse-automation/195773/1 "2021-07-02T13:10:54Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | **Discourse Automation** lets you automate actions through scripts and triggers. Customisation is made through an automatically generated UI. |
| 📖 | **Install Guide** | **This plugin is bundled with Discourse core**. There is no need to install the plugin separately. |

> [@](#):
>
> :discourse2: As this is an #official plugin maintained by the Discourse team, #Support, #Contribute > Bug, #Contribute > UX, and #Contribute > Feature requests can be made in the respective categories here on Meta, and tagged with the appropriate plugin tag. Click on a link below to get one started. 👍
> 
> [❓&nbsp; **Support**](https://meta.discourse.org/new-topic?category_id=6&body=%3E%20Before%20asking,%20did%20you%20search%20first%3F%20Press%20%F0%9F%94%8D%20at%20the%20upper%20right%20to%20search.&tags=automation "Ask for support on configuring and using Discourse Automation") [🐛&nbsp; **Bug**](https://meta.discourse.org/new-topic?category_id=1&tags=automation "A bug report means something is broken, preventing normal/typical use of the plugin") [👀&nbsp; **UX**](https://meta.discourse.org/new-topic?category_id=9&tags=automation "Discussion about the user interface of Discourse Automation, and how features are presented (including language and UI elements)") [💡&nbsp; **Feature**](https://meta.discourse.org/new-topic?category_id=2&tags=automation "Discussion about how existing Discourse Automation features can be improved or enhanced, and how proposed new features could work")

 ![Capture d’écran 2021-07-02 à 15.13.57](https://global.discourse-cdn.com/meta/original/3X/d/e/de753d7a942fca812ff9fedc458b9f01ea3fa6b9.png)

### Features

- Easy automation of complex workflows
- Triggers automations at specific dates, periodically, or on specific events
- Provides automatically generated UIs to specify options for your automation

### Configuration

Automations can be created and updated from Admin → Plugins → Automations, or directly from `/admin/plugins/discourse-automation`.

 ![/admin/plugins/discourse-automation](https://global.discourse-cdn.com/meta/original/4X/f/3/b/f3b33cb5f526ea72edde39643036d9eb65d9fcc8.png)

#### Available scripts

| Guide | Script | Trigger(s) | Description |
| --- | --- | --- | --- |
| [🔖](https://meta.discourse.org/t/add-user-to-group-through-custom-field-automation/275873) | Add user to group through custom field | ▪Recurring  
▪First logged on | Adds a user to a group based on a Custom User Field |
| [🔖](https://meta.discourse.org/t/append-last-checked-by-automation/277110) | Append last checked by | ▪After post cook | Adds a ‘last checked by’ function to the bottom of the OP |
| [🔖](https://meta.discourse.org/t/append-last-edited-by-automation/277113) | Append last edited by | ▪After post cook | Adds a ‘last edited by’ note to the bottom of the OP |
| [🔖](https://meta.discourse.org/t/create-an-auto-responder-automation/285031) | Auto Responder | ▪Post edited/created  
▪PM created | Given a series of keywords and associated replies, automatically respond with the corresponding reply |
| | Auto Tag topic | ▪Post created/edited  
▪PM created | Automatically tag a topic |
| | Close topic | ▪Point in time  
▪Stalled wiki | Automatically close a topic |
| | Create Post | ▪Recurring  
▪Point in time | Creates a post |
| | Flag post on Words | ▪Post edited/created | Flag a topic on creation/edition if it contains specific words |
| | Gift Exchange | ▪Point in time | Simple implementation of the Secret Santa game |
| | Group Category Notification Default | ▪Category created/edited | Automatically sets a group notification level for newly created subcategories |
| | Make banner topic | ▪Point in time | Convert a topic into a banner notice |
| | Pin Topic | ▪Point in time | Pin and Unpin a topic in the future |
| | Random Assign  
([Assign](https://meta.discourse.org/t/discourse-assign/58044)) | ▪Point in time  
▪Recurring | Randomly Assign a topic |
| | Schedule a PM with [data explorer](https://meta.discourse.org/t/32566?silent=true) results  
([Data Explorer](https://meta.discourse.org/t/32566)) | ▪Recurring | Send a regular PM with the results of a [data explorer](https://meta.discourse.org/t/32566?silent=true) query |
| | Send Chat message  
([Chat](https://meta.discourse.org/t/discourse-chat/230881)) | ▪Event started  
▪Recurring | Sends a Chat message to a Channel |
| | Send PMs | ▪First accepted solution ([Solved](https://meta.discourse.org/t/discourse-solved/30155))  
▪User badge granted  
▪User added to group  
▪Stalled wiki  
▪Recurring  
▪User promoted  
▪API call  
▪User removed from group | Send PMs with support for placeholders |
| | Suspend User By Email | ▪API call | Suspend a user for a specified duration |
| | Topic required words | ▪Topic | Enforce the presence of at least one of the specified words in the posts of a topic |
| [🔖](https://meta.discourse.org/t/discourse-ai-post-classifier-automation-rule/281227) | Triage posts using AI ([Discourse AI](https://meta.discourse.org/t/discourse-ai/259214)) | ▪Post created/edited | Enhance the management and moderation of forum posts by automating the process of classifying posts |
| | User Global Notice | ▪Stalled topic  
▪First accepted solution ([Solved](https://meta.discourse.org/t/discourse-solved/30155)) | Displays a global notice on the site for a specific user |
| [🔖](https://meta.discourse.org/t/user-group-membership-management-through-badges/281836) | User Group Membership through Badge | ▪Recurring  
▪User first logged in | Automatically add users to a group based on their earned badges |
| | Zapier webhook | ▪User promoted  
▪User added to group  
▪User badge granted  
▪User removed from group | Calls a Zapier webhook |

#### Available triggers

> Note that due to their nature, each script only supports certain triggers. For example it wouldn’t make sense for a script enforcing the content of a post to trigger when a user is added to a group.

All of the available triggers are mentioned in the “Available scripts” table above.

Most of the triggers are self-explanatory, but here are a couple that may need a little more detail:

| Trigger | Description |
| --- | --- |
| After post cook | Triggers after a post is rendered for display |
| API Call | Triggers when a certain API endpoint is called |
| Stalled wiki | Triggers when a wiki hasn’t been edited for a while |
| Stalled topic | Triggers when a topic has not received replies after a certain time |
| Topic | Triggers when a reply is made to a topic |

If you need any clarification on any others please feel free to ask below. 🙂

More scripts and triggers to come!

### Custom Automations

You can also create custom Automations. 🥳 Check out our developer’s guide for more information - [Create custom Automations](https://meta.discourse.org/t/create-custom-automations/275931)

  

> :discourse2: Hosted by us? This plugin is available on our Business and Enterprise plans. [Automation | Discourse - Civilized Discussion](https://www.discourse.org/plugins/automation.html)

> Last edited by @tobiaseigen 2025-07-16T20:41:38Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [August 20, 2023, 3:05pm UTC](https://meta.discourse.org/t/discourse-automation/195773/86 "2023-08-20T15:05:59Z")

</div>

Just to note, I’ve updated the OP with a table of all the existing Automations and their accompanying triggers. 👍

(I’m also hoping to add more guides too, as the one for ‘Add user to group…’ looks a bit lonely all by itself 🙂)

* * *

There are a couple more walkthroughs added for [Setting up the ‘Append last edited by’ automation](https://meta.discourse.org/t/append-last-edited-by-automation/277113) and [Setting up the 'Append last checked by' automation](https://meta.discourse.org/t/append-last-checked-by-automation/277110). 🎉

And a brand new script, **User Group Membership through Badges**. 🥳 That one is pretty hot off the press so if you try it out, let us know how you get on. 👍

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [October 5, 2023, 6:28am UTC](https://meta.discourse.org/t/discourse-automation/195773/93 "2023-10-05T06:28:35Z")

</div>

Now I feel myself very very… not stupid, but close. Where can I build up automations? Under plugins I can only enable or disable Automation.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 5, 2023, 6:34am UTC](https://meta.discourse.org/t/discourse-automation/195773/94 "2023-10-05T06:34:34Z")

</div>

After enabling the plugin, you should see new item here:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/c/5/6c50f530b126acd9c78cc8c489a1b267282da8ba.png)

It might require refreshing the page to see it.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [October 5, 2023, 6:37am UTC](https://meta.discourse.org/t/discourse-automation/195773/95 "2023-10-05T06:37:22Z")

</div>

Aaand now I feel myself really stupid 🤦‍♂️

Thanks.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 5, 2023, 6:40am UTC](https://meta.discourse.org/t/discourse-automation/195773/96 "2023-10-05T06:40:41Z")

</div>

I’ve been stuck on that one before 🙂

Replies to this topic should probably get set to auto delete after 30 days. At least this reply should.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 5, 2023, 6:48am UTC](https://meta.discourse.org/t/discourse-automation/195773/97 "2023-10-05T06:48:21Z")

</div>

> [@simon](#):
>
> Replies to this topic should probably get set to auto delete after 30 days. At least this reply should.

We no longer do that for #official plugin topics. Too much good information has been lost to the topic timers. We now curate them manually and split any significant discussions into separate tagged topics (as well as encourage people to start separate topics to begin with). 👍

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 4, 2024, 9:23am UTC](https://meta.discourse.org/t/discourse-automation/195773/107 "2024-04-04T09:23:41Z")

</div>

A post was split to a new topic: [Automation to close Solved topics and post a template response](https://meta.discourse.org/t/automation-to-close-solved-topics-and-post-a-template-response/302370)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 4, 2024, 9:21am UTC](https://meta.discourse.org/t/discourse-automation/195773/108 "2024-04-04T09:21:24Z")

</div>

ℹ **Discourse Automation** has now been bundled with Discourse core, so this plugin will no longer need to be installed separately. 🥳

> :discourse2: Hosted by us? This change will not affect you in any way. 👍 If you are on the Business or Enterprise plans, you can continue to enjoy this plugin and not worry about a thing.

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [April 11, 2024, 11:43am UTC](https://meta.discourse.org/t/discourse-automation/195773/109 "2024-04-11T11:43:14Z")

</div>

Is there an automation script that can change Category? I’d like to use it to make a more flexible “Schedule Publishing” system.

I’m imaging that the script would

- run periodically, and
- check for topics in a given category which have some marker in a reply (like, _marked as solved_ or _reply contains certain text, like “PUBLISH”_).
- If the date of that reply (or “solved” status) is longer ago than a given offset (like, yesterday, or a week),
- delete all replies
- move to given category
- optionally, add configurable tags

A more sophisticated version might look for a date/time in the trigger reply, and publish if it is now after that date/time.

It also might look for the target category in that post (with script config for allowed target categories). And for that matter, tags.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 26, 2024, 7:35am UTC](https://meta.discourse.org/t/discourse-automation/195773/110 "2024-04-26T07:35:38Z")

</div>

This is doable, but nothing like this exists at the moment.

---

<div class="post-metadata">

### Author: ![patrickemin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickemin/32/520162_2.png) [@patrickemin](https://meta.discourse.org/u/patrickemin)
#### Post date: [May 5, 2024, 10:05pm UTC](https://meta.discourse.org/t/discourse-automation/195773/112 "2024-05-05T22:05:52Z")

</div>

> [@joffreyjaffeux](#):
>
> Stalled wiki Triggers when a wiki hasn’t been edited for a while

Hi, I do not understand the use case for this trigger. It seems to be able to send a PM, but to who? Since a Wiki can be edited by several users. Thanks.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [May 13, 2024, 12:39pm UTC](https://meta.discourse.org/t/discourse-automation/195773/113 "2024-05-13T12:39:38Z")

</div>

You decide in the UI who is going to receive the PM.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 20, 2024, 11:09pm UTC](https://meta.discourse.org/t/discourse-automation/195773/114 "2024-07-20T23:09:18Z")

</div>

Is there a way to create a custom script?

This topic the person is looking for a way to have PMs require moderation.

> [@Is it possible to moderate all personal messages sent between users?](https://meta.discourse.org/t/is-it-possible-to-moderate-all-personal-messages-sent-between-users/301029):
>
> Hello, I was wondering if it’s possible to moderate all private messages sent between users on discourse? Thank you!

So I would imagine

- Trigger Create PM
- Automated flagging for review.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 21, 2024, 1:02am UTC](https://meta.discourse.org/t/discourse-automation/195773/115 "2024-07-21T01:02:48Z")

</div>

> [@Heliosurge](#):
>
> Is there a way to create a custom script?

I believe so:

> [@Discourse](#):
>
> ### Custom Automations
> 
> You can also create custom Automations. 🥳 Check out our developer’s guide for more information - [Create custom Automations](https://meta.discourse.org/t/create-custom-automations/275931)

Though it would require some dev skills.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 21, 2024, 1:16am UTC](https://meta.discourse.org/t/discourse-automation/195773/116 "2024-07-21T01:16:55Z")

</div>

That is quite cool. Imagine the Op in topic I linked might consider sponsoring a script depending on how strongly they need that functionality.

Thanks Jammy for the speedy response. As always a wealth of knowledge.

---

<div class="post-metadata">

### Author: ![patrickemin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickemin/32/520162_2.png) [@patrickemin](https://meta.discourse.org/u/patrickemin)
#### Post date: [August 16, 2024, 2:54am UTC](https://meta.discourse.org/t/discourse-automation/195773/117 "2024-08-16T02:54:34Z")

</div>

> [@Discourse](#):
>
> Adds a user to a group based on a Custom User Field

Hi, I don’t get how this one is working, I have a custom user field which can take two values Yes or No (drop down). But when creating the automation I am asked only the name of the custom field, not its value. How do I trigger the automation to add this user to the group if I cannot test the value of the custom field? Thanks.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [August 16, 2024, 4:25am UTC](https://meta.discourse.org/t/discourse-automation/195773/118 "2024-08-16T04:25:00Z")

</div>

The value of the custom field has to match the group name. So if your question is “what do you like more?” And your answers are “dogs” and “cats”, the full names of the groups must be “dogs” and “cats”. You cannot call them “dog lovers” and “cat lovers”

There is a hint in the linked guide

> [@Add users to groups through custom field automation](https://meta.discourse.org/t/add-users-to-groups-through-custom-field-automation/275873/1):
>
> Make sure to add a “Full Name” for each group, as the automation script uses this

but I didn’t understand at first either.

---

<div class="post-metadata">

### Author: ![patrickemin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickemin/32/520162_2.png) [@patrickemin](https://meta.discourse.org/u/patrickemin)
#### Post date: [August 16, 2024, 1:35pm UTC](https://meta.discourse.org/t/discourse-automation/195773/119 "2024-08-16T13:35:04Z")

</div>

Ok I get it now, so my use case is not possible: having a custom field you can answer Yes or No because the group name should be Yes or No… 🙄

---

<div class="post-metadata">

### Author: ![hazenbiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hazenbiz/32/442603_2.png) [@hazenbiz](https://meta.discourse.org/u/hazenbiz)
#### Post date: [August 21, 2024, 11:13pm UTC](https://meta.discourse.org/t/discourse-automation/195773/120 "2024-08-21T23:13:21Z")

</div>

Can I “Auto Tag Posts” based on keywords within the post or post title? Seems like it can only auto tag things based on group or category, which is not super useful for my case.

[Next page](https://meta.discourse.org/t/discourse-automation/195773.md?page=2)
