Microsoft Teams provides you with a convenient way to collaborate and stay informed with the all the content your team members generate. Having access to your SharePoint document libraries and a number of other services make it easy to view and update documents. You can also use tabs to bring in content from other cloud services and connectors inform you about certain events that are taking place. I am a heavy user of workflows and one gap I find is to easily know where my workflows are at. To find out, I need to either send emails from the workflow engine or go to a specific place to determine at which step the workflow is at, such as the SharePoint Workflow Task page or the Flow information page.
If you’re using Teams, then there’s a better way now to have workflow updates delivered directly to a channel conversation feed. To achieve this, all you need is to add a webhook to a channel and then send notifications to that webhook with update information. Ryan Schouten gave a good overview on how to post message from PowerApps to a channel in his article, Post to Microsoft Team from Flow. In the example below, I focus more on the workflow itself and getting the necessary notifications to determine whether a workflow is stuck or I need to intervene for some reason. Here are the steps I followed:
Creating the Channel
Although it’s not mandatory to create a separate channel, I prefer to do so for workflow updates as you will get many such updates and they can quickly flood your channel. Be specific with the name so other users of the team understand the purpose and don’t inadvertently post messages in that channel, hoping to get an answer from someone.
Select your Microsoft Team
From the ellipsis menu, select Add channel
Provide a unique channel name and click Add
Within a few moments the channel will be ready to be used.
Setting up a Webhook
After creating the channel, you need to and add a WebHook Connector. Once it’s created, it will give you the URL.
Select the channel you just created
From the ellipsis menu, select Connectors
A list of connectors will appear. From the list, select Incoming WebHook
Provide a name and optional icon for the web hook notifications
Click Create to create a webhook connector for your channel.
At the bottom of the screen, you will see a URL appear. Copy it as you will require to use it for the Flows that are posting to it.
At this point, all your work is done in Teams. Via this webhook URL, the Team channel will be able to receive updates from any service that will provide it with a message. The webhook URL is public, which allows other services to post to it anonymously, even from outside of your Office 365 tenant!
Add HTTP Webhooks to your Workflow
Now you can create webhooks to your Flows or any other service and post messages to the channel. Below is an example of notifications being sent to the Flow Notifications channel on documents that are getting uploaded to OneDrive and are either approved or rejected. You can read how to build this Flow in my article on Using Webhooks to keep up with your Flows.
After setting up the webhook to post to the channel, you will see the notifications come in. You can use the Actionable message card reference to spice up how your messages will look.
The process works great. However, one limitation today is that it is not possible to post replies to a card. This means that each post becomes its own conversation. It would be nice to keep all the updates for a single workflow execution in the same conversation thread. If you agree, please vote on Uservoice