Developer Guide: A New Way to Build on the Slack Platform
Today more than a million developers use the Slack platform each week to build custom applications. It’s amazing to witness this level of creativity, such as building reminder bots and daily automations; integrating processes and support avenues; and building fun, inclusive tools.
But that’s not the end of the story. With the release of our new platform capabilities comes a variety of new possibilities.
What the Changes Unlock
The Slack platform now supports you in building better apps, faster. The changes allow you to move away from creating apps that predict common user behaviors (but aren’t always easy to tweak or adapt) toward building modular app pieces so you can solve user problems in a more efficient way.
Before, the system allowed apps to be created in a product-centric “closed box,” providing your end users with complete, end-to-end experiences.
With the new platform capabilities, it’s possible to create more modular, use-case-centric building blocks for Slack users to benefit from. Think of it like this: The improvements allow you to create your own pantry of reusable ingredients, consisting of functions and triggers, so you can easily make the perfect dish that suits your user needs. Along with a new command line interface (CLI) and Slack hosting, this makes the Slack platform a much better open system.
Streamlining App Creation
There are a lot of powerful APIs and features of the Slack platform, and some really sophisticated apps have been built using our APIs and first-party software development kit (SDK). Until recently, however, there were still hurdles for developers wanting to fully leverage the platform:
- There wasn’t a streamlined, simple way to create an app.
- Once an app was created, there wasn’t a lot in the way of scaffolding.
- Every app had to be built from scratch each time, repeating project setup boilerplate.
- Developers encountered friction points related to hosting, data storage and OAuth.
The new capabilities address these points. This includes:
- Overall user and developer experience improvements
- Better scaffolding
- A Slack CLI
- Improved functions, workflows and triggers
- The ability to run your app on Slack
Watch this overview of the new features from developer advocate Jeremiah Peoples.
“[The improvements] now allow apps to expose their functionality as shared functions that can be combined into workflows (by the developer or user). This means apps no longer have to solve everyone’s unique problems and instead the Slack Platform allows users to solve their own problems unique to their business.”
Let’s dive into how the Slack platform allows you to build better, faster.
Overall UX and DX Improvements
The new capabilities offer a more flexible way to build on Slack in no-code, low-code and pro-code ways. This enables better self-service automation and integration, unlocking more advanced use cases for all team members.
Additionally, teams now need fewer IT and security approvals because everything can be hosted on Slack, which is designed to be compliant and reliable by default.
Slack now provides better scaffolding for building apps, setting you up for more success, faster.
For years, developers have requested an opinionated structure and approach to building apps. For instance, until now, education around certain topics has been complicated for newer builders. This is especially true for permissions (user vs. bot actors and how they differ, what each is allowed to do) and tokens (how each one uses its authentication token, how scopes map to permissions/actions within Slack and how those are associated to each auth token).
The new additions to the platform remove any potentially confusing considerations around tokens — apps now only need to specify the correct scopes they need to perform what they do.
So while the core APIs haven’t changed (our Web API and Events API still power the platform), and our granular permission-app model hasn’t changed (your app will still have a granularly scoped permission in order to run), we’ve shifted the mindset of the platform slightly and improved the developer experience, which in turn allows better apps to be built.
A Slack CLI
Have you made a Slack app before? If so, you’ll recall that it meant a lot of clicks on the Slack dev website graphical user interface, as there was a lot of configurations to set up. With the new Slack CLI, creating a Slack app is now as easy as writing
slack create in your terminal.
The CLI runs on macOS, Linux and Windows and manages the configuration, creating a new app ID, managing your event subscriptions and scaffolding the code for you. The CLI also allows you to run your apps locally, test in a variety of environments and even deploy code, right from your terminal.
This means you can concentrate on automation without having to copy configuration parameters between systems. The CLI and app manifests can also be integrated into your broader software development life cycle, such as through continuous integration pipelines or other automations.
Functions, Workflows and Triggers
These are the three core building blocks that contribute to our modular architecture and help support flexibility and reusability:
- Functions: Modular, reusable blocks of functionality, with a handful of built-in functions you can use like
- Workflows: A combination of functions make up a workflow. For instance, a workflow that welcomes new members and provides them with relevant info when they join a channel.
- Triggers: Workflows are invoked by triggers, of which there are a few types: event, scheduled, webhook and link.
In some ways, functions, workflows and triggers were already present as steps from apps in the existing platform. However, we recognized that there were barriers to discovery and use, so we took steps to improve them. For instance, workflows now work across multiple channels and exist at a global level, so they can be used across channels and other surfaces, including an app home screen and canvases. Previously, workflows only worked in a single channel, so they had to be remade if they were to be reused.
Run Apps Completely on Slack, Securely
With the changes to Slack’s platform offering, you can now run your apps completely on Slack. This means you can do more, in less time, and focus on the app functionality itself.
By default, code deployed to Slack will automatically fulfill all the industry security and compliance standards that are built into Slack’s core product — from SOC 2 to FedRAMP, and more.
What sets the platform apart is the sheer amount of options and support it offers. The development experience was fluid and expansive, helping us explore new ways to integrate our support structure directly in Slack.
SaaS operations engineer, Workiva
In addition, Deno’s secure architecture gives developers built-in granular permissions and controls, like the ability to limit access to certain external domains, network hosts, file system directories and environment variables. Especially for enterprise customers, this is a big win for both developers and admins. These guardrails mean the ability to easily build enterprise-grade apps that Slack admins trust.
Another addition to the platform is datastores. Until now, developers needed a third-party tool (such as SQLite ORM) to store data. In comparison, datastores are an easy way to store and retrieve data. The platform now includes a new set of datastore APIs for managing application data that is stored on Slack infrastructure. This makes it easier than ever for you to create, read, update and delete your app data without using third-party tools.
Previously, app management was done only through a Slack web interface, and it took a lot of clicks to manage and change the particulars of your app. Now, you can programmatically manage your app through the app manifest file.
The manifest.ts file is the most important file in your app’s root directory. Especially in apps that follow a modular architecture, it’s the core of the app’s nervous system, coordinating all the moving pieces. Having it accessible in a file means you can now understand, change and share templates quickly, and they can run and be installed on any workspace.
Configure your app’s name, define functions and workflows, set bot scopes and so much more, all from the comfort of your favorite code editor (and with the Slack CLI).
Workflow Builder (WFB) 2.0: With Workflow Builder, people can automate work for themselves and their teams without writing a single line of code. Since Workflow Builder launched in 2019, more than 540 million workflows have been created, with users launching 1.7 million workflows every business day.
Later this year, we’ll release a new in-Slack-client Workflow Builder UI. This will expose all the invaluable, existing Workflow Builder constructs — including functions, triggers and workflows — in a friendly point-and-click interface. This will improve the UX for motivated folks wanting to automate processes in Slack, supporting the next million users in building workflows that fit their individual use cases.
Some might already have experience with platform-as-a-service tools like Salesforce and be familiar with putting integrations together in just a few clicks. The new capabilities of the Slack platform mean they can easily transfer these skills to Slack. Do you have a colleague who learned how to add custom Slack emojis not long ago? Well, the new capabilities on Slack not only add things like a CLI and SDK for seasoned developers, they also make the entire user experience more accessible. This makes it easier for everyone to orchestrate work in Slack without needing to code.
There’s value for everyone (even developers) in being able to build workflows quickly, without code. Keep an eye out for these newer builders, as they could be creating custom Slack workflows in no time.
How to Get Started
Getting started on the platform, and taking advantage of all the new functionality, couldn’t be easier: Check out our quick-start guide.
The platform is especially helpful for scenarios where you can’t easily host on your own, or if the wider infrastructure is challenging to figure out (for instance, if you’re working in a large enterprise company with restricted hosted compute resources, challenging processes or bureaucracy barriers).
Tap into New Capabilities with an Existing App
If you have an existing app on the platform, you don’t necessarily need to upgrade or change anything; it will still work. In the future, you could consider rebuilding with the new functionalities available to you. However, bear in mind that apps built on the new platform can only be used in one organization at a time, so you cannot scale your app if that’s your intention.
You can tap into the new capabilities from existing apps today using:
- Functions: Add functions to your app.
- Metadata: Start sending metadata.
We’re Excited to See What You Build Next
To starting building with Slack’s new platform capabilities, visit these resources:
- Learn more about our newest section on the Slack API site, where you can download the CLI and discover how to use all the new features.
- Review the samples and templates for apps.
- See how to build and deploy an app in just under 60 seconds.
If you have any questions, head over to the Slack Community Forum.
We look forward to seeing what you build!