What is your goal?
Hi All
I have an RSS feed that reads articles and I want to Approve/Reject each item using Slack
If the item is approved then it updates a record in postgres
I have most of the workflow working
The items are read, then sent to slack and then go into the database
But what I want to do is add the Approve/Reject step
From reading previous posts, I believe that I should setup a bot in Slack and turn on Interactivity?
But I am lost as to the settings (Request URL etc) that I should enter
Thanks for any help
What is the problem?
Slack Integration
Screenshots: scenario setup, module configuration, errors
Integration RSS 3.blueprint.json (24.3 KB)
Hi @Garrett_Stack,
You are on the right track. To use interactivity and action buttons in Slack, Slack has to send the action somewhere. You can create a new scenario with a webhook as trigger and use the webhook URL as request URL. Then that scenario is triggered whenever you execute an Approve/Reject action.
Cheers,
Henk
1 Like
Building on what Henk said, here are the detailed steps to get this working:
-
Create a Custom Webhook scenario in Make:
- Add a Custom Webhook module as your trigger
- Click on the webhook and copy the webhook URL
- This URL is what you will paste in Slack as the Request URL
-
Configure Slack Interactivity:
- Go to api.slack.com and select your Slack app
- Navigate to Interactivity and Shortcuts
- Toggle Interactivity ON
- Paste your Make webhook URL in the Request URL field
- Click Save Changes
-
In your RSS scenario that sends messages to Slack:
- Use the Slack Post a Message module
- Switch to the advanced Block Kit format instead of plain text
- Add interactive buttons using JSON blocks like this:
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Your article title here"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {"type": "plain_text", "text": "Approve"},
"action_id": "approve_article",
"value": "{{item_id}}",
"style": "primary"
},
{
"type": "button",
"text": {"type": "plain_text", "text": "Reject"},
"action_id": "reject_article",
"value": "{{item_id}}",
"style": "danger"
}
]
}
]
-
In your webhook scenario:
- Add a Router after the webhook
- Create two routes: one for approve, one for reject
- Set filters checking if the action_id equals approve_article or reject_article
- After each route, add your PostgreSQL Update Record module
- Map the value field from the webhook payload to get the item ID
- Update the status field in your database accordingly
-
Important: Add a Webhook Response module at the end of each route to acknowledge the button click within 3 seconds, otherwise Slack will show an error.
Let me know if you need help with any specific part of this setup.
Not sure what I am doing wrong here
I have the 2 workflows
- RSS is sent to Slack
- Web Hook gets the data
I was only expecting either
“action_id”: “reject_article”,
or
“action_id”: “approve_article”,
But both are in the output as shown here?
I have attached both workflows, if it helps
Thanks
Garrett
Integration Slack.blueprint.json (38.7 KB)
Integration RSS.blueprint.json (16.3 KB)
Anyone got any suggestions?
How did you configure the buttons on the other end? Cause at the moment it looks like pressing whatever just sends the entire block, instead of each button sending its own call to the specific url.
Also I downloaded the blue prints → neither of them has a webhook as the start. Looks like your slack scenario watches for new messages being sent. Delete that trigger and replace it with a Webhook module, then paste the url of the webhook in the interactivity section in the slack settings.
@Stoyan_Vatov
Ok Thanks, I have made some corrections
I have changed the starting trigger of the second workflow and replace it with a Webhook module
Now the data takes both routes in the second workflow, no matter if I select Approve or Reject
The following is the data sent to slack for approval/rejection
I am not sure what should go in here, I have it referencing the ID (which is a url of the rss feed)
“value”: “{{1.id}}”,
And the same value is going in both buttons, is this correct?
Also the data arriving at the web hook is just the Payload, which doesn’t contain the
approve_article or reject_article
[
{
“type”: “section”,
“text”: {
“type”: “mrkdwn”,
“text”: “{{1.title}}”
},
“text”: {
“type”: “mrkdwn”,
“text”: “{{1.summary}}”
}
},
{
“type”: “actions”,
“elements”: [
{
“type”: “button”,
“text”: {“type”: “plain_text”, “text”: “Approve”},
“action_id”: “approve_article”,
“value”: “{{1.id}}”,
“style”: “primary”
},
{
“type”: “button”,
“text”: {“type”: “plain_text”, “text”: “Reject”},
“action_id”: “reject_article”,
“value”: “{{1.id}}”,
“style”: “danger”
}
]
}
]
I suppose it should be sending the same data yes, but in the payload you should be seeing the action_id of the button that triggered it along with whatever value you are sending.
Can you show a screenshot of how the initial message is built and what the buttons look like on that end? Cause in the initial blueprint you shared, they don’t have action_id attached to them.
The initial message is built from the rss feed and then sent to slack
I am they querying the payload for approve_article or reject_article, but it appears to contain both, so the workflow takes both routes
I have uploaded the workflows again if it helps
Integration Slack (copy).blueprint.json (31.9 KB)
Integration RSS.blueprint.json (16.3 KB)
The filter is incorrect, but thats not the issue anyways. Can you show a screenshot of the webhook and what the payload looks like when you press a button?
Sure, this is the webhook
And below is the payload that enters the workflow, I have highlighted the area for the buttons
Feed that in a parse JSON module to get the proper format and check what that looks like.
Yeah, I pretty much get the same thing
Ok Thanks
I think i found the section in the JSON, that i can use in the filter and it seems to work now
1 Like