An overview of app interactivity
Slack apps can use interactive features to achieve much more than just one-way communication.
An injection of interactivity can invite and inspire action (and reaction). Best of all, users never have to depart from the comfort of Slack to get things done.
In this overview we'll explain the general flow of interactivity between Slack apps and users. You'll learn about the different ways that interactions can be invoked, and the multitude of options for responding.
- The flow of app interactions
- How interactions begin
- Responses to interaction
- Infinite interaction invocations
Every interaction between a user and an app exists as part of a flow, a continuum of events that gets something done.
This interactive flow can be simplified to two basic steps:
Read on for a more detailed study of this action and reaction process.
Any interaction has to start somewhere, with a knock on the door to request entry.
There are several potential ways that app interactions are triggered.
The timed or scheduled interaction is one of the simplest triggers, one that doesn't necessarily need the input of a user to occur. Some examples include:
- An app that posts a reminder every Friday at 3pm;
- A dashboard-style app that updates every hour;
- A lunch ordering app that prompts a menu choice every weekday at 12pm.
Connections you've built with external services can trigger app interactions at any time. This provides seamless integration from those services into Slack. Some examples include:
- A task list being refreshed due to a change in an external task-tracker service;
- A notification posted in Slack because an account was updated on a CRM platform.
For example, the
app_mention event sends a push when an app is mentioned by someone in a conversation. The app could then respond with a message to continue the workflow in the same conversation.
Read more about enabling and reacting to Events API notifications.
Give the control to trigger interaction to your users by enabling one of these entry points:
- Shortcuts — add options to prominent UI locations in Slack.
- Slash commands — A text command triggered by typing into the message box in Slack.
- Block Kit interactive components — A series of visual components that can be placed into app surfaces like messages, modals, or Home tabs. Each component provides its own trigger for a possible interaction.
Reaction follows action — if a door is knocked, someone on the other side decides what to do. Maybe they'll hide behind the sofa, run to collect the delivery they were waiting on, or tentatively open the door for an unexpected visitor.
An app's reaction to an interaction can take on many forms too, ranging from doing nothing at all, to performing one of the many API functions available to Slack apps. There are countless possibilities.
Some features have their own specific interactive behaviors to accommodate — most user invocations will send data payloads to an app containing contextual information about the interaction, for example.
Read the relevant docs linked above for more information on specific interactive flows for different features.
The interactive flow we've described above might seem simple on the surface, a binary back-and-forth. Consider, however, that the responses to interactions can themselves be invocations of further interaction.
An interactive message could be published in response to a schedule, and a button within that message could be clicked to continue a workflow.
When that modal is submitted and closed, that could be the trigger for an update of the app's Home tab.
Chaining interactions together creates workflows that can accomplish complex tasks. It's important to have a good sense of the flow of your app before you start building these interactions.