The Blog

The what's what of the Flowdock atmosphere.

Introduction to the New Streaming API

Ville Lautanala February 16th, 2012

Today we’re introducing a new Streaming API, which we hope will ease the process of building your own Flowdock clients and bots. Streaming API allows real-time access to everything that happens inside a flow.

Using the API

Streaming API comes in two flavours: carriage-return delimited JSON stream and HTML5 Event-Stream.

If you have used the Twitter Streaming API, you should be familiar with our JSON Stream. You can try it out using curl.

$ curl -i -H "Accept: application/json" https://<token>@stream.flowdock.com/flows/<organization>/<flow>
HTTP/1.1 200 OK
Server: Florence
Cache-Control: no-cache
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive


{"event":"message","tags":[],"uuid":"pWkb-CPeyFG66ns-","id":142790,"flow":"example:main","content":"hello world","sent":1329307314476,"app":"chat","attachments":[],"user":"1"}
{"event":"message","tags":[],"uuid":"uk7TFsf75WEJbWsy","id":142791,"flow":"example:main","content":"test","sent":1329307316726,"app":"chat","attachments":[],"user":"1"}
...

Event-Stream is part of HTML5 Server-Sent Events specification. In our streaming API each event contains a JSON encoded message as data. To use Event-Stream, set Accept header to text/event-stream. If this isn’t possible, you can also use accept query parameter. In addition to support in modern browsers, there are client libraries, and it isn’t hard to roll your own.

Under the hood

We built a HTTP server using CoffeeScript and NodeJS to run our Streaming API. Combined with a little Redis and authentication magic, we were ready to go.

As a new message is sent to Flowdock, we process the message and publish it to the corresponding flow’s Redis pub/sub channel. When a new client connects, our server subscribes to flow channels the client wishes to listen to. Every time a subscriber receives a new message, we will check if there are any connected clients for that flow, and if so we will dispatch the message down to existing connection in the appropriate JSON/Event-Stream format.

We’re looking forward to see what amazing applications can be built on top of the Streaming API. If you have any issues or feedback, feel free to contact us.

New API: Push + REST + Streaming

Mikael Roos February 15th, 2012

It’s hacking time! The new Flowdock API is out now. We are currently in the process of polishing up the documentation, which will be put onto a public repo on Github a little later for everyone to fine-tune. At this point we are still actively editing and expanding the docs.

Here are the new APIs as of now:

REST APIRead the docs

  • Authenticate as a Flowdock user
  • Get flow data
  • Post to chat or update status
  • Great for Flowdock clients, user-based integrations or two-way bots.

Streaming APIRead the docs

  • Listen to messages
  • Great whenever you want to render the conversation or parse things from what people say.

Push APIRead the docs

  • Post to Team Inbox or Chat without identifying as a user
  • Great for notifications or simple bots which do not need to listen to messages.

Things to come

In the Following days, we will write up the different parts of the API in greater detail. We will also post about these awesome things:

Stay tuned! And tell us what you would like to see next via team@flowdock.com.

GitHub Pull Requests and Issues in Flowdock

Ville Lautanala November 10th, 2011

We have often been asked about how GitHub Issues content could be aggregated in Flowdock. This wasn’t really possible until a few weeks ago as GitHub added event hooks to pretty much everything.

Issues, pull requests, wiki updates, and comments are now pushed to Flowdock in addition to commits. We have been using them ourselves, and it has significantly reduced the time it takes to react to a pull request.

GitHub content in Flowdock

The configuration can be a bit of work until GitHub gets its revamped hooks admin out. If you have an existing Flowdock hook in your GitHub repo, you have to poke the GitHub API a bit.

Configuring new hooks don’t require anything special. Just follow the instructions from our help page and you’re done.

Hubot On Flowdock

Mikael Roos November 9th, 2011

Hubot, Github‘s awesome chat bot was open-sourced a couple weeks ago. That’s when we jumped in and made it talk with Flowdock. Hubot has some pretty cool abilities. To get your very own Flowdock Hubot:

  1. Create a Hubot user for your Flowdock company.
  2. Follow these deployment instructions.

Among the built-in abilities are:

  • show a map for an address (“hubot map me …”)
  • show an image based on keywords (“hubot image me …”)
  • show a youtube video based on keywords (“hubot youtube me …”)
  • fetch an image of a person from the web and add mustache to aforementioned picture of said person as demonstrated above, great for Movember (“hubot mustache me …”)

See the rest by saying “hubot help”. There’s tons more you can add yourself in the hubot-scripts repository.

These features also make use of our new link preview feature (currently works with images, YouTube, Google Maps and tweets).

Make Hubot Useful

Hubot can do much more than incite a laugh or two. For example, one of our users, Christopher Castle, has implemented a JIRA issue fetcher, which allows Hubot to list and search JIRA issues assigned to you.

Similar functionality for Pivotal Tracker has been implemented as well, get it here.

Atlassian OnDemand Launching with Flowdock Built In

Mikael Roos October 26th, 2011

Atlassian’s issue and project tracking tool, JIRA, has one of the most popular Flowdock integrations. Flowdock adds real-time internal discussions to JIRA and turns actions in tickets into parts of the ongoing conversation in Flowdock.

Here’s a quick 45-second video showcasing the integration.

Flowdock also has integrations to other Atlassian’s tools such as Confluence and Bitbucket.

Atlassian OnDemand

Atlassian is now launching Atlassian OnDemand. They’re moving their entire product suite to the cloud. Whether you’re looking for hosted issue tracking, agile planning, an enterprise wiki, or source control, they’ve got you covered. Atlassian OnDemand features fully-integrated cloud-based versions of all their most popular development tools to help take you from concept to launch.

Flowdock integration for JIRA is built-in in Atlassian OnDemand. Just sign up to Atlassian OnDemand and follow these instructions.

Google Apps Integration On Both Sides

Atlassian OnDemand also adds Google Apps integration to Atlassian’s products. Amongst the integration features is logging in with your Google Apps account. Since Flowdock already has the support for it, you can get true single sing-on for all three services.

» Check out the brand new Atlassian OnDemand

Major Redesign for General Improvement

Mikael Roos September 27th, 2011

At Flowdock, we’ve been mulling over user experiences and interface quite a bit lately. A while back, you might have spotted an experiment we did and wrote about in a blog post to remove the dashboard. Well, just now you might have noticed something else. Like the dashboard gone. Yup, we removed it.

Where are the user list and the mentions?!

Check out the top right corner of your screen. There’s a people icon. Click it and you’ll see the user list. The same dropdown now holds your status, and the editing controls for it.

Next, check out the little speech bubble icon. Click it, and you’ll see the mentions list. A badge bubble will emerge when there are unread stuff in there.

So, what’s new then?

Well, we added a third dropdown. All the way in the topmost, rightmost corner, we have the flows dropdown to give you quick access to your other flows. We still recommend you keep all the different flows you actively use open in different tabs at all times. We’re working on a better UI for using several flows at once.

More! We Need More!

Well, we also added full-screen chat. It’s actually pretty cool. When you resize the window narrower and narrower, the chat finally snaps into full-screen mode and the left side collapses. The same thing happens if you drag the chat wide from the middle separator. When widening the window or narrowing the chat, the left side expands. Snappity-snap!

<< Click to enlarge

One more! Please!

Well, we did add color-coding to the speech bubbles which are show in the chat when commenting on Team Inbox items. The colors are coded to the individual Team Inbox items, so it’s much easier to keep track on multiple “threads” of conversation.

That’s it! Let us know how we did in the comments, or via .

Flowdock API Out Now!

Mikael Roos August 11th, 2011

Two awesome things are going on at Flowdock today. Number one, we are about to launch a new front page with a new no-BS message: Flowdock – Team Inbox With Chat. The other thing is the Flowdock API. Flowdock thrives on integrations to other tools that the team is using. That’s why we are now launching the Flowdock API.

Version 1!

In the first version we start with a simple API enabling posting new items to Flowdock’s Team Inbox (previously called Influx). » See the API Docs

We’ve also wrapped up a Ruby Gem to get you going in just seconds if Ruby is your choice of language. » Check out the Ruby Gem and install it

Example 1: Custom Feedback Form

Here’s a quick example to get you going. Getting user feedback directly to Flowdock is great. You can talk it over quickly with your team and decide what to do.

This Sinatra app shows a feedback form and sends the feedback to your Flowdock flow using the Flowdock API Ruby Gem.

The view:

The Sinatra controller:

Example 2: FogBugz integration (no coding required!)

The Flowdock Influx API is perfect for use with any service which has web hook / url trigger functionality, such as FogBugz.

Simply by configuring the URL Triggers plugin in Fogbugz (means filling out one form), you can get nicely formatted notifications to Flowdock. We’ve created example instructions for FogBugz Cases, but you can get notifications from wiki changes etc by adding small modifications and creating new triggers.

» Check out the instructions

Example 3: Deployment notifications

Check out our new awesome deployment notification scripts using the Flowdock API.

If you implement an integration using the Flowdock API, let us know, and we’ll spread the good word!

Version 2?

What would you like to see in the Flowdock API? Here’s a few initial ideas:

  • bots! (Check out the awesome Flowdock bot implementation by the guys at MyNewsDesk).
  • fetching messages by tag – slideshow of latest #sketches ?
  • Fetching influx messages
  • Jabber integration to use Flowdock with other chat clients (See this idea/discussion in our UserVoice)

Let us know what you think via UserVoice or in the comments.

Experiment: Get Rid of the Dashboard!

Mikael Roos July 29th, 2011

Disclaimer: We have recently decided to dedicate more time for experimentation at Flowdock. This is the first big experiment.

The bottom line is, Flowdock is a team inbox (Influx) with chat. And awesome tagging mechanisms and super-fast search. That got us thinking. Why is it that a dashboard with relatively little content is the first thing users see when we have other more important things to show, like Infux? So we thought, let’s get rid of the dashboard!

» See the entire screen

The dashboard contains elements that are essential for Flowdock users. We need to come up with new places for those functionalities.

  1. Recognizability – We use the name of the flow and company as the title of the Dashboard. Even without this experiment, we need to improve the recognizability of the flows, maybe let users add an icon for each flow and show that in the UI as well as use it as a favicon (shown as the browser tab’s icon). We decided to add a drop-down to the chat header which would take you to other flows. When not selected, it could show the name of the flow.
  2. Messages for you – The Dashboard lists any messages where someone mentioned your name or added your @username tag. That’s vital information so we need to add it somewhere. We decided to go with a Facebook/Google+ style message dropdown and add it above the chat.
  3. User list – The user list needs to be moved as well. We had lengthy discussions wether it’s a must to be able to see the list all the time. The answer we got to was no. We’ll bundle it up with the notifications

Also, we sometimes show system notifications on the Dashboard. Things like, “Install the Google Chrome app” and other stuff. We decided to bundle it up with the new messages dropdown.

One more thing we had to consider was that the Dashboard icon contains the Flowdock logo which gives the whole UI a distinctive Flowdock look. We should either keep the logo there and make sure no one mistakes it for an app icon or just drop it and try to maybe use it in another part of the UI.

The Result

The first sketches showed real promise. We were happy to see the Dashboard gone. There was some massive refactorings required to get the user list and notifications functionalities extracted from the dashboard and into the chat. We worked hard!

Here you can see what we ended up with showing the same elements 1-3 as above. It’s still kind of rough around the edges, but we’re pretty happy with the results of this 1-day dev excercise!

This way the user can focus better on what’s going on by generally always keeping Influx open. We’ll add badges and other visual cues to the new icons to show you how many new notifications you have, how many people are online at the moment etc. The flows dropdown will give you direct access to the Account page as well as logging out.

Looking For Feedback

What do you think? How do you feel about the departure of the Dashboard? Let us know in the comments, via Twitter or . We need your opinions!

Designing a Better First-Time UX at Flowdock

Anni Rautio July 12th, 2011
Using a new product for the first time is not always a bliss. For us at Flowdock the flow has become a way of life. We eat our on dog food, and love it, but sometimes we can get blinded by our own user experience. On the flip side, feedback is another thing we love. We’ve received lots of it, but now we’re hungry for more. First-timers, we need your help! We want the first-time user experience in Flowdock to be as seamless as possible. During this sprint, 90% of our team effort focuses on creating a happier first-time user experience. We call this the FUX.

We aim for a blink-of-an-eye, harmonious FUX-experience by:

  • clearly communicating “what Flowdock really is”, and
  • designing the flow in a way that makes a FUXie say: “this tool is very intuitive and easy to understand”

And all this, in just a blink. If you sign up to Flowdock today, this is how it looks like:

Admittedly, not very clear nor intuitive. We need your advice! Whether you’re a pro or a new-comer on Flowdock, or just want to contribute, let us know how we could improve the FUX -experience.

  1. What instructions were missing the first time you entered your flow?
  2. What was made difficult to understand?
  3. Was it easy to get your team mates on board?
  4. Why would you (or not) recommend Flowdock for other teams to use?

Simply: what would make you say “Flowdock is very easy to use”?

Help us make Flowdock better: you can comment below, or email us at .

Rails 3.1 Asset Pipeline in the Real World

Ville Lautanala June 14th, 2011

The new asset pipeline is the single most important new feature in Rails 3.1. DHH used most of his keynote at RailsConf 2011 to explain its new features. In this blog post, I’ll go through its implications to an existing application and explain how we integrated it to our workflow at Flowdock.

The Rails 3.1 asset pipeline integrates well with CDNs like Amazon’s CloudFront: just point your distribution to your web server. Most likely, you won’t need your old hacks for assets.

What’s new

The new asset pipeline in Rails 3.1 makes assets first class citizens in Rails. Assets are moved from public directory under apps/assets and they receive much more attention from Rails. Asset files can inline other asset files using requires and gem dependencies can provide asset files for the application to use.

This means that you don’t have to include jquery.js to your repository. Generators don’t have to worry about creating proper static assets under your public folder. Assets from other sources work just like those which are under your app/assets folder.

The static asset URL scheme has changed. Compiled assets are served under /assets. In production mode, generated files include an MD5 hash as part of the file name, which is a better cache buster than the previous timestamp scheme. Asset pipeline also generates URLs inside stylesheets so that they can link to generated files.

A stylesheet stored at app/assets/application.css will be served as /assets/application.css. Most likely, this layout will contain dependency declarations such as inclusion of CSS reset. Thus, your new application.css would become

/*
 *= require blueprint/reset
 *= require blueprint/typography
 */

body {
  background: url(<%= asset_path "sunshine-rainbows-and-lollipops.png" %>);
  /* You have to use ERB to link to asset pipelined resource */
}
/* Rest of stylesheet */

At the heart of the pipeline is Sprockets 2.0. In addition to dependency management, Sprockets will allow any number of filters to be used with asset files. By adding extensions to the files names one can control which filters are used. For example, it is possible to run a file through SASS and ERB by naming it stylesheet.css.scss.erb. JS files can also be filtered using both CoffeeScript and ERB.

Among the more controversial changes, CoffeeScript and SASS are now included in the default template. It is possible to use both CoffeeScript and SASS with old style assets. Not much has changed in this respect, DHH just is more vocal about what you should use.

Deal with it

Additionally, support for JS minification comes built-in with Rails. The default is to use UglifyJS via the Uglifier gem. Existing apps can use this by adding it in their Gemfile and setting the minificator in the (production) environment configuration.

Gemfile:

gem "uglifier"

config/enfironments/production.rb:

config.assets.js_compressor  = :uglifier

Upgrading existing application

Running rake rails:update will show how your configuration files should be updated for them to work with new asset pipeline. At a bare minimum, you’ll only need to add

config.assets.enabled = true

to your application.rb. After that stylesheets, javascripts and images can be moved under app/assets.

There are a few things to change to make your assets work. All absolute paths to images in stylesheets and asset helpers are broken and should be replaced with call to relative helpers, e.g. image_path /images/subdir/rails.png should be asset_path "subdir/rails.png". This way Sprockets will be able to figure out where the asset is served. It is especially neat in production where file names will have MD5 hash suffix for more efficient caching.

You’ll also want to put this to your .gitignore file:

.sass-cache/
public/assets/

Serving assets in production

Serving assets in production environment is much more pleasant with the new pipeline. First of all, instead of a timestamp, an MD5 hash is used to bust caches. Second, this is not part of the query string but used as suffix in file name. These MD5 suffixed files really exist and you can have multiple versions coexist at the same time.

Because the URIs are unique not only by query string but also file name, CloudFront can be easily used to serve your assets. Create a new custom origin distribution with your host as origin DNS and use the CloudFront domain as your asset hosts. That’s really all you need barring some web server configuration: check CloudFront custom origin best practices.

One thing to notice is that the assets should be precompiled before your site goes live to reduce load. There is a rake task for this, @rake assets:precompile@. We put this in our deploy.rb:

before :"deploy:symlink", :"deploy:assets";

desc "Compile asets"
task :assets do
  run "cd #{release_path}; RAILS_ENV=#{rails_env} bundle exec rake assets:precompile"
end

If you have multiple CSS and JS files, you might have to specify manually which of them are precompiled by adding them to the config.assets.precompile array.

Compiling your assets require that you have a JS runtime available if you use either CoffeeScript or Uglifier. We use therubyracer, but your mileage may vary. Installing node.js is also a good alternative.

Retrospective

Is this really better than the old setup? Did we learn anything?

First, the development and production setups are now more similar. Previously multiple JS files containing our application code were loaded in development, but now they’re concatenated to one big file. We are more likely to run into weird bugs before code is deployed to QA, but on the other hand line numbers aren’t meaningful for debugging purposes. When using CoffeeScript, this point is moot.

Second, we are happy that we could remove our old hacks to get Flowdock deployed. Instead of the combination of patched cloudfront_asset_host gem and some other hacks, we can compile our assets to be served via CloudFront using the built-in rake task.

Third, our deployment times were reduced by over a minute as we don’t need to sync our asset files with the S3 bucket.