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 Slack Custom Events integration in Torq to trigger workflows automatically in response to specific Slack events, such as bot mentions, reactions, or message updates.

Setting up the integration allows Torq to subscribe to selected events in your Slack workspace. When the specified event occurs, Slack sends the event data to Torq, which triggers the corresponding workflow seamlessly and 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.

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

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 Custom Slack Events in Torq workflows, look here.

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

Use Slack Custom Events to Trigger Workflows in Torq

Step One: Create a Custom Slack Events 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 for the custom events integration.

Step Two: Subscribe to a List of Events in Slack

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

  1. Pick an App: Select an existing app or click Create an App and select Configure it from Scratch.

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

  2. Enable Subscriptions: Inside the app, go to Event Subscriptions and set Enable Events to On.

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

    Screenshot of configuring the webhook and event subscriptions.
  4. Subscribe to events: Subscribe to relevant events you would like to use to trigger Torq workflows. Below are some examples of potential events for subscription.

    1. Bot events

      1. channel_created

      2. member_joined_channel

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

      1. file_created

      2. file_shared

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

      1. Triggers whenever a user posts a link from a specific domain.

        Screenshot showing how to subscribe to domain link events.
  5. Finalize: 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.

Step Three: Execute an Event in Slack to Trigger the Workflow

  1. From Slack: In Slack, perform an event you subscribed to, such as sharing a file. The workflow should start running automatically.

  2. In Torq: 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.


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?