Monday, June 13, 2016

Microsoft Flow: Meet the New Face of Workflow

Flow is one of Microsoft's newest products. If you have an Office 365 license, you should be very interested in Flow as it has a lot of both power and potential. In this post, I'll go through what Flow can do for you, explore what's cool, and what can be improved.

As a SharePoint consultant, I'm often faced with integrating different systems. "How can I get data from X into Y?", "I wish I knew when Z happens." To solve these problems, more often than not I use workflow. SharePoint has some decent workflow capabilities, but the native workflow engine is limited and Microsoft has discontinued support for SharePoint Designer. This means to accomplish the functionality I rely on using a third-party solution - especially if you want to move data between systems. While third-party solutions are incredibly robust and have great user communities, it is an additional cost to clients.

Because it's part of Office 365, Flow is included in the cost of an O365 license. With its different system integrations and pretty user interface, Flow arrives at an interesting time. With more and more systems being able to talk to each other, Flow looks to bring automation found in your personal life into your work life.

It’s impossible to talk about Flow without talking about If This Then That (IFTTT). IFTTT is a web-based service that has been around since 2011 that allows users to create recipes based on triggers of certain channels. For example, if my channel is Facebook and Google Drive, my recipe is as follows: "When I'm Tagged in a Photo on Facebook, upload the photo to my Google Drive." I wouldn't write the recipe textually, but with IFTTT it’s almost as easy as writing a sentence. Instead, I would create the recipe using IFTTT's gorgeous and intuitive UI. No code necessary, just a Facebook account and a Google account.

They say imitation sincerest form of flattery, and IFTT should be flattered that Flow is very similar to IFTTT. However what Flow brings to the table is a different variety of channels (known in Flow as "Services"). Flow has the usual suspects: RSS, Google Drive, Facebook, Salesforce, and Slack – just to name a few – but Flow also has SQL, Yammer, Twitter, web requests, and every app in Office 365. So while IFTTT may be great for automating your personal life, Flow is geared for automating your work. And it's not just limited to "if this happens, then do this”; Flow has recursion, recurrence, and conditionality.

Flow has lots of templates to help you get started. The templates are grouped into four categories - get notifications, synchronize files, organize data, and automate approvals. The templates allow users to quickly build their own flow by filling in a few parameters.

Here is a template that sends an email when a file is created in SharePoint.

clip_image002

Templates can be easily augmented and customized in the browser. The editing experience is decent, but some of the parameter descriptions are vague.

clip_image004

If this is meant to empower power users, I think they'll struggle trying to identify the Folder ID. However, it is still pretty easy to follow.

One thing I really like is My Flows. My Flows is where you can view all your flows. You can turn flows on and off, edit, and delete them. Additionally, you can troubleshoot them on an instance by instance basis.

clip_image006

When you click on the 'i' icon you can see each instance of a flow. You can filter to see checks, successes and failures.

Here you can see that my flow has several instances that skipped (aka it didn't run because the criteria wasn't met), and one instance that ran two minutes ago was successful.

clip_image008

Although I can’t find a definition for what a “check” is, it appears it’s when the flow runs and is skipped. I think in addition to it checking if a criterion is met, it also validates that the credentials used for the services and the services themselves are valid and online respectively.

Upon clicking on each instance, you can click on the actions and get deeper into flow. Clicking each action displays the JSON for each action. Here's one that worked. Note the green check box in the right-hand corner letting us know everything is ok.

image

Here's one that failed. Note the red circle in the right-hand corner letting us know everything is not ok. Also, in the Outputs section the Body lets us know what the real error is.

clip_image012

Also if you're nostalgic for SharePoint Designer's cryptic and worthless errors, there's still a few of those.

clip_image014

You can find more about debugging your flows here.

Overall this is pretty cool stuff. I like how you can drill down into the errors. It's got the high-level messages for end users, but the more verbose errors for developers. As a developer, especially one who has done a lot of workflows in my time, the verbosity here is long overdue and is much appreciated. Sayonara logging to the workflow history list!

But that's not all. Flow also integrates with PowerApps. PowerApps allows users to build light-weight applications using the PowerApps client application. The only difference is that in for a flow to be used in PowerApps, the event that starts a flow is "when a control is selected." These flows can be built on either https://flow.microsoft.com or https://web.powerapps.com/. It would be great if the experience were a little more seamless; I'd love to create a flow and a PowerApp without having to juggle tabs and apps.

image

Want more? You can build Custom APIs too. If you can’t find the service that you want to use, you can create and share an API. Super cool stuff.

I know Flow is in preview, but it has some areas to improve in.

One thing I want to call out is that Flow is not forgiving in terms of version control; there's no undo button or version history. It would be great to have some sort of version control. So tread lightly when making changes to an existing flow.

The other thing I'm not sure about is the gallery in regards to reusing flows that pertain to my company. It would be neat if we can tailor flows available to users in the gallery to be ones created in my tenant. This is similar to the app store model with on-premise SharePoint.

Flow doesn't seem to be a full-fledged SharePoint workflow replacement, but the capabilities are there and I think they're only going to grow. What I mean is that there isn't an action for "Create SharePoint Subsite" or "Inherit Permissions." But with SharePoint's API improving on what seems like a daily basis, a savvy developer can accomplish almost anything via the API action in Flow.

Another caveat is that Flow does not work with on-premise SharePoint. Hybrid scenarios are more common than not amongst our clients. Considering that the third-party workflow products allow can integrate between on-premise and Office 365, this would be really nice to have.

Lastly, like I said earlier I there could be some UX tweaks to Flow. I know it's really a pretty UI that calls APIs behind the scenes, but there's a decent learning curve for users. Again, I know it's in preview, but the learning curve is going to remain because it's not well documented. I know not every service will have good documentation, but you think that there would be a Flow-specific library (aka not TechNet) about how to interact with Office 365 services. However Flow’s blog is pretty active so stay tuned for the latest and greatest.

Minor gripes aside, I think Flow is a step in the right direction. There has been a lot of uncertainty with the news of SharePoint Designer's retirement. Flow alleviates some of the uncertainty. It's not a full fledged SPD replacement, as SPD did more than just workflow, it's workflow-as-a-service for end users. In today's workplace there are so many different services that employees use on a daily basis. It doesn't matter if you're working in Salesforce, Slack, Instagram, or Azure, Flow and the Office 365 product stack can help bridge and integrate those disparate apps and make your life easier.