Include 'Reason' in Grant Badge Discourse Action in Workflows

סיכום מבוסס בינה מלאכותית

gassim opened a feature request asking to add a ‘Reason’ field to the “Grant Badge” action within Discourse Workflows. Currently, while the API supports granting badges with a topic link or reason, the native workflow action does not, forcing users to rely on complex API requests to document why a badge was awarded. This limitation makes it difficult to maintain workflows that require linking badges to specific posts or topics.

Frully supported the request, noting a similar use case where they wish to automatically grant a “thank you” badge when an AI detects a specific type of post. They highlighted that the workflow node lacks the Reason attribute needed to link back to the post.id, making a native solution preferable to the suggested HTTP API workaround.

The request was quickly addressed by awesomerobot, who confirmed the feature was reasonable and submitted a pull request (discourse/discourse#46541) to implement it. gassim and Frully expressed their gratitude, with Frully particularly impressed by the substantial engineering effort (approximately 700 lines of code) required to integrate this small but valuable input box into the existing architecture.

Hi

I know that it’s possible to create an API request that grants badges and includes the ‘topic reason’; however, given that ‘Grant Badge’ action in workflows is already available, would it be possible to add the option to include the ‘reason’?

When granting badges, it’s possible to mention the reason. (See admin settings of a profile, click badges, and you will be able to select badge then add link to topic/post:

However, in the Discourse actions in workflows, it’s not possible to include the ‘reason’:

Adding this option will be very helpful and much easier to maintain than creating the API request.

Thanks!

2 לייקים

Me Too!

Was just about to post this same thing. Using AI to detect a particular type of post, we want to tag the post, and grant a badge thanking the person for making the report. The workflow node doesn’t have the Reason attribute in order to link back to the post.id.

It’s a minor thing, but should be trivial to add. Gemini suggested an http api call as a workaround since that api can handle the reason attribute. Would be much more graceful as a node.

2 לייקים

Seems reasonable! I’ve added the feature here:

3 לייקים

@Frully thank you for supporting this feature and sharing why it’s needed on your side as well. I’m glad it’s a shared interest for other community managers. :slight_smile:

@awesomerobot Thank you so much!

2 לייקים

You’re welcome, and likewise thanks @awesomerobot . When I saw ‘Seems reasonable’ I got excited. When I saw it was ~700 lines of changes to implement one input box (a lot of stuff had to be re-architected it seems), I’m even more thankful.

2 לייקים