Slash commands
  • 30 Jan 2023
  • 1 Minute to read
  • Dark
    Light

Slash commands

  • Dark
    Light

Article Summary

Create a Slack Slash Commands integration in Torq to trigger Torq workflows by running slash commands in Slack. The integration generates a unique endpoint that should be added to each Slack slash command so that Slack knows where to send the data.

1. Create a Slack Slash Commands integration

Perform these steps in Torq.

  1. Go to Integrations > Triggers, search for the Slack Slash Commands card, and click Add.
  2. Enter a meaningful name for the integration, such as slack-slash-commands, and click Add.
  3. 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.

2. Create slash commands

  1. Go to https://api.slack.com/apps/.
  2. Select an existing app or click Create an App and select to configure it From scratch.
  3. Specify a name for your app and select the Slack workspace you want to develop the app in.
  4. Once you've created the app, go to Slash Commands and click Create New Command.
    Screenshot of creating a slash command in Slack.
  5. Fill in the command details. Below is an example configuration for the command.
    FieldDescription
    CommandThe slash command name as it appears in Slack.
    Request URLThe Slack integration endpoint you created in Torq.
    Short descriptionDescription of the command that will be displayed in Slack.
    Usage hintAn example displayed in Slack that helps users understand what they expected command input is.

    Screenshot of the slash command fields.

  6. Install/reinstall the app you created by going to Basic Information and clicking Install to Workspace or Reinstall to Workspace.

3. Create a workflow

Create a Torq workflow that's triggered by a Slack slash command.

  1. Go to Workflows and click Create Workflow.
  2. Specify a name for your workflow and pick the trigger to be an integration.
  3. Select the trigger integration type to be Slack Slash Commands and then select the integration you created.
  4. Add functionality to the workflow you created.

4. Run a command from Slack to trigger the workflow

Go to the Slack workspace where you set up the Torq bot.

  1. In the Slack CLI, run the slash command you created /domain_lookup google.com. The workflow should start running automatically.
    Screenshot of running the slash command in Slack
  2. Go to your Torq workflow and make sure the trigger got an event and your workflow was executed.
    Screenshot of the event log showing the event that triggered the workflow from the Slack slash command.

      


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.