Running Screen Flows in Slack

With Winter ’23, it’s possible to send screen flows to a Slack user or channel, and enable them to run the flows without leaving Slack.

There are two great use cases for enabling your screen flows to run in Slack:

  1. I you have users who spend time in Slack, they may want to have a Slack experience and you can give them one without having to maintain two different versions of a workflow
  2. You want to build a no-code Slack application

In Winter ’23, the initial supported pattern involves sending/dispatching/pushing a screen flow to a slack destination:

In the future there will be other ways to launch screen flows in Slack, such as via Shortcuts.

Official Documentation

Before we go further, make sure you’re aware of these official docs:

‘Salesforce in Slack’ Setup

Connecting ‘Salesforce in Slack’ to a Salesforce Org

Flow in Slack (Official Doc Home Page)

Create a Flow to Run in Slack

Flow Core Actions for Slack: Send Message to Launch Flow

Verifying Your Basic Slack/Salesforce Integration

It’s ESSENTIAL that you verify that you basic connectivity between your Slack accounts and your Salesforce org is fully and properly configured BEFORE you start dispatching screen flows.

These are the signs of a properly configured infrastructure:

1. Salesforce for Slack, the main Salesforce Slack App, is visible in the App list of any user who wants to run screen flows from Slack

If you don’t see this? Look around the Slack App Directory. Here are a couple of places it lives:

and also take a look at the Initial Slack Setup page in Salesforce Setup:

2. When you click on the Home tab of Salesforce for Slack app in your Slack desktop, you do NOT see a Connect button like the example on the right:

If you see that button, and you want to enable the logged-in Slack account to work with screen flows, you need to set up the connection. Keep in mind that simply installing Salesforce for Slack does not automatically register all of the Slack users on that workspace. They each have to individually log into a salesforce org and approve a connection between Slack and Salesforce.

3. Once the connection is created, verify in User Settings (NOT Setup) that a mapping exists between a Salesforce User and a Slack Account, like this:

From a Flow point of view, you target a Slack account for a flow by having a mapping from that Slack account to a Salesforce User, as shown above, and taking that user’s recordID (you DON’T use username or the channel IDs)

How to Build

With that taken care of, we can can start using screen flows in Slack

Part 1: Creating a Slack-Ready Screen Flow

  1. Create a Screen Flow and check the ‘Make available in Slack (Beta)’ checkbox, available in the Advanced section of Flow Settings

Checking the ‘Make available in Slack (Beta)’ checkbox filters the Screen Builder to show only the elements that currently can be rendered in Slack:

Expect more components to be available in future releases.

Save the screen flow and don’t forget to activate it.

Part 2: Setting Up Your Dispatch

The initial paradigm for Flow in Slack is that you ‘dispatch’ or ‘send’ the screen flow to a specific Slack channel from a flow. Later there will be ways to start screen flows from the Slack side via shortcuts and the like.

Every time you create a Slack-enabled screen flow, a unique ‘SendMessageToLaunchFlow action is generated to send it into Slack.

This is similar to how special actions are generated for each Email Alert and each Quick Action your org defines.

Configuring the Dispatch Action

Here’s what a configured Send Message To Launch Flow action looks like:

Input PropertyNotes
Slack AppIf your org has properly enabled Slack Integration you should see a choice ‘Salesforce for Slack’. Choosing anything other than that is for experts.
Slack WorkspaceThis will show the workspaces that have 1) installed the specified Slack App and 2) connected it to your org
Execute Action AsThis should generally be set to Slack App. If a flow is running in User Context and not System Context, you can choose to have the message sent to Slack by the running User, as opposed to the App.
Slack Conversation IDThis label is in the process of being renamed because you only use Conversation ID’s if you want to send the flow to a group channel. If you’re sending to an individual, use the recordID of their Salesforce User account (example: 005B0000003c7pNIAQ)
Slack Message Allows you to customize the initial launch message.
Button LabelAllows you to customize the initial launch message.
Slack Bot NameThis will change the label that posts the launch message. See Slack Bot Name, below.
Slack TimestampSlack timestamps act as unique identifiers for messages. If you pass in a valid message timestamp, the Flow launch message will show up as a response to that message.

Slack Bot Name

If no value is provide, the App Name (“Salesforce for Slack”) is used

Let Us Know

Have you built a Slack solution using Flow? Share it with us here in the comments!