Multiple Interactive Slack Message

Hi,

I have a Slack channel with 5 members.

I want to develop a workflow whereby the Rapid7 InsightConnect Slackbot would post an interactive message to said Slack channel with two options (Approve/Reject). That message will go to all 5 members of the channel to make a decision. I want to be able to capture 3 approvals. Once I capture 3 approvals, the workflow continues. How can I build this out logically? It seems like when one member of the group approves/rejects, the decision is no longer available to make for the other group members.

Thanks.

This should be possible using a loop and the count method for loop outputs. I am putting together a guide and will post it here when it is completed.

I might have a couple options but here is the first one.

Option 1: This works but it needs 4 decisions to be made before it will calculate a majority 3+ decisions due to the way Loop Outputs work.

  1. Create a Loop: Decision Loop and have it loop 5 times

  2. Configure Loop - Custom Outputs:
    2a. Name: Approval Output Type: Count
    Count Loop Runs That Match: {{["Decision Path"].[Decision]}}="Approve Request"
    2b. Name: Denied Output Type: Count
    Count Loop Runs That Match: {{["Decision Path"].[Decision]}}="Reject Request"

  3. Create your Slack Decision step: Make Decision
    3a. Decision Choices: Approve Request and Reject Request

  4. Create a Join Step: Decision Path
    4a. Create a variable in the Join Step: Decision Value: {{["Make Decision"].[path]}}

  5. Create a Break Step - Break Loop If is_defined({{["Decision Loop"].[Approval]}}) AND {{["Decision Loop"].[Approval]}}=3 OR is_defined({{["Decision Loop"].[Denied]}}) AND {{["Decision Loop"].[Denied]}}=3

  6. Configure Loop - Custom Outputs:
    6a. Name: Approval Output Type: Count
    Count Loop Runs That Match: {{["Decision Path"].[Decision]}}="Approve Request"
    6b. Name: Denied Output Type: Count
    Count Loop Runs That Match: {{["Decision Path"].[Decision]}}="Reject Request"

  7. Exit Loop - Create an Automated Decision
    7a. Path Names Approved and Denied
    7b. Default Approved as the choice
    7c. Query for Denied: {{["Decision Loop"].[Denied]}}>=3

  8. Continue normal workflow

This should give you what you need, it worked for me in testing. If you want an example workflow send me an email michael_cochran@rapid7.com and I will email you something over.

Did you give this a try and does it work for you?

Hi Mike, it appears to be working as intended - thanks!

1 Like