# What are Custom Workbots?
Custom Workbots are custom Slack apps you create that can leverage the Workato bot platform under the hood. Each custom Workbot has their own unique custom OAuth profile, allowing full customization of your bot's identity, i.e.:
- Branding (bot name, bot logo, background color)
- Permissions
Your bot also unlocks access to additional features like slash commands, shortcuts, and app home.
# When would I need Custom Workbots?
You want multiple, purpose-specific bots in your Slack team. For example, you may want to have HRBot, ITBot, DevOps bots installed within your Slack team.
You want control over your bot's branding, i.e. bot name, bot logo and background color.
You want control over your bot's permissions. The minimum permissions for optimal use are listed in the table below.
Token type Scope Reason User users:read
View information about installing user. Bot app_mention:read
Listen for bot mentions in conversations which the bot is involved in. channels:read
Retrieves list of public conversations. chat:write
Create/update public conversations. files:read
Retrieves list of private conversations. files:write
Create/update private conversations. groups:read
Retrieves list of direct message conversations. im:history
Create/update direct message conversations. im:write
Create/update multi-party group conversations. mpim:read
Retrieves list of multi-party group conversations. users:read
Get user info. users:read.email
Get user info by email.
Migration to granular scopes
Slack released granular permissions (opens new window) on 22 January 2020. You may have to migrate any pre-existing custom bots you have. See the migration guide for more details.
# Authentication
Custom Workbots make use of Slack's V2 OAuth 2.0 flow (opens new window).
# Creating a custom bot
To get started, head to Tools ➤ Workbot like so:
If you don't see Workbot, make sure your Workato team or account has access to Workbot
Under the Custom tab, click on Create a custom bot.
If you don't see the Custom tab, make sure your Workato team or account has access to Custom OAuth profiles
In Step 1, click on Create new app.
This will open a new tab that brings you to https://api.slack.com/apps (opens new window). Keep both the Workato tab and this new tab open - you'll need both to complete Steps 2 and 3.
Sign in to your team (if you haven't already), then click on Create New App.
In the form that pops up, give your bot a name - it typically describes the functionality of the bot e.g. HRBot or SupportBot.
Choose which Slack team this custom bot belongs to, then click on Create App.
Your custom bot should now be created! You should be greeted with your new bot's Basic Information page. If not - don't sweat it. Just click on Basic Information from the left navigation menu.
Scroll down to App Credentials you'll need this information back on your Workato tab. With this info handy, we can now head back to the Workato tab to complete Step 2.
In Step 2, fill up:
- Name: This should be the same name you used to name your custom bot when creating the app e.g. HRBot
- Client ID
- Client secret
- Verification token
It should look like this:
Hit Save once you're done. We can now configure your custom bot to talk to Workato in Step 3.
# Configuring your custom bot to talk to Workato
Now that your custom bot has been created, we'll need to configure it to be able to talk to Workato. Step 3 is done completely on your app page on Slack, so let's head back to the Slack tab (you kept it open, right?).
Don't fret if you didn't - you can always head to Tools ➤ Workbot ➤ Custom, and clicking on your custom bot:
Getting back to configuring your custom bot
# Setting up OAuth & Permissions
You'll want to allow your custom bot to perform certain functions in your Slack team - so you'll need to set some scopes and permissions for it. On your app page on Slack, from the left navigation menu under Features, head over to OAuth & Permissions.
Scroll down to Redirect URLs and click on Add a new Redirect URL. Copy and add this URL:
https://www.workato.com/oauth/callback (opens new window)
If you get an error like the one below, make sure there are no extra spaces at the start/end of the link. Once you're done, remember to hit Save URLs.
Scroll down to Scopes, and select the following Bot Token Scopes:
app:mentions:read
channels:read
chat:write
commands
files:read
files:write
groups:read
im:history
im:write
mpim:read
users:read
users:read.email
Bot token scopes
Next, scroll down to User Token Scopes, and select the following User Token Scopes:
users:read
User token scopes
Reinstall your app when prompted to.
# Adding the custom bot as a user in your Slack team
Slack automatically adds a bot user to your app when any bot token scopes are selected, but you can (and should) also make it so that your bot always appears online. From the left navigation menu, under Features, head over to App home.
- Set the Display name and Default username as the name of your bot e.g. HRBot
- Set Always Show My Bot as Online to
ON
# Subscribing to your custom bot events
You'll want your custom bot to subscribe to events related to the channels and conversations they're a part of, so it can respond to them.
From the left navigation menu, under Features, head over to Event Subscriptions and enable events.
- Copy + paste your custom bot's unique request URL into this field. Jumping back to your open Workato tab, you can find this URL in the Step 3 details, you can find it in the Step 3 details (under the Go to Event Subscriptions and turn
ON
Enable Events section).
It should look something like:
https://www.workato.com/slack_webhooks/event?coak_id=18 (opens new window)
Scroll down to Subscribe to bot events, click on Add Bot User Event and add the following events:
- file_shared
- app_mention
- message.im (opens new window)
Click on Save Changes.
# Enabling interactive components
Enabling this allows your custom bot to respond to message buttons, menus or dialogs - by sending these commands to our specified request URL.
- Copy + paste your custom bot's unique request URL into this field. Jumping back to your open Workato tab, you can find this URL in the Step 3 details (under the Go to the Interactive Components section and click on Enable Interactive Components section).
It should look something like:
https://www.workato.com/slack_webhooks/event?coak_id=18 (opens new window)
Click on Save changes. Your custom bot is now ready to be installed into your Slack team!
# Installing your custom bot to your Slack team
Now that you've finished configuring your custom bot, you can now install it to your Slack team. From the left navigation menu, under Settings, head over to Install App.
- Click on Install App to Workspace
Choose your Slack team and authorize it to complete the installation.
Jumping back to your open Workato tab, under Step 3, click on Done to finish configuring the custom bot. You should now be prompted to connect this custom bot to your slack team:
- Name your connection
- Click Connect
- Choose your Slack team and authorize it to complete the connection.
With that, your custom bot is now ready to be used with Workato recipes! You should be able to see your custom bot in your slack team.
You should also be able to use this custom bot with recipes: