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 ( | 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
Navigate to Integration: Go to Build > Integrations > Triggers > Slack Slash Commands, and click Add.
Add Integration: Enter a meaningful name for the integration, such as
slack-slash-commands
, and click Add.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.
Step Two: Create a Slash Command in Slack
Go to Slack API: Go to https://api.slack.com/apps/.
Choose App: Select an existing app or click Create an App and select Configure From Scratch.
Specify a name for your app and select the Slack workspace you want to develop the app in.
Slash Commands: Once you've created the app, go to Slash Commands and click Create New Command.
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.
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.