Guide to Building Your Workflows on Slack

Slack’s tagline is “Where work happens” which tells us a lot about it’s aspirations. Slack has come far from being a just messaging platform or even a just messaging platform with a lot of integrations. Slack heading towards being the place where your all your business applications live.

This essentially means that you can do a lot more without leaving Slack. For users of Slack this is great for a couple of reasons. Not having to context switch between applications and having access to a rich collaborative environment around everything you do will improve productivity. Be honest do you really enjoy switching between that HR application, Expensing tool and Conferencing App at work. To make matters worse these often change, have terrible mobile experiences and you have to send out emails just to find the link to get to them.

For developers and startups this is a game changer. You can now essentially build an entire SAAS application as an API. For the user-interface just use Slack. It now comes with a rich collection of UI elements like buttons, text boxes, drop-down selectors, etc. Know what’s even better, you’re product is now mobile ready. It will be available to your users on iPhones and Android without you having to do a thing.

How to build workflows on Slack

Webmatr is a tool that helps you quickly build out and run Slack applications. Its a managed server-less platform that takes care of almost everything for you. Here’s how you can create a quick simple game in Slack using Webmatr

Follow the link below and click “Activate” to try out the example Slack game. Or follow the simple steps below to build it on your own.

Click here to try the Webmatr slack workflow example

Steps to build the example on your own.

  1. Click “Create” in the menu and choose the type of app you want
  2. Click “Add API” and search box enter “slack send a message
  3. Choose the API titled “Sends a message to a channel”
  4. Click “Add Account” and finally connect the account
  5. You now have an app connected to Slack and you’re ready to write some Javascript code
  6. Copy the code below into the “Write Code” area.
  7. Click “Save” and “Test” run your app.
if (app.source() === "slack.action") {
api.getChatPostMessage({channel: "random", text: "Great choice: " + app.data().actions[0].value });
}
else {
var att = [{
text: "Choose a game to play",
fallback: "You are unable to choose a game",
callback_id: "wopr_game",
color: "#3AA3E3",
attachment_type: "default",
actions: [
{
name: "game",
text: "Chess",
type: "button",
value: "chess"
},
{
name: "game",
text: "Falken's Maze",
type: "button",
value: "maze"
},
{
name: "game",
text: "Pillow Fight",
style: "danger",
type: "button",
value: "war",
confirm: {
"title": "Are you sure?",
"text": "Wouldn't you prefer a good game of chess?",
"ok_text": "Yes",
"dismiss_text": "No"
}
}
]
}]

// you can use app.put(key, value) and app.get(key) to save state (docs coming)

api.getChatPostMessage({channel: "random",
text: "Would you like to play a game?",
attachments: app.slackAttachments(att)
});
}

For more documentation on other types of actions see Slack’s documentation. You can build them all on Webmatr.

Disclaimer: Webmatr has no affiliation to Slack. We are a platform that makes it easy for people to build on Slack’s API