Can you use variables in automated new topic titles?

Hey everyone! I just have a quick inquiry as to the functionality of the premade automation scripts. I’m running an educational platform and I want to make an automatic word of the day topic each day (to which a bot replies and writes out a post), but I don’t want to enable having topics with the same title.

So my question is: Is there any way to input a variable such as shown in the topic title in the screenshot so that the topic title is different each time the automation runs? Or would this require a custom automation script?

4 Likes

Came here to ask the same question. Since the topics can be created on recurring basis, it would be great to add a {{date}} variable to distinguish one from another.

4 Likes

Did anyone ever figure if this was possible?

I was never able to actually figure this out. It seems like there does exist some subset of variables which can be interpolated, but I don’t know what that subset is nor if it’s possible to somehow create new ones

I think it might be possible to add more placeholders:

1 Like

Mark me down as another person who was just looking at this and trying to figure out how to add dates into the body text. I’d ideally like to be able to specify a date with formatting options, too, so that I can get, for example, February 2026, not just 02/01/2026. Some kind of moment.js formatting or UNIX date string maybe?

Thanks for the information provided.

Adding to the thread because I ran into exactly this when setting up a weekly “design feedback” topic for a client community.

What worked for us: we ended up using a webhook trigger from an external n8n workflow rather than the built-in automation scheduler. The n8n side handles the date interpolation (you have full control over date formatting there), and then it calls the Discourse API to create the topic with the pre-formatted title. A bit more infrastructure, but it means you are not fighting against the automation placeholder system.

That said, if you want to stay inside Discourse automation entirely: the placeholder system @NateDhaliwal flagged in the source is the right place to look. The placeholder declarations in the topic script are what get exposed to the title and post fields. The challenge is that {{date}} is not a built-in placeholder — those are user-context ones like creator_username. Adding a date placeholder would require either a plugin or a PR to discourse-automation.

For @Eingang wanting formatted dates specifically: the external workflow route gives you full moment.js-style control. We format ours as MMMM YYYY before sending to the API and it comes through exactly as written in the topic title. Not the most elegant solution but it is reliable and has been running without issues for about four months now.

1 Like