Automating Feature Flag Management with LaunchDarkly on the Tray Platform
At Tray.io, LaunchDarkly is embedded in our product and engineering processes. We use LaunchDarkly for feature management, managing feature releases, and beta programs. It is an essential part of a feature's lifecycle.
LaunchDarkly lets our engineering teams deploy production-ready code regularly, whilst ensuring the product team can release features iteratively.
The key challenge we face has to do with access across different teams in different time zones. We often toggle features for both internal and external users of the Tray Platform, but we only have a handful of users who have access to LaunchDarkly, and all these users are based in London. Whereas, the go-to-market team is based in San Francisco.
Imagine it's 3 pm in San Francisco and you were meant to request access to a new feature that you were doing some alpha testing on. It's now 11 pm in London and you don't want to disturb the LaunchDarkly admins, but you're going to be late testing the new feature and giving feedback.
Fortunately, we've been able to use LaunchDarkly with our own product, the Tray Platform, which can quickly and easily create API integrations, automate processes, and make just about anything possible. Our platform lets users build powerful and sophisticated automation workflows to solve for data silos and improve business processes. Using LaunchDarkly's API, we knew that we'd be able to empower internal users to easily and safely access features on an individual basis, for customers or prospects. Before building a workflow, we usually think about who the workflow is for and how they will consume it. Since Slack is our primary mode of communication, being able to execute mission-critical operations, such as offering interactive modal menus and sending out instantaneous updates entirely within Slack is a game-changer. We already use Slack apps and modals for many of our internal processes, so the interface is familiar and would ensure that onboarding users would be pain-free. We built two workflows: one to update the list of flags that is populated in the Slack modal, and one to create the Slack modal, which will update the feature flag.
Given the power of feature flags and the potential implications of enabling or disabling a flag by accident, we used the Tray Platform's flexible logical operators, which include things like Boolean “true/false” loops, to add much-needed validation and verification of users, ensuring they are only updating their own flag, or that they have the admin rights to update a customer's flag.
1. Workflow: Get the most up-to-date flags
In the first workflow, we use the Tray Platform's scheduled trigger, which lets us kick off automated workflows around specific calendar dates and times, to ensure that the Slack modal is using the most up-to-date list of feature flags. We store this in a data storage connector, which can be set at the account level. This enables any workflow to get the stored key.
2. Workflow: Build the Slack modal and let users input flag details
The workflow is triggered by a Slack slash command /flagtargeting via a webhook. The workflow will run twice: first down the false branch and second down the true branch of our Boolean logic operator. The false branch gets the most up-to-date list of feature flags and then opens the modal for the user in Slack. Using our platform's custom logic helpers, we ensure that users properly receive the Slack modal, and that we properly log the details they enter into the modal itself.
In the Slack modal that our LaunchDarkly workflow pops up, users can decide the environment, flag name, and the status to update. A script parses the user's responses.
3. Verify users and update the LaunchDarkly flag
All internal users at Tray.io are able to update their own flag settings (even an email alias can have its own settings configured). However, we also manage a group of admins that can update customers' flags too. To ensure we're in compliance with our internal security practices, the workflow checks to see whether the requesting user is authorized to make changes for customer accounts. If they aren't, the workflow confirms whether the LaunchDarkly user they are updating is the same as the Slack user submitting the modal.
After the verification steps are done, the flag can now be updated! Our automated workflow on the Tray Platform takes these insights from LaunchDarkly and outputs a Slack message to let users know that the flag has been updated.
* * *
Sheree Lim is a Product Manager at Tray.io, where she leads the development of product experience and enterprise-grade solutions. When she's not solving problems at Tray.io, she DJs at music festivals, and attempts to do triathlons.