Skip to main content
Slack Slash Commands

Integrate Slack Slash Commands with Torq to trigger workflows directly from Slack by setting up a unique endpoint.

Updated this week

Create a Slack Slash Commands integration in Torq to trigger workflows using Slack slash commands (commands that begin with a slash, like /trigger).

Creating the integration generates a unique endpoint within Torq, which you then add to a Slack slash command configuration. When a user sends the slash command in Slack, Slack sends the data to the endpoint in Torq, triggering the corresponding workflow automatically.

Slash Commands vs Custom Slack Events

Torq simplifies integration with Slack, so you can quickly start automating smarter and with unmatched flexibility. Torq allows triggering workflows from both Custom Slack Events and Slack Slash Commands. Use Slash Commands to trigger workflows instantly with a simple /command, and use Slack Events to automate responses to real-time events like bot mentions or message updates.

Slash commands are ideal for intentional, user-triggered actions, while custom events are better suited for automating responses to ongoing activity in Slack.

Feature

Slash Commands

Custom Events

Trigger

Explicit user input (/command)

Automatic based on Slack activity

Setup

Registered commands in app settings

Subscribed event types in Slack API

User Interaction

Direct and intentional

Reactive and context-driven

Best Use Case

User-initiated actions

Automation or behavior-driven triggers

To use Slack Slash Commands in Torq workflows, look here.

To use Custom Slack Events in Torq workflows, look here.

Use Slack Slash Commands to Trigger Workflows in Torq

Step One: Create a Slack Slash Commands Trigger Integration in Torq

  1. Navigate to Integration: Go to Build > Integrations > Triggers > Slack Slash Commands, and click Add.

  2. Add Integration: Enter a meaningful name for the integration, such as slack-slash-commands, and click Add.

  3. Copy URL: In the table, locate the integration you just created and copy the endpoint URL. You will enter this as the Request URL when you create the slash commands in Slack.

Screenshot of copying the webhook URL from the integration.

Step Two: Create a Slash Command in Slack

  1. Go to Slack API: Go to https://api.slack.com/apps/.

  2. Choose App: Select an existing app or click Create an App and select Configure From Scratch.

    1. Specify a name for your app and select the Slack workspace you want to develop the app in.

  3. Slash Commands: Once you've created the app, go to Slash Commands and click Create New Command.

    Screenshot of creating a slash command in Slack.
    1. Fill in the command details. In the following example, the workflow will be triggered by the slash command /domain_lookup and run a workflow that looks up the given URL. See the table below for further breakdown.

      Screenshot of the slash command fields.
  4. Finalize: You must install or reinstall the app you created by going to Basic Information and clicking Install to Workspace or Reinstall to Workspace. This will save your changes.

Field

Description

Command

The slash command name as it appears in Slack.

Request URL

The Slack integration endpoint you created in Torq.

Short description

Description of the command that will be displayed in Slack.

Usage hint

An example displayed in Slack helps users understand what the expected command input is.

Step Three: Create a Workflow in Torq

  • Build: Go to Workflows and click Create Workflow.

    • Specify a name for your workflow and pick the trigger to be an integration.

    • Select the trigger integration type to Slack Slash Commands, and then select the integration you created earlier.

  • Add Functionality: Add functionality to your workflow as desired (in our example, a domain check and a follow-up Slack message)

Step Four: Run a Command from Slack to Trigger the Workflow

  • In Slack: In the Slack workspace wherein you added the Torq bot, run the slash command you created, for example: /domain_lookup google.com. The workflow should start running automatically.

    Screenshot of running the slash command in Slack


FAQs


Templates

Now that you've added your integration, check out these templates specially crafted by Torq's security experts. Visit Torq's template library for more.

Did this answer your question?