// This module is included in the following assemblies:
// as_connecting-to-slack.adoc

[id='add-slack-connection-start_{context}']
= Adding a Slack connection to trigger integration execution upon receiving messages

A Slack connection that starts an integration triggers execution of the 
integration when the connection finds messages on a Slack channel that 
you specify. 

.Prerequisites

* You created a Slack connection. 
* You are creating an integration and {prodname} is prompting you to 
choose how you want to start the integration. 

.Procedure

. Click the Slack connection that you want to use to start the integration. 
. Select the *Read Messages* action.  
. In the *Channel* field, specify the Slack channel from which you want to
obtain messages. 
. In the *Delay* field, accept the default of 500 milliseconds as the time 
that elapses between polls for messages. Or, to specify a different  
interval for checking for messages, enter a number and select its time unit.
. In the *Maximum Messages to Retrieve* field, accept the default of 10 or 
indicate the maximum number of messages that the connection can return for 
each poll. If the connection finds more than this number of unread messages, 
then it returns the most recent messages.  
The connection returns a particular message only once. 
+
For example, if you accept the default of 10 and there are 15 messages at 
the time of a poll then the connection returns the 10 most recent messages. 
At the next poll, the connection checks for messages that have a time stamp 
that is after the most recent message that the connection previously returned. 
This means that the 5 messages that were not returned in the first example 
poll are never returned. 
  
+
When a Slack connection returns more than one message, the integration 
processes the messages as a batch. In other words, {prodname} executes 
the integration once for the batch.

. Click *Next* to add the connection to the integration. 
