Create Role

discord.create_role
ActionChat & messagingconnection required

Calls the Discord API with the connection's credentials.

Create a role in a server.

Connection

Required
Yes — the node will not save without one
Auth type
API key
Providers
Discord
Secret shape
the bot token (sent as "Authorization: Bot <token>") for every op except discord.execute_webhook, whose secret is the webhook URL
Resolved by
config.connection_id, else node.connection_id

Configuration

7 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
guild_id
Id of the Discord server (right-click the server → Copy Server ID).
stringYes———
name
Role name, up to 100 characters; Discord names it 'new role' if blank.
stringNo—≤ 100 characters—
permissions
Permission bitfield as a decimal string, such as '2048' for SEND_MESSAGES.
stringNo———
color
Role colour as a decimal RGB integer, 0-16777215; 0 leaves it uncoloured.
numberNo—0–16777215—
hoist
Show members with this role separately in the member list.
booleanNo———
mentionable
Let anyone @mention this role.
booleanNo———
reason
Why the change was made; recorded in the server's audit log.
stringNo—≤ 512 characters—

Output

One shape.

result

FieldTypeExample
id
Id of the role.
string—
name
Role name.
string—
color
Role colour as a decimal RGB integer.
number—
position
Position in the role hierarchy.
number—
permissions
Permission bitfield, as a decimal string.
string—
hoist
True when the role is shown separately in the member list.
boolean—
mentionable
True when anyone may @mention the role.
boolean—
{
  "color": 0,
  "hoist": false,
  "id": "",
  "mentionable": false,
  "name": "",
  "permissions": "",
  "position": 0
}

Notes

  • Needs a Discord connection whose secret is the bot token.
  • Needs MANAGE_ROLES; a new role is created at the bottom of the hierarchy.

See Create Role run in a workflow.

In a technical demo we add the Discord connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.