Invocation & interactivity

Both Slack apps and workflow automations can be invoked automatically (like a scheduled message) or by a user (like by clicking a shortcut). All Slack apps can also use interactive features to achieve much more than just one-way communication.

An injection of interactivity invites and inspires action (and reaction). Best of all, users never have to depart from the comfort of Slack to get things done.

The interactive flow between Slack apps and users is a two-step process:

  1. Something happens that invokes the app or interaction.
  2. The app responds to the interaction.

There are multiple ways to invoke apps and interactions, and apps have multiple ways to respond.


Invoking apps

There are several potential ways that app invocations are triggered. They can be divided into two categories:

Automatic invocations

Your app can be invoked without any direct user input. Let users focus while your app handles what it needs to on its own.

Scheduled interactions

The interaction is invoked at a specific time with a specific cadence.

For example, on every Friday at 3pm an app could post a reminder.

➡️ To achieve this with a workflow automation, check out the guide to scheduled triggers.

➡️ To achieve this with a Slack app, check out the Send or schedule a message guide.

Interactions initiated by external services

Connections you've built with external services can trigger app interactions at any time. This provides seamless integration from those services into Slack.

For example, an account update on a CRM platform could cause a Slack app to post a Slack message.

➡️ To achieve this with a workflow automation, check out the guide to webhook triggers.

➡️ To achieve this with a Slack app, check out the Sending messages using incoming webhooks page.

Interactions initiated by the Events API

The Events API can send a push to Slack apps whenever a specific event occur in Slack. The receipt of one of these event pushes can trigger some interaction response by an app.

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 achieve this with a workflow app, check out the guide to event triggers.

➡️ To achieve this with a Slack app, check out the guide to the Events API.


User invocations

Users can directly invoke your app via entry points—a set of app features that serve as launching points for interactions. Most user invocations will send data payloads to an app containing contextual information about the interaction. These types of actions can further be used to interact with the app beyond the initial invocation, achieving a sort of back-and-forth interaction between the user and the app.

Enable these configurable features to provide users a way to invoke and interact with apps from the comfort of familiar Slack client elements.

Shortcuts

Shortcuts let users quickly trigger workflows from various prominent UI locations in Slack.

➡️ Refer to Link triggers for more info on using shortcuts, or rather, link triggers, with a workflow automation.

➡️ Refer to Shortcuts for more info for using shortcuts with a Slack app.

Slash Commands

Let users trigger an interaction with your app by typing a command into the message composer box in any Slack conversation.

➡️ Slash commands in workflow automations are used simply as another entry point. Read more about it here.

➡️ Refer to Slash commands for more info on using this invocation as well as the many other uses of slash commands in a Slack app.

Block Kit interactive components

Interactive components are a subset of Block Kit, our UI framework of visual components for Slack apps. They can be placed into app surfaces like messages, modals, or App Home. Each component provides its own trigger for a possible interaction.

➡️ Refer to Building with Block Kit for more info.


Responding to interactions

An app's reaction to an interaction can take on many forms, ranging from doing nothing at all, to performing one of the many API functions available to Slack apps.

Some possibilities:

Send messages using Web APIs with a Slack app or using built-in Slack functions with a worlflow automation.

Create, archive, and manage conversations using conversation-specific Web APIs.

Open modals to collect info and provide a space for displaying dynamic details. Check out a how it's done for Slack apps and for workflow automations.

Read our guide to designing your Slack app for some interactivity inspiration.

All interactivity payloads can be found in the Reference: interaction payloads documentation.

Implementing infinite interactions

Responses to interactions can themselves be invocations of further interaction.

Some examples:

  • An interactive message could be published in response to a schedule, and a button within that message could be clicked to continue a workflow.

  • A shortcut could trigger a modal that, once completed, could trigger an update of the app's Home tab.

Chaining interactions together creates workflows that can accomplish complex tasks.

Ready to add interactivity to your app? Next stop is Handling user interaction in your Slack apps for Slack apps or start with Creating a form for workflow automations.