Archived May, 2026.

Discourse Automation

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

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.

Available scripts

Guide Script Trigger(s) Description
:bookmark: Add user to group through custom field :black_small_square:Recurring
:black_small_square:First logged on
Adds a user to a group based on a Custom User Field
:bookmark: Append last checked by :black_small_square:After post cook Adds a ‘last checked by’ function to the bottom of the OP
:bookmark: Append last edited by :black_small_square:After post cook Adds a ‘last edited by’ note to the bottom of the OP
:bookmark: Auto Responder :black_small_square:Post edited/created
:black_small_square:PM created
Given a series of keywords and associated replies, automatically respond with the corresponding reply
Auto Tag topic :black_small_square:Post created/edited
:black_small_square:PM created
Automatically tag a topic
Close topic :black_small_square:Point in time
:black_small_square:Stalled wiki
Automatically close a topic
Create Post :black_small_square:Recurring
:black_small_square:Point in time
Creates a post
Flag post on Words :black_small_square:Post edited/created Flag a topic on creation/edition if it contains specific words
Gift Exchange :black_small_square:Point in time Simple implementation of the Secret Santa game
Group Category Notification Default :black_small_square:Category created/edited Automatically sets a group notification level for newly created subcategories
Make banner topic :black_small_square:Point in time Convert a topic into a banner notice
Pin Topic :black_small_square:Point in time Pin and Unpin a topic in the future
Random Assign
(Assign)
:black_small_square:Point in time
:black_small_square:Recurring
Randomly Assign a topic
Schedule a PM with data explorer results
(Data Explorer)
:black_small_square:Recurring Send a regular PM with the results of a data explorer query
Send Chat message
(Chat)
:black_small_square:Event started
:black_small_square:Recurring
Sends a Chat message to a Channel
Send PMs :black_small_square:First accepted solution (Solved)
:black_small_square:User badge granted
:black_small_square:User added to group
:black_small_square:Stalled wiki
:black_small_square:Recurring
:black_small_square:User promoted
:black_small_square:API call
:black_small_square:User removed from group
Send PMs with support for placeholders
Suspend User By Email :black_small_square:API call Suspend a user for a specified duration
Topic required words :black_small_square:Topic Enforce the presence of at least one of the specified words in the posts of a topic
:bookmark: Triage posts using AI (Discourse AI) :black_small_square:Post created/edited Enhance the management and moderation of forum posts by automating the process of classifying posts
User Global Notice :black_small_square:Stalled topic
:black_small_square:First accepted solution (Solved)
Displays a global notice on the site for a specific user
:bookmark: User Group Membership through Badge :black_small_square:Recurring
:black_small_square:User first logged in
Automatically add users to a group based on their earned badges
Zapier webhook :black_small_square:User promoted
:black_small_square:User added to group
:black_small_square:User badge granted
:black_small_square: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. :slight_smile:

More scripts and triggers to come!

Custom Automations

You can also create custom Automations. :partying_face: Check out our developer’s guide for more information - Create custom Automations


:discourse2: Hosted by us? This plugin is available on our Business and Enterprise plans. Automation | Discourse - Civilized Discussion

JammyDodger

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

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


There are a couple more walkthroughs added for 'Append last edited by' Automation and 'Append last checked by' Automation. :tada:

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

Jagster

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.

simon

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

It might require refreshing the page to see it.

Jagster

Aaand now I feel myself really stupid :man_facepalming:

Thanks.

simon

I’ve been stuck on that one before :slight_smile:

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

JammyDodger

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). :+1:

JammyDodger

A post was split to a new topic: Automation to close Solved topics and post a template response

JammyDodger

:information_source: Discourse Automation has now been bundled with Discourse core, so this plugin will no longer need to be installed separately. :partying_face:

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

mattdm

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.

sam

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

patrickemin

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.

j.jaffeux

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

Heliosurge

Is there a way to create a custom script?

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

So I would imagine

  • Trigger Create PM
  • Automated flagging for review.
JammyDodger

I believe so:

Though it would require some dev skills.

Heliosurge

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.

patrickemin

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.

Moin

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

but I didn’t understand at first either.

patrickemin

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… :roll_eyes:

hazenbiz

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.

merefield

@hazenbiz my plugin can do that for you automagically:

JammyDodger

The ‘Triage posts using AI’ automation can do that for an advanced option, though using the Tag option in watched words may also be of some use to you for a simple ‘keyword in OP = add tag’

InvisibleCat

Does the Add user to group through Custom User Field automation handle custom user field of type Confirmation? I have the user field and category names matching, however accepting the field does not assign the group.

Additionally, does that scrip also handle removing the user from the group when the selection changes? I’d like to make sure the category is only accessible to people who agree to a policy, etc. so if they change their option at a later date, they get booted from the group, is this possible?

patrickemin

Hi, I see there is a Stalled topic trigger but I see no script using it, am I right? Thanks

JammyDodger

I think that one is in the user global notice script.

patrickemin

You are right, thanks

ToddZ

Aw nuts. I hoped to assign people to a group based on a preference—with a yes/no answer—not by picking a group name.

patrickemin

Yes I would love this improvement too.

j.jaffeux

Can you expand on what you would want here exactly please?

patrickemin

Yes, as the scripts stand at the moment, it doesn’t seem possible to me to include members in a group according to the value of a user field, if this group name is not equal to one of the values of this user field, which poses a problem in a very simple case, if you have a user field which is a question by which the user answers yes or no, the corresponding group would therefore have to be named yes or no. If I understand correctly, this is not satisfactory. We should be able to choose the group with a simple condition, for example, if answer yes, then this group, if answer no, then that group.

ToddZ

My initial use case would map to a question with a yes/no answer.

I could also imagine multiple-choice scenarios, where you’d want to label each option descriptively.

Frully

This seems feasible…

Do you consent to the foo_agreement?
answers: foo_consent, foo_no_consent
It doesn’t roll off the tongue quite as nicely as yes and no, but it gives a descriptive group name useful down the road.
Doesn’t make for a smooth @tagging experience later when you want to address the group.

gschmid

Sorry to ask this, but where exactly do I find the settings for this?
I’m using currently v3.2.2 - I assume this already has Discourse Automation included?

ondrej

Correct, its is included in core. To be able to use the plugin you first have to enable it from /admin/plugins. Ensure the plugin state is ‘Enabled’ like so

Writing with a mouse is difficult :rofl:

nathank

That functionality exists in the Custom Wizard Plugin 🧙 already. It does need to be triggered by some user interaction, but that would seem fine for your use-case.

gschmid

Thanks, but I don’t find it there. Maybe it was added after v3.2.2? How do I find out? The release notes do not mention it (or I missed it).

ToddZ

Thanks for the tip! It seems like the native functionality is almost there, and I prefer not to load up on plugins if I can help it, but the Custom Wizard Plugin looks like a good option if I have to press on.

sam

A post was split to a new topic: Triggering a AI generated reply when people post

Eloïse_Barrège

Does the “Recurring” still work? It does not for me.
I’ve setup “Every 1 minute” and it does not work.

j.jaffeux

I just tried it and I can confirm it works. Both the recurring trigger and the the group membership through badge script.

Are you sure this group can be joined?

Eloïse_Barrège

This group can’t be joined freely but as I’m admin, I can add anybody to this group.
The automation work only when I click manually on the button “Trigger now” (whereas it’s supposed to be automatic every 1 minute)

j.jaffeux

From the settings I can see on your screen I tried the exact same thing and it was called every minute as expected. Do you have anything in /logs ? Where does Discourse store and show logs?

Eloïse_Barrège

Nothing happens since 12:14 (it’s 12:30) whereas I just made 2 badges’ attributions, nothing happened. Nobody went to the dedicated group…

j.jaffeux

Can you give me the ID of your automation please? when you edit the automation it should be in the URL.

Eloïse_Barrège

Here are the 3 automations that does not work anymore

https://playground.lagrowthmachine.com/admin/plugins/discourse-automation/8

https://playground.lagrowthmachine.com/admin/plugins/discourse-automation/7

https://playground.lagrowthmachine.com/admin/plugins/discourse-automation/6

j.jaffeux

I suspect you have another automation which is preventing other automations to run. Sadly I can’t debug further without having access to the instance.

Eloïse_Barrège

The other automations are PM sent or adding to a group through custom field.

Would you like to be added as an admin for a while to try to debug it ?

Shauny

I would like to automatically create a topic every day, but the title and content of the topic should contain things that change, such as the current date.

I can only see a merge tag for creator_username at the moment, are there any other tags available?

Without this, it just would create the exact same topic and title every day which is less than useful.

joo

I’m using both the Discourse Automations Plugin and the Discourse AI Plugin, and I was wondering if it’s possible to have AI automatically reply to a new topic as soon as it’s created. I don’t want to rely on the @ mention trigger—just an automatic reply when the topic is posted.

Do you think this is something that can be set up? If not, is it something that could be added in a future update?

Thanks a lot! Looking forward to hearing from you.

Florian_Müller


Sorry but I can’t select a group, the option is missing
I want a user to select something in the profile field and then be added to a suitable group depending on what he has selected

Lilly
Moin

There is no option to set a group name. You create a dropdown field and the option the user chooses is the same as the group name.

Discourse Automation - #118 by Moin

patrickemin

Hi, this has been discussed here and is impossible at the moment:

Eloïse_Barrège

Hey Joffrey! Can you help me with that automations which did not work anymore?

Paul_King

I too have noticed that automation seems to have stopped working, which presumably is associated with a recent update. (currently on 3.5.0.beta3-dev)

In my case the ‘Add user to group through custom field’ no longer seems to be doing anything - the user selects the preferred group name via custom field during sign up, but when approved, those custom fields under the user ‘Groups’ heading remain unpopulated.

sam

Can you try deleting it and configuring it from scratch? If you do so does it start working?

Paul_King

Just deleted and recreated. With new instance ticked active, and automation set to run every minute. Also tried ‘Trigger now’

Unfortunately the custom category remains unpopulated for a new approved signup, even after several minutes, & clearing browser cache.

Paul_King

Hi @sam any progress on this?

nathank

This sounds more like a signup field / approval bug rather than a problem with the automation plugin.

I recall this getting bugged a few years ago, where signup fields didn’t actually make it into the profile when approval is required.

May I suggest turning off approvals and trying it then?

Paul_King

Thanks @nathank.

What setting am I looking for when you suggest ‘turning off approvals’?

Things seemed to have been working fine with the new user signup process until 3 months ago, looking at the users list, sorted by newness, from which time group memberships stopped being attributed for new signups (it took that long for someone to complain & prompt me to investigate why they were not getting access to the private forum when that was what they had selected on signing up!)

When I click on newly approved user profiles, their custom user field group-name selections are displaying as expected, so that much is working - but the corresponding groups going by those names are no longer being applied to the user.

As far as I know, other than general forum software updates, I haven’t changed anything since setting up the public vs private group system for my forum late last year - so I assume that a subsequent update, perhaps around 3 months ago, is implicated in the issue.

nathank

Cool - the data is indeed being recorded! And you are clearly right, for some reason the automation is no longer functioning / triggering for you. No need to turn off approvals.

I was about to implement something similar using this plugin - will let you know if I can repro the problem.

Also - perhaps these last 8 replies should be moved to Bug?

tobiaseigen

We had moved them to a new bug topic but I moved it back here.

Seems there are two problems currently intermingling - @EloiseBarrege has been having a problem with automations that create badges, starting :backhand_index_pointing_up: with this post back in October. It seems to be a configuration issue specific to the site. Eloise, if you are not able to fix it I recommend you start a new topic in Marketplace to find someone to help you fix it.

@Paul_King seems to be struggling with a different issue, that an automation that previously worked stopped working after an update. If it persists and @nathank is able to repro, can one of you two start a new Bug topic to explore that further?

nathank

Here 'tis:

tobiaseigen

4 posts were split to a new topic: Help troubleshooting problem with automation and tagging

NateDhaliwal

The automation seems to be sent by the @system user. Is there a way to change that?

ozkn

Hello, is there any time limitation for ai persona triggering? For example, it is triggered every 10 seconds, etc. If so, how can I edit this value.

tobiaseigen

5 posts were split to a new topic: How to create autoresponder using automation

Paul_King

Is there any progress on this?

The ‘Add user to group through User Custom Feild’ script is still not working.

j.jaffeux

Can you show me a screenshot of your automation setup please?

Paul_King

Thanks @j.jaffeux

Below are what I hope are the relevant screenshots

  • There are two groups I am dividing my users into: ‘Private Forum User’ or ‘Public Forum User’.
  • A user must select one of these by name when signing up, from a dropdown custom user variable called ‘Forum Access Level’.
  • When they complete their signup correctly and are approved, the Automation plugin then fails to put them into either of those groups, no matter what group they chose.

The result for all new approved user profiles is as below (the group setting remains unpopulated, until I manually set it to one or both of the groups myself)

patrickemin

Hi, could you explain to me what is “Append last checked by” ? Checked, in what sense ? Thanks.

update, found it Setting up the 'Append last checked by' automation

But cannot get how to use no category as it is optional but the category cannot be removed ?

SergJohn

Is it possible to create and register our own trigger for our custom automation? Is there any document steps/samples for it? I’m trying to create a “accepted_solutions“ trigger, the “first_accepted_solutions“ is not fit to my use case since I’m would like the automation to be triggered for every single post marked as solution.

putty

You may need to enlist an external service, like n8n, but you can via webhooks/api’s.

SergJohn

Thanks @putty for your reply.
I had a look into it, but I am trying to achieve it using a custom plugin.

ToddZ

3 posts were split to a new topic: Discourse Automation - poor French translations

asc

How are params supposed to be entered for automated Data Explorer queries? The relationship between the data explorer param and the key/value pair in the edit query params popup isn’t clear to me.

adamselby

I was running into this as well, and the solution was to disable “Automatically set as primary group” on the groups that are part of the dropdown. If you don’t need to set a group as their primary group, this may be a fine workaround. For myself… it’s not. We’d like to use a dropdown to select a primary group. The error I’m seeing in sidekiq seems to be related to how the users are parsed, with missing attribute ‘staged’ for User showing.

Iury_Batista_Araujo

I am using the automatic reply feature to respond to new users posting for the first time.

I would like to know if it is possible to mention the user in the automatic reply.