Skip to main content
Custom Slack Events

Integrate Slack with Torq to trigger workflows based on custom Slack events using a unique endpoint for automated notifications.

Updated over a week ago

Create a Custom Slack Events integration in Torq to trigger Torq workflows by getting notifications of Slack events you subscribed to. The integration generates a unique endpoint that can be used by Slack to send data.

Create a Custom Slack Events Integration in Torq

Perform these steps in Torq.

  1. Go to Build > Integrations > Triggers > Custom Slack Events, and click Add.

  2. Enter a meaningful name for the integration, such as custom-slack-events, 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 subscribe to events in Slack.

Screenshot of copying the webhook URL for the custom events integration.

Subscribe to a List of Events in Slack

Perform these steps in Slack: https://api.slack.com/apps/

  1. Select an existing app or click Create an App and select to configure it From scratch.

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

  3. After you create the app, go to Event Subscriptions and set Enable Events to On.

  4. Enter the Custom Slack Events integration endpoint you created in Torq as the Request URL.

    Screenshot of configuring the webhook and event subscriptions.
  5. Subscribe to events.

    1. Bot events

      Screenshot showing how to subscribe to bot events.
    2. User events

      Screenshot showing how to subscribe to user events.
    3. Domain links posted

      Screenshot showing how to subscribe to domain link events.
  6. Click Save Changes and install/reinstall the app you created by going to Basic Information and clicking Install to Workspace or Reinstall to Workspace.

    Screenshot showing how to reinstall the app to your workspace.

Execute an Event in Slack to Trigger the Workflow

Trigger the workflow from Slack and view the event in Torq.

  1. In Slack, execute an event you subscribed to. The workflow should start running automatically.

  2. Go to your Torq workflow and make sure the trigger got an event and your workflow was executed.

Screenshot of viewing the event log in Torq.

If you would like to find the user that initiated a workflow via Slack using /torq run, the following variable can be used on a step to get the user email that triggered the workflow from Slack:

##{{ $.metadata.user_email }}
Did this answer your question?