This guide will show how to integrate K2 Workflow to Microsoft Flow. If you are reading this, then you already decided that there is a good business scenario for starting an MS Flow from K2 Workflow. For a more detail discussion on how the two products complement each other go here https://www.k2.com/blog/event-driven-process-automation-k2-microsoft-flow.
K2 Rest Service Instance
K2 provides a method to define a REST service call as a service instance and then generate a SmartObject to execute the REST calls. You can find more information about REST Service Type here.
Step by step instructions
The sample application shown below simulates a completed sales opportunity in a K2 Workflow. The opportunity details are sent to MS Flow to notify the person responsible for it. In a real business solution, this MS Flow will probably start a line-of-business sales and ordering system.
Step1: Design your MS Flow
First, we need to define the MS Flow. This flow will get the weather from MSN, pass it to K2 Workflow, get a response back and then complete the K2 Workflow.
- Create a new MS Flow from blank
- Give it a name (e.g. Start MS Flow from K2)
- Click on “Skip” button – you don’t need a trigger
Resources:
- K2 Workflow Vs. MS Flow: https://www.k2.com/blog/event-driven-process-automation-k2-microsoft-flow.
- REST Service Type: https://help.k2.com/onlinehelp/k2blackpearl/userguide/4.7/default.htm#ServiceBrokers/EndPoints/REST_Endpoint.htm
- Create your own swagger file: https://help.k2.com/onlinehelp/k2five/userguide/current/Content/How-Tos/WorkflowRESTAPI/3images/Swagger%20-%20Microsoft%20Flow.json
- REST Swagger File Format Reference: https://help.k2.com/onlinehelp/k2five/userguide/current/Content/ServiceBrokers/EndPoints/REST_SwaggerFileReferenceFormat.htm
- Test the generated Post URL using postman: https://help.k2.com/kb002838.
- Sample Swagger JSON file : https://dl.dropboxusercontent.com/s/1uj5tvi8x4l7u30/Swagger_Microsoft_Flow_Sample.json.
- MS Flow K2 connector documentation: https://docs.microsoft.com/en-us/connectors/k2workflow/.