DEV Community

Upkar Lidder for IBM Developer

Posted on • Originally published at Medium on

Let Serverless do the work !

One of my colleagues reached out to me to see if I can help automate a weekly status update task using Serverless and Slack bots. He currently has to download an excel file from a server every Monday at 9AM and provide stats to the team based on the contents of the file. This is a perfect opportunity to use periodic triggers and serverless actions to automate this mundane task ! I am using Apache OpenWhisk hosted on IBM Cloud Functions, but you can easily follow this same recipe on other serverless platforms.

The code is divided into two functions / actions

  1. read-cos : reads the file from IBM Cloud Object Store and aggregates the stats that need to be shared with the team
  2. post-slack : posts a message to a given channel on Slack

I finally create a sequence action composed of the above two actions. I then link a trigger that invokes this sequence every Monday at 9am ! Easy peasy !

The application uses the following solutions

The complete source is available on Github. Additionally, I have recorded a video that goes through the process. Take a look …

What are your automation stories with Serverless ? Please share in the comments below !

Thought of the day …

Discussion (0)