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.
Go to Build > Integrations > Triggers > Custom Slack Events, and click Add.
Enter a meaningful name for the integration, such as custom-slack-events, and click Add.
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.
Subscribe to a List of Events in Slack
Perform these steps in Slack: https://api.slack.com/apps/
Select an existing app or click Create an App and select to configure it From scratch.
Specify a name for your app and select the Slack workspace you want to develop the app in.
After you create the app, go to Event Subscriptions and set Enable Events to On.
Enter the Custom Slack Events integration endpoint you created in Torq as the Request URL.
Subscribe to events.
Click Save Changes and install/reinstall the app you created by going to Basic Information and clicking Install to Workspace or Reinstall to Workspace.
Execute an Event in Slack to Trigger the Workflow
Trigger the workflow from Slack and view the event in Torq.
In Slack, execute an event you subscribed to. The workflow should start running automatically.
Go to your Torq workflow and make sure the trigger got an event and your workflow was executed.
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 }}