Building Slack bots for DevOps automations

What is a Slack bot?

At Addteq we have been fascinated with bots, AI assistants, and ChatOps for their practical applications and automation capabilities. There are numerous group chat solutions currently available in the market but we believe Slack is the industry leader. The power of Slack goes beyond enabling collaboration via text, audio, and video. Slack is the best tool to unify all of your other tools in order to be productive with a unified workflow. This is made possible due to the powerful platform for building apps, integrations, and bots. 

A bot is a nifty way to run code and automate tasks. In Slack, a bot is controlled programmatically via a bot user token that can access one or more of Slack’s APIs. Read on to learn more about creating a bot for your workspace. 

What can bots do?

  • Monitor and help process channel activity
  • Post messages in channels and react to members’ activity
  • Make channel messages interactive with buttons

Source: https://slack.com/help/articles/115005265703-Create-a-bot-for-your-workspace

Why build a Slack bot?

Slack has a rich ecosystem of apps and integrations available via the App Marketplace. These apps also include bots that allow users to have an interactive interface for powerful automation features ranging from allowing you to collaborate on Trello within Slack, ChatOps for AWS to automating meetings. However, we occasionally encounter niche internal and customer use cases where we need to create a conversational workflow that can drive automation across one or more tools. Internally, a few years ago we built our DevOps automation bot called “Brobot” for enabling self-provisioned cloud & container infrastructure to empower our support and development teams. This was initially built for Hipchat and later migrated to Slack. This greatly reduced the friction and wait time of manual provisioning while enabling rapid iteration and experimentation.

However, Slack allows you to implement apps and bots that go above and beyond ones that simply respond to lengthy commands like in the examples above. Slack provides developers to tap into the rich user interface and experience within the chat client.  Addteq has combined our expertise with the Slack platform building blocks to enable complex long-running automation workflows to be triggered and monitored within Slack while empowering teams to do so in a transparent manner. We also understand the security requirements especially of our enterprise customers to enable these while building solutions to meet and exceed compliance. One such example is that we are early adopters of Slack’s Socket Mode feature for developers which enables building powerful Slack integrations safely behind your company’s firewall. 

How to build a Slack bot?

Slack provides the building blocks for rich interactive features such as:

Home Tab

Unique home tab for the app users that enable personalized views. In the App Marketplace, the Google Calendar app is a good example where it shows the individual’s calendar.

Modals

Provides ways to collect input from users and ephemeral/interactive information. 

Messages

Apps can converse with the users or vice versa. 

Interactivity

There are multiple ways to trigger interactions like scheduled events, triggered by an external service, API, or user-triggered (Slack Shortcuts, Slash Commands, etc.)

Block Kit Builder

Slack also provides a way to build quick UI prototypes using this interactive browser-based tool. This allows developers and less technical folks to create a mockup for their custom Slack apps. This tool also generates the actual payload that the custom apps can utilize and hence it is simply not just a prototyping tool but more of a UI builder.

Events API 

Apps can subscribe to events from Slack and implement custom logic for responses. 

Workflow Builder 

A no-code tool to automate routine processes that can be triggered by users or external webhooks. Our Excellentable dev team lead recently implemented a Release Announcement workflow which is a good example:

Conclusion

Slack provides rich developer documentation that can be referenced by app builders. Addteq is an expertise in the ChatOps space for building rich user experience for DevOps and collaboration workflows. We recommend getting in touch with us for a consultation session to assist your organization with custom apps, integration, and automation needs including Slack bots. Contact Addteq to discuss building custom Slack bots for your automation needs.

Related Content
Man working on laptop, free public domain CC0 photo
Enhancing Accessibility in Jira & Confluence with Unstoppable
Discover how Unstoppable enhances accessibility in Jira and Confluence, making these tools more inclusive...
addteq_fb_product4-1
Editable Excel Sheet in Confluence: Best Tools & Methods
Learn how to import and edit an Excel sheet in Confluence. Discover the best tools, including Excellentable,...
Excellentable collaborative editing
Unlock the power of Pivot Tables in Confluence with Excellentable
Discover how to enhance your Confluence experience by creating dynamic pivot tables with Excellentable....

Leave a Reply

Your email address will not be published. Required fields are marked *