Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: Add welcome, unanswered topic, and AI whisper workflow templates

Régis Hanol904ee05ee386
diff --git a/plugins/discourse-workflows/app/models/discourse_workflows/template_store.rb b/plugins/discourse-workflows/app/models/discourse_workflows/template_store.rb
index cc852b758e6..156b2591d23 100644
--- a/plugins/discourse-workflows/app/models/discourse_workflows/template_store.rb
+++ b/plugins/discourse-workflows/app/models/discourse_workflows/template_store.rb
@@ -15,6 +15,8 @@ module DiscourseWorkflows
end
def self.templates_by_id
+ return load_templates if Rails.env.development?
+
@templates_by_id ||= load_templates
end
private_class_method :templates_by_id
diff --git a/plugins/discourse-workflows/config/templates/bump-topic.json b/plugins/discourse-workflows/config/templates/bump-topic.json
index 6b8f5a0ef90..0725b59b2ac 100644
--- a/plugins/discourse-workflows/config/templates/bump-topic.json
+++ b/plugins/discourse-workflows/config/templates/bump-topic.json
@@ -14,8 +14,8 @@
"credentials": {},
"webhookId": null,
"position": {
- "x": 12,
- "y": 22
+ "x": 0,
+ "y": 0
}
},
{
@@ -32,8 +32,44 @@
"credentials": {},
"webhookId": null,
"position": {
- "x": 292,
- "y": 22
+ "x": 240,
+ "y": 0
+ }
+ },
+ {
+ "id": "note-button",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "Double-click \"Bump button\" to change the label and icon of the button added to the topic admin menu.",
+ "width": 220,
+ "height": 250,
+ "color": "green"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": -20,
+ "y": -110
+ }
+ },
+ {
+ "id": "note-bump",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "\"Bump topic\" moves the topic to the top of the latest list. Double-click it to bump silently, without adding a visible entry to the topic.",
+ "width": 220,
+ "height": 250,
+ "color": "blue"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 220,
+ "y": -110
}
}
],
diff --git a/plugins/discourse-workflows/config/templates/notify-staff-about-topics-with-no-response.json b/plugins/discourse-workflows/config/templates/notify-staff-about-topics-with-no-response.json
new file mode 100644
index 00000000000..2662b9c2789
--- /dev/null
+++ b/plugins/discourse-workflows/config/templates/notify-staff-about-topics-with-no-response.json
@@ -0,0 +1,214 @@
+{
+ "name": "Notify staff about topics with no response",
+ "description": "Waits after a topic is created and pings a chat channel if nobody has replied.",
+ "nodes": [
+ {
+ "id": "topic-created",
+ "type": "trigger:topic_created",
+ "typeVersion": "1.0",
+ "name": "Topic created",
+ "parameters": {},
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 0,
+ "y": 0
+ }
+ },
+ {
+ "id": "wait",
+ "type": "flow:wait",
+ "typeVersion": "1.0",
+ "name": "Wait",
+ "parameters": {
+ "resume": "time_interval",
+ "wait_amount": 2,
+ "wait_unit": "days"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 240,
+ "y": 0
+ }
+ },
+ {
+ "id": "get-topic",
+ "type": "action:topic",
+ "typeVersion": "1.0",
+ "name": "Get topic",
+ "parameters": {
+ "operation": "get",
+ "topic_id": "={{ $(\"Topic created\").item.json.topic.id }}",
+ "actor_username": "system"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 480,
+ "y": 0
+ }
+ },
+ {
+ "id": "if",
+ "type": "condition:if",
+ "typeVersion": "1.0",
+ "name": "No replies",
+ "parameters": {
+ "combinator": "and",
+ "conditions": [
+ {
+ "id": "no-replies",
+ "operator": {
+ "type": "number",
+ "operation": "equals",
+ "singleValue": false
+ },
+ "leftValue": "={{ $json.topic.posts_count }}",
+ "rightValue": "1"
+ }
+ ]
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 720,
+ "y": 0
+ }
+ },
+ {
+ "id": "send-chat-message",
+ "type": "action:send_chat_message",
+ "typeVersion": "1.0",
+ "name": "Send chat message",
+ "parameters": {
+ "target": "channel",
+ "message": "=**{{ $json.topic.title }}** has had no reply for 2 days. Please review and respond: {{ $json.topic.url }}"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 960,
+ "y": 0
+ }
+ },
+ {
+ "id": "note-trigger",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "Double-click \"Topic created\" to limit this to a category, such as your support category. By default, it runs on all topics.",
+ "width": 220,
+ "height": 250,
+ "color": "green"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": -20,
+ "y": -110
+ }
+ },
+ {
+ "id": "note-wait",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "Double-click \"Wait\" to change how long to give the community before staff is pinged. By default, 2 days.",
+ "width": 220,
+ "height": 250,
+ "color": "pink"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 220,
+ "y": -110
+ }
+ },
+ {
+ "id": "note-check",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "\"Get topic\" reloads the topic after the wait and \"No replies\" checks that it still has only its first post.",
+ "width": 460,
+ "height": 250,
+ "color": "blue"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 460,
+ "y": -110
+ }
+ },
+ {
+ "id": "note-chat",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "Double-click \"Send chat message\" to pick the channel to notify (required) and to adjust the message.",
+ "width": 220,
+ "height": 250,
+ "color": "green"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 940,
+ "y": -110
+ }
+ }
+ ],
+ "connections": {
+ "Topic created": {
+ "main": [
+ [
+ {
+ "node": "Wait",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Wait": {
+ "main": [
+ [
+ {
+ "node": "Get topic",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Get topic": {
+ "main": [
+ [
+ {
+ "node": "No replies",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "No replies": {
+ "main": [
+ [
+ {
+ "node": "Send chat message",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ }
+ }
+}
diff --git a/plugins/discourse-workflows/config/templates/welcome-new-members-personal-message.json b/plugins/discourse-workflows/config/templates/welcome-new-members-personal-message.json
new file mode 100644
index 00000000000..efb9875cbd0
--- /dev/null
+++ b/plugins/discourse-workflows/config/templates/welcome-new-members-personal-message.json
@@ -0,0 +1,114 @@
+{
+ "name": "Welcome new members",
+ "description": "Sends a welcome personal message to new members shortly after their first login.",
+ "nodes": [
+ {
+ "id": "user-first-logged-in",
+ "type": "trigger:user_first_logged_in",
+ "typeVersion": "1.0",
+ "name": "User first logged in",
+ "parameters": {},
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 0,
+ "y": 0
+ }
+ },
+ {
+ "id": "wait",
+ "type": "flow:wait",
+ "typeVersion": "1.0",
+ "name": "Wait",
+ "parameters": {
+ "resume": "time_interval",
+ "wait_amount": 10,
+ "wait_unit": "minutes"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 240,
+ "y": 0
+ }
+ },
+ {
+ "id": "send-personal-message",
+ "type": "action:send_personal_message",
+ "typeVersion": "1.0",
+ "name": "Send personal message",
+ "parameters": {
+ "title": "=Welcome to {{ $site_settings.title }}!",
+ "raw": "=Hey @{{ $json.user.username }} — welcome to {{ $site_settings.title }}!\n\nTake some time to explore the community or jump right in and start participating. If you need any help, don't hesitate to ask. Our staff team is happy to assist with anything.\n\nThanks for joining. We're glad you're here!",
+ "sender_username": "system",
+ "recipient_usernames": "={{ $json.user.username }}"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 480,
+ "y": 0
+ }
+ },
+ {
+ "id": "note-wait",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "Double-click \"Wait\" to change how long after the first login the welcome message is sent. By default, 10 minutes.",
+ "width": 220,
+ "height": 250,
+ "color": "orange"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 220,
+ "y": -110
+ }
+ },
+ {
+ "id": "note-message",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "**Highly recommended!** Double-click \"Send personal message\" to customize the text with popular categories, where to get help, etc., and to send it from a real staff member so new users can reply.",
+ "width": 260,
+ "height": 250,
+ "color": "green"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 460,
+ "y": -110
+ }
+ }
+ ],
+ "connections": {
+ "User first logged in": {
+ "main": [
+ [
+ {
+ "node": "Wait",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Wait": {
+ "main": [
+ [
+ {
+ "node": "Send personal message",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ }
+ }
+}
diff --git a/plugins/discourse-workflows/config/templates/whispering-ai-context-and-insights-into-topics.json b/plugins/discourse-workflows/config/templates/whispering-ai-context-and-insights-into-topics.json
new file mode 100644
index 00000000000..b65713e04a4
--- /dev/null
+++ b/plugins/discourse-workflows/config/templates/whispering-ai-context-and-insights-into-topics.json
@@ -0,0 +1,134 @@
+{
+ "name": "Whispering AI context and insights into topics",
+ "description": "Asks an AI agent to research a new topic and posts its findings as a staff-only whisper.",
+ "nodes": [
+ {
+ "id": "topic-created",
+ "type": "trigger:topic_created",
+ "typeVersion": "1.0",
+ "name": "Topic created",
+ "parameters": {},
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 0,
+ "y": 0
+ }
+ },
+ {
+ "id": "ai-agent",
+ "type": "action:ai_agent",
+ "typeVersion": "1.0",
+ "name": "AI agent",
+ "parameters": {
+ "agent_id": -1,
+ "agent_name": "Forum Helper",
+ "prompt": "=You help the community team triage new topics. Your reply is posted as a whisper that only staff can see.\n\nTopic: {{ $json.topic.title }} ({{ $json.topic.url }})\nAuthor: **{{ $json.post.username }}**\n\n{{ $json.post.raw }}\n\n## What to do\n\n1. Identify the core question or issue and how urgent it is.\n2. Search the community for topics that already answer it, and for official documentation. Use exact error messages, feature names, or technical terms. Search again with other terms if the first results are not relevant.\n3. Collect only the most relevant findings.\n\n## Response format\n\n### Summary\n- **Core issue**: one or two sentences\n- **Priority**: Critical / High / Medium / Low\n\n### Related topics and docs\n- [Title](URL) - why it is relevant\n(Include only the most relevant results. Do not include this topic itself.)\n\n### Suggested reply\nA draft reply that a staff member could send as is, based on what you found.\n\n### Notes for staff\nAdditional context that helps staff but should not be sent to the member, such as missing information to ask for or signs of a wider problem.\n\n## Guidelines\n\n- Be concise; staff need quick, actionable information.\n- Link directly to the topics and docs you used.\n- Do not @mention anyone; use bold for usernames instead.\n- Do not include personal information."
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 240,
+ "y": 0
+ }
+ },
+ {
+ "id": "post",
+ "type": "action:post",
+ "typeVersion": "1.0",
+ "name": "Whisper",
+ "parameters": {
+ "operation": "create",
+ "topic_id": "={{ $(\"Topic created\").item.json.topic.id }}",
+ "raw": "={{ $json.result }}",
+ "whisper": true,
+ "author_username": "system",
+ "bypass_permission_checks": true
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 480,
+ "y": 0
+ }
+ },
+ {
+ "id": "note-trigger",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "Double-click \"Topic created\" to choose which categories or tags this runs on. Defaults to all topics; we recommend starting with your support category.",
+ "width": 220,
+ "height": 250,
+ "color": "green"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": -20,
+ "y": -110
+ }
+ },
+ {
+ "id": "note-agent",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "Double-click the agent node to pick another agent or to add links to your documentation and instructions on how to research questions.",
+ "width": 220,
+ "height": 250,
+ "color": "pink"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 220,
+ "y": -110
+ }
+ },
+ {
+ "id": "note-whisper",
+ "type": "flow:sticky_note",
+ "typeVersion": "1.0",
+ "name": "Sticky Note",
+ "parameters": {
+ "content": "The `whispers allowed groups` site setting must include at least one group, such as staff, for whispers to be posted.",
+ "width": 220,
+ "height": 250,
+ "color": "yellow"
+ },
+ "credentials": {},
+ "webhookId": null,
+ "position": {
+ "x": 460,
+ "y": -110
+ }
+ }
+ ],
+ "connections": {
+ "Topic created": {
+ "main": [
+ [
+ {
+ "node": "AI agent",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "AI agent": {
+ "main": [
+ [
+ {
+ "node": "Whisper",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ }
+ }
+}