BUILDING BRIDGES

Snoozes and sleep: The OOO bot and how it came to be!

Nithin Kashyap image

Nithin Kashyap

Engineering at Setu

18 May 2021 — ENGINEERING

CULTURE

Snoozes and sleep: The OOO bot and how it came to be! title image

Have you ever woken up groggy, or are faced with an existential crisis that makes you want to get some more snoozles for the day? If so, we’re with you. Oftentimes, informing your team about your dilemma is a bit tedious, and doing that while half-asleep is even more. That’s where our OOO bot comes in, it makes it easier for burnt-out people to go on leave without having to worry about calendars, leaves, and other details. We go on a deep dive and have a look at how Vaibhav (part of our engineering team) identified and solved this issue to make our lives easier.

The story of our OOO bot on Slack began when we were still in the pre-Covid era and only had our Setu-OOO calendar to rely on for leave updates. Asking people to keep this calendar updated was an uphill task and this got Vaibhav and Ruby talking about how we should have something in place to automate this and voila, Vaibhav did his magic! Now that you know the origins, let’s dive into the tech that makes it tick. We all know that our OOO bot is a Slack application that listens to the OOO slash command, so the moment you type OOO in your Slack messenger there is a webhook that gets triggered which fetches a template and invokes Slack’s UI framework called Block Kit. Once you fill in the relevant details in the form and click on ‘submit’, the Slack application gets your name from your Slack profile and creates an event in the OOO calendar. The application is hosted on Amazon ECS, the reason why Vaibhav could not use a serverless framework like AWS Lambda which is built for such use cases boils down to the fact that Slack requires responses to be obtained in less than three seconds to avoid timeout errors. There were also a couple of privacy-centric design decisions that Vaibhav took, for example, the OOO bot does not mark you OOO on your calendar as it’ll require you to grant certain permissions. Likewise, it also does not mark your leave on GreytHR.

As of now, many Setuzens have used the OOO bot regularly to mark themselves on leave, and if you have noticed you’ll know that the OOO bot went through a couple of iterations to get to where it is now. It progressed from being only a slash command where you could mark yourself on leave for one day to having a UI that allows people to use a date picker and apply for multiple days’ leave. All of this was possible because of the feedback that Vaibhav received. In the latest iteration, Vaibhav has introduced an easter egg into the OOO bot. Let us know if you have seen that.

Thanks for the time folks, hope you got to know something new and I believe you’ll never look at the OOO bot the same way again. If you feel you require certain commands that can benefit you or others like you then feel free to submit a PR. The project is located here.


Subscribe to our newsletter

Join our subscribers list to updates, news and articles delivered right to your inbox