You can call the K2 Workflow REST API from Microsoft Power Automate to build custom flows that take advantage of both platforms. Microsoft Power Automate provides triggers from and connections to Microsoft 365 applications and services. Combining those with K2 workflows allows you to, for example, post a message to your Microsoft Teams group, or start a workflow when a SharePoint list item is created, or redirect a K2 task when an email arrives in an Outlook folder.
Use this article to learn how to create a custom connection from Microsoft Power Automate to the K2 Workflow REST API that uses OAuth for authorization. At the end of this article, there is a list of available workflow actions defined by the API to help you understand the workflow actions you can use when integrating with Microsoft Power Automate, and links to How-To articles describing different integration scenarios.
To add a connection from Microsoft Power Automate to K2 and access the K2 workflow actions, you must:
Use the following steps to configure a K2 Workflow REST API custom connection with OAuth.
The following actions are available on the K2 Workflow REST API endpoint and described below the image in three parts: Tasks, Server Events, and Workflows:
You can use Microsoft Power Automate to action and manage K2 tasks. Integration with a task requires its unique serial number. For example, when using an Outlook trigger, you can configure the subject of the task notification in your workflow definition to send the serial number to Microsoft Power Automate. When creating your task notification, use the task SerialNumber field from the Workflow Context Browser in a Replace function to remove the SN= portion of the serial number context as a flow only needs the number. See How to: Use the K2 Workflow REST Feed with Microsoft Power Automate to Redirect a K2 Task for an example of redirecting a task.
The following task-related actions are available:
The POST task actions (redirect, sleep, release, wake, assign, and action) have default and further HTTP Status options. See Workflow REST API: Tasks for more information.
You can use server events to interact with a K2 workflow step. Configure your flow to wait for the workflow step server event which sends a JSON string. Use the information from the JSON string to perform other flow tasks, and when they are complete, use the Finish Server Event to notify K2 that the workflow step is complete and the K2 workflow can continue. See How to: Use the K2 Workflow REST API Server Events in Microsoft Power Automate for examples of using server events.
The following server event actions are available:
You can start a K2 workflow from Microsoft Power Automate. See How to: Use the K2 Workflow REST Feed with Microsoft Power Automate to Start a Workflow for examples of using SharePoint and Outlook triggers to start a workflow.
The following workflow actions are available: