Reference · Tools

Discourse

Interact with a self-hosted or cloud Discourse forum: manage categories, groups, posts, users, and group membership.

Action Communication v1

The Discourse node connects BusyBot to your self-hosted or cloud Discourse forum, letting you create posts, manage categories and groups, provision users, and add or remove group members programmatically. Use it to build workflows like auto-posting a new topic whenever a deal closes in your CRM, or syncing a user list from an external system into a Discourse group. Every Get Many operation fans out results as individual items, so you can filter or loop over them without extra nodes.

Node type
Action
Parameters
45
Outputs
Output, Error
Credentials
Discourse API

Discourse

Manage Discourse forum categories, groups, posts, users, and group membership.

Overview

Discourse is an open-source discussion platform. This tool provides CRUD operations for categories (create, get many, update), groups (create, get, get many, update), posts (create, get, get many, update), users (create, get, get many), and user-group membership (add, remove). It works against your own Discourse instance URL.

Category: Communication
Tool Name: discourse
Version: 1

Appearance: Icon: si-discourse | Color: #231F20

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Discourse API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Categorycategory
Groupgroup
Postpost
Useruser
User GroupuserGroup

Operations

ResourceOperationValueDescription
CategoryCreatecreateCreate a forum category
CategoryGet ManygetAllList the forum’s categories
CategoryUpdateupdateRename or restyle an existing category
GroupCreatecreateCreate a group
GroupGetgetGet one group by name
GroupGet ManygetAllList the forum’s groups
GroupUpdateupdateRename an existing group
PostCreatecreateCreate a new topic, or reply to an existing one
PostGetgetGet one post by ID
PostGet ManygetAllList the forum’s latest posts
PostUpdateupdateEdit an existing post
UserCreatecreateCreate a user account
UserGetgetGet one user by username or SSO external ID
UserGet ManygetAllList users filtered by status flag
User GroupAddaddAdd users to a group
User GroupRemoveremoveRemove users from a group

Parameters

Category: Create

ParameterTypeRequiredDefaultDescription
NamestringYesName of the category. Supports expressions.
ColorstringYes0000FFHex color code for the category (e.g., 0000FF).
Text ColorstringYes0000FFText hex color code for the category.

Category: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)

Category: Update

ParameterTypeRequiredDefaultDescription
Category IDstringYesID of the category to update. Supports expressions.
NamestringYesNew name of the category.
Update FieldscollectionNo{}Additional fields to update on the category.
— ColorstringNo0000FFNew hex color code for the category.
— Text ColorstringNo0000FFNew text hex color code for the category.

Group: Create

ParameterTypeRequiredDefaultDescription
NamestringYesName of the group. Supports expressions.

Group: Get

ParameterTypeRequiredDefaultDescription
NamestringYesName of the group. Supports expressions.

Group: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)

Group: Update

ParameterTypeRequiredDefaultDescription
Group IDstringYesID of the group to update. Supports expressions.
NamestringYesNew name of the group.

Post: Create

ParameterTypeRequiredDefaultDescription
TitlestringNoTitle of the post. When provided, creates a new topic. Supports expressions.
ContentstringYesContent of the post (Markdown supported). Supports expressions.
Additional FieldscollectionNo{}Additional fields for post creation.
— CategorystringNoCategory ID to assign the post/topic to. Find the category ID in your Discourse admin panel under Categories.
— Reply To Post NumberstringNoThe post number to reply to within a topic.
— Topic IDstringNoID of the topic to add a reply to. When set, title is ignored.

Post: Get

ParameterTypeRequiredDefaultDescription
Post IDstringYesID of the post to retrieve. Supports expressions.

Post: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)

Post: Update

ParameterTypeRequiredDefaultDescription
Post IDstringYesID of the post to update. Supports expressions.
ContentstringYesNew content of the post (HTML supported). Supports expressions.
Update FieldscollectionNo{}Additional fields for post update.
— Edit ReasonstringNoReason for editing the post.
— CookedbooleanNofalseWhether the content is pre-cooked HTML.

User: Create

ParameterTypeRequiredDefaultDescription
NamestringYesDisplay name of the user. Supports expressions.
EmailstringYesEmail address of the user. Supports expressions.
UsernamestringYesUsername for the new user. Supports expressions.
PasswordstringYesPassword for the new user.
Additional FieldscollectionNo{}Additional user creation fields.
— ActivebooleanNofalseWhether to set the user as active immediately.
— ApprovedbooleanNofalseWhether to set the user as approved immediately.

User: Get

ParameterTypeRequiredDefaultDescription
ByoptionsYesusernameHow to look up the user.
Options: username, externalId (SSO External ID)
UsernamestringYesUsername of the user to retrieve. (shown when By is username)
SSO External IDstringYesDiscourse SSO external ID. (shown when By is externalId)

User: Get Many

ParameterTypeRequiredDefaultDescription
FlagoptionsNoactiveUser status flag to filter by. Requires admin API key.
Options: active, blocked, new, staff, suspect, suspended
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)
OptionscollectionNo{}Additional options for listing users.
— AscendingbooleanNotrueWhether to sort ascending.
— OrderoptionsNocreatedField to order results by.
Options: created, days_visited, email, last_emailed, posts, posts_read, read_time, seen, topics_viewed, trust_level, username
— Show EmailsbooleanNofalseWhether to include user email addresses.
— StatsbooleanNofalseWhether to return user statistics.

User Group: Add

ParameterTypeRequiredDefaultDescription
UsernamesstringYesUsernames to add to the group. Multiple usernames can be separated by commas. Supports expressions.
Group IDstringYesID of the group. Supports expressions.

User Group: Remove

ParameterTypeRequiredDefaultDescription
UsernamesstringYesUsernames to remove from the group. Multiple usernames can be separated by commas. Supports expressions.
Group IDstringYesID of the group. Supports expressions.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

The Discourse record is merged into the item JSON — the incoming fields pass through and binary data is forwarded. Single-record operations produce one output item per input item; every Get Many operation fans out to one output item per record.

Resource / OperationOutput
Category / createThe created category — id, name, slug, color, text_color and the rest of the category record
Category / getAllOne item per category
Category / updateThe updated category record
Group / createThe created group record
Group / getThe group record for that name
Group / getAllOne item per group
Group / updateThe Discourse response for the rename
Post / createThe created post — id, topic_id, post_number, username, cooked and the rest of the post record
Post / getThe post record for that ID
Post / getAllOne item per post, newest first
Post / updateThe updated post record
User / createThe Discourse response for the account creation, including user_id and the account’s activation state
User / getThe user record
User / getAllOne item per user matching the Flag, with email addresses and statistics only when those options are on
User Group / addThe Discourse response for the membership change
User Group / removeThe Discourse response for the membership change

Reference a field downstream by expression, e.g. {{ $json.topic_id }}.

Usage Examples

  • Create a new forum category
  • Get all posts from Discourse
  • Add a user to a Discourse group
  • Create a new topic in Discourse
  • List all users with active status

Example Configuration

Create a category:

{
  "type": "discourse",
  "parameters": {
    "resource": "category",
    "operation": "create",
    "name": "General Discussion",
    "color": "0088CC",
    "textColor": "FFFFFF"
  }
}

Rename and restyle a category:

{
  "type": "discourse",
  "parameters": {
    "resource": "category",
    "operation": "update",
    "categoryId": "5",
    "name": "Updated Category Name",
    "updateFields": {
      "color": "FF0000",
      "textColor": "000000"
    }
  }
}

List the first 20 categories:

{
  "type": "discourse",
  "parameters": {
    "resource": "category",
    "operation": "getAll",
    "returnAll": false,
    "limit": 20
  }
}

Create a group:

{
  "type": "discourse",
  "parameters": {
    "resource": "group",
    "operation": "create",
    "name": "moderators"
  }
}

Start a new topic in a category:

{
  "type": "discourse",
  "parameters": {
    "resource": "post",
    "operation": "create",
    "title": "Welcome to Our Forum",
    "content": "This is the **welcome post** with *markdown* formatting.",
    "additionalFields": {
      "category": "1"
    }
  }
}

Reply to an existing topic:

{
  "type": "discourse",
  "parameters": {
    "resource": "post",
    "operation": "create",
    "content": "{{ $json.replyText }}",
    "additionalFields": {
      "topic_id": "123",
      "reply_to_post_number": "1"
    }
  }
}

Edit a post and record why:

{
  "type": "discourse",
  "parameters": {
    "resource": "post",
    "operation": "update",
    "postId": "456",
    "content": "<p>Updated post content with HTML</p>",
    "updateFields": {
      "edit_reason": "Fixed formatting",
      "cooked": true
    }
  }
}

Create an already-active user:

{
  "type": "discourse",
  "parameters": {
    "resource": "user",
    "operation": "create",
    "name": "John Doe",
    "email": "john@example.com",
    "username": "johndoe",
    "password": "securepassword123",
    "additionalFields": {
      "active": true,
      "approved": true
    }
  }
}

Look a user up by username:

{
  "type": "discourse",
  "parameters": {
    "resource": "user",
    "operation": "get",
    "by": "username",
    "username": "johndoe"
  }
}

Look a user up by SSO external ID:

{
  "type": "discourse",
  "parameters": {
    "resource": "user",
    "operation": "get",
    "by": "externalId",
    "externalId": "external123"
  }
}

List active users with their statistics:

{
  "type": "discourse",
  "parameters": {
    "resource": "user",
    "operation": "getAll",
    "flag": "active",
    "returnAll": false,
    "limit": 50,
    "options": {
      "asc": true,
      "order": "created",
      "showEmails": false,
      "stats": true
    }
  }
}

Add several users to a group at once:

{
  "type": "discourse",
  "parameters": {
    "resource": "userGroup",
    "operation": "add",
    "usernames": "johndoe,janedoe,admin",
    "groupId": "5"
  }
}

Remove users from a group:

{
  "type": "discourse",
  "parameters": {
    "resource": "userGroup",
    "operation": "remove",
    "usernames": "johndoe,janedoe",
    "groupId": "5"
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Manage Discourse forum categories, groups, posts, users, and group membership via the Discourse REST API.

Notes

  • Title decides topic or reply. Post: Create starts a new topic when you set a Title, and adds a reply when you set Topic ID instead. Setting Topic ID wins — the Title is ignored.
  • Post: Create takes Markdown; Post: Update takes HTML. Turn on the Cooked update field when you are supplying rendered HTML rather than letting Discourse render it.
  • Group: Get looks up by name, Group: Update by ID. Fetch the group first if you only have its name and need the ID.
  • User Group takes several usernames at once — one comma-separated string per call, so a whole batch of members can be added or removed in a single item.
  • Admin-only operations. Creating users, listing users by flag, and creating groups go through Discourse’s admin endpoints, so the API key must belong to an admin account.
  • Colors are bare hex, without the leading #0088CC, not #0088CC.
  • Get Many fans out. Each category, group, post or user arrives as its own item, ready to filter or loop over without a Split Out node.

Frequently asked questions

How do I create a new topic versus adding a reply to an existing thread?

When using Post: Create, set a Title to start a new topic. Set a Topic ID instead to post a reply to that thread. If you provide both, Topic ID wins and the Title is ignored entirely, so double-check which field you're populating when building your workflow.

Post: Create expects Markdown, but I have rendered HTML — does that work?

Post: Create is designed for Markdown and will let Discourse render it server-side. Post: Update is where HTML fits: enable the Cooked field when supplying pre-rendered HTML. Mixing the two — for example, sending HTML to Post: Create — will result in the markup appearing as literal text in your post.

Which Discourse account does the API key need to belong to?

Several operations — creating users, listing users by flag, and creating groups — hit Discourse's admin-only endpoints. The API key configured in your Discourse API credentials must belong to an admin account for these to succeed. A non-admin key will work for read operations and posting, but will receive permission errors on those admin routes.

I only know a group's name but Group: Update requires an ID. How do I get it?

Use Group: Get first, which looks up a group by name and returns its full record including the numeric ID. Pass that ID into the subsequent Group: Update step. The two operations are intentionally separate, so a quick two-step sequence is the expected pattern here.

How do I format colors when creating or updating a category or group?

Color fields expect a bare hex string without a leading hash symbol — for example, 0088CC rather than #0088CC. Including the # character will likely cause the API call to fail or store an invalid value, so strip it before passing the color into the node.

Build with the Discourse node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Discourse API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.