Create a Slack Slash Commands integration in Torq to trigger workflows using Slack slash commands (commands that begin with a slash, like /command
). The integration generates a unique endpoint (a special URL that acts as a "destination" for data). Add this endpoint to each Slack slash command so Slack knows where to send the data when you execute the command.
To use Slack Slash Commands 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.
The following variable can be used on a step to get the user email that triggered the workflow from Slack:
##{{ $.metadata.user_email }}
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.