The Slack Connector provides a MESSAGE_RECEIVED event that allows Slack messages to be monitored and events published when specific criteria are met. You can use this event to trigger automation based on messages received in Slack channels, direct messages, or mentions.
Note: Configure the Slack connector event subscription to receive
notifications from the Slack API before using Slack trigger events.
The input parameters for the trigger are:
| Parameter | Description |
|---|---|
| condition | A condition that determines whether the trigger publishes an event. For more details on conditions available as a part of the input values, see Creating Conditions. |
| pattern | A regular expression that determines which Slack messages trigger an event. Capturing
groups can be used to extract values from matching messages, for
example: Order Number (?<orderNumber>.+) The
variables can then be used in echo and
echoError, for example:
${orderNumber}
Note:
This parameter is required. |
| echo | Message sent back to the user when the message matches the configured pattern, for example: Your reference number is ${orderNumber}. |
| echoError | Message sent back to the user if an error occurs while publishing the event, for example: There was a problem publishing that event. |
| channelTypes | Slack channel types to monitor, such as direct-message, public-channel, or mention. |
Note:
Regular expression capture groups can be referenced in trigger actions through the matchGroups object. For example, the following pattern captures an order number: Order Number (?<orderNumber>.+). The captured value can then be referenced in messages: ${matchGroups.orderNumber}, for example: Your reference number is ${matchGroups.orderNumber}.