powered by

Connect Slack to send workflow messages

Register a Slack app and connect it to your project so workflow steps can post to channels and message people directly as your Slack bot.

Last updated

Connect a Slack workspace so a workflow's Integration step can run Send Message (post to a channel) or Send Direct Message (message one person). Messages post as your Slack app's bot.

If you followed Post to Slack when a record is created, Slack is already connected. Skip to the variations at the end of this page. For how connections and credential sources work, see How integrations work.

Step 1: Register the Slack app

At api.slack.com/apps, create an app From scratch and add these bot token scopes under OAuth & Permissions. Anythink requests all of them when you connect:

Scope Used for
chat:write, chat:write.public Posting messages, including to public channels the bot hasn't joined
channels:read, groups:read Listing channels for the Channel picker in the Anythink dashboard
users:read Listing people for the User ID picker in the dashboard
im:write Opening direct message conversations
users:read.email, reactions:write, files:write, channels:history Requested with the others. The current operations don't use them.

Copy the Client ID and Client Secret from Basic Information.

Step 2: Configure and connect

In the Anythink dashboard

  1. Go to Settings › Integrations, open the Integrations tab and select Configure & Connect on the Slack card.
  2. Add the callback URL shown in the dialog to your Slack app under OAuth & Permissions › Redirect URLs.
  3. Paste the Client ID and Client secret and select Save.
  4. Approve the app for your workspace when Slack asks. The card now shows Connected.

Only project administrators can open this page.

With the CLI

Add http://localhost:8745/callback to your Slack app's Redirect URLs, then:

bash
anythink integrations oauth configure slack --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET>
anythink integrations oauth connect slack --name "Team workspace"

oauth connect opens your browser, waits up to five minutes for you to approve the app, then prints the connection ID. Use --port if 8745 is taken, and add the matching redirect URL to the Slack app. Without --client-secret, oauth configure prompts for the secret without echoing it.

With an AI assistant (MCP)

text
Connect Slack to this project with the anythink CLI and tell me the connection ID.

The assistant calls the cli tool with integrations oauth connect slack. The browser opens on your machine for you to approve the app, so this needs the MCP server running locally in stdio mode. The hosted MCP server doesn't run integration commands. Run oauth configure yourself first, so the client secret stays out of the conversation.

Step 3: Send a message from a workflow

Add an Integration step, choose Slack and the operation Send Message, and set Credential Source to System (shared connection). As JSON:

json
{
  "channel": "#orders",
  "text": "New order from {{ $anythink.trigger.data.customer_email }}"
}

channel is a name such as #orders or a channel ID. The step returns ok, the channel ID and the message's ts. For a complete workflow, see Slack and Google Calendar workflow recipes.

Verify

Run Test Workflow with the step in place. The message appears in the channel, and the step's output in View Job History has ok: true.

Variations

  • Private channels. chat:write.public covers public channels only. Invite the bot to a private channel before posting to it.
  • Direct messages. Use Send Direct Message and choose the person from the User ID list, or pass a Slack user ID such as U024BE7LH in user.
  • More than one workspace. The dashboard manages one Slack connection per project. Add another with anythink integrations oauth connect slack --name "Support workspace", then set the step's Credential Source to Specific Connection (by ID) so each step uses the right workspace.
  • Rotate or remove. See Rotate, pause or disconnect an integration.

Next steps