Slack notifications integration (SlackBot)
I have created, with the help of the precious @emcodem – thanks mate! – a SlackBot that allows to receive notifications from FFAStrans workflows.
Here is a sample workflow you can use right away or modify to your liking:
If you only need the Slack integration, just copy the two “SlackBot Notif” nodes and apply them to your existing workflows.
The “Fail” node needs to be connected to all nodes on “execute on error” – there is no global fail code in FFAStrans as of now so this is the only way to receive any fail notification that comes from any of the nodes.
The “Success” node needs to be connected, of course, after the Delivery node or any other node that you have at the end of your workflows. It will get the success state from the previous node and send a POST msg to your Slack app.
Visual of the sample workflow & notifications in Slack:
Steps for creating your own Slack App (SlackBot):
1. Have a Slack room and a channel set up for receiving notifications – it can be any of your existing channels or you can create one dedicated only to this like I did.
2. Go to https://api.slack.com/apps and create a new app.
3. On the left categories column, go to Incoming Webhooks and activate the function.
4. Create a new Webhook URL and copy the given URL.
5. Paste the URL to your SlackBot nodes in FFAStrans.
6. Set the action of the Slack nodes to “POST” and edit the POST msg to your liking if necessary.
7. Enjoy Slack notifications from FFAStrans!
Note on the editable message to Slack:
The message that is posted to Slack must be written in JSON, and you can use the Slack message formatting notation to format your messages. Please refer to https://slack.com/intl/en-it/help/artic ... r-messages and https://api.slack.com/reference/surfaces/formatting
SlackBot notifications integration guide & sample workflow
Re: SlackBot notifications integration guide & sample workflow
Works like a charm! Thanks a lot for the tutorial Giacomo
For potential future readers:
Just don't forget to use a populate vars node and the $jsondecode function to make all stuff that can contain " or \ Json safe.
https://ffastrans.com/frm/forum/viewtop ... 1229#p6544
It's a shame that we cannot talk back from slack to ffastrans unless our ffastrans or at least some gateway/proxy is in the internet. Would be nice if users could e.g. start another workflow or such when they get a fail notification
For potential future readers:
Just don't forget to use a populate vars node and the $jsondecode function to make all stuff that can contain " or \ Json safe.
https://ffastrans.com/frm/forum/viewtop ... 1229#p6544
It's a shame that we cannot talk back from slack to ffastrans unless our ffastrans or at least some gateway/proxy is in the internet. Would be nice if users could e.g. start another workflow or such when they get a fail notification
emcodem, wrapping since 2009 you got the rhyme?
Re: SlackBot notifications integration guide & sample workflow
Yeah it would be awesome - I was thinking of this today. I'll investigate on the possibilities there
Thanks again for your help setting this up mate!
Thanks again for your help setting this up mate!