Skip to Content
Author's profile photo Murali Shanmugham

Model your workflow scenarios in the Cloud

In this blog, I wanted to give a walk through of the new Workflow service on SAP Cloud Platform. This was one of the most awaited services on the Platform and no surprise, there was lot of excitement when the service was announced GA last month. I had lot of people ask questions on the capability and feature set of this service. Hence, I have tried to capture some screenshots and explain briefly some of the key functionalities.

The need for a Workflow Service in the Cloud Platform

The Cloud Platform is positioned as an Innovation platform where customers can build brand new apps or extend existing systems – be it on-premise or in the cloud.

There are several scenarios where customers build brand new applications on the Cloud Platform which only rely on the database and UX services provided by the platform. Automating tasks in such scenarios can be challenging. One of the scenarios I hear frequently, is the need to expose a portal to suppliers and have an approval mechanism to commit the updates they make using the Apps hosted on the supplier portal.

To give another example, assume there is a bank looking to rollout a mobile application for their customers to request for a loan.  Generally, the mobile app would trigger the APIs directly in the backend banking system. The logic behind the calculation of credit score, auto approval of loan, UI of approval tasks etc would be embedded within the core banking system. This would work, however, this leave lot of custom development within the core banking system and will impact the maintenance of the system overall.

With the Workflow service, we could redefine the same as shown below

Step 1: Retrieves customer details through APIs which are already exposed form the backend system.

Step 2: Calculate the credit score rating which could be maintained in Business Rule Service

Step 3: If credit score is not so great, customer relationship manager gets to review the request and can either decline the request (step 5) or approve the request (step 6) and the relevant business records get created in the backend system using exposed APIs

Step 4: If credit score is great, auto approval process trigger the update of relevant business records in the backend system using exposed APIs.

Hence, in this process there is only a need to ensure that there are APIs which are available to expose customer details and loan origination.

The workflow service is not only limited to brand new Cloud Platform apps or on-premise systems. This could also be used to extend processes in other Cloud solution. Assume, there is one level approval step which comes as a default in a Cloud solution like Field Glass. Using the exposed APIs, it’s now possible to change the approval process to a multi-step process. After the first level of approval, all the remaining level of approvals can be done using the Workflow service on the Cloud Platform.

The Workflow service is already tightly integrated with the Cloud Platform’s integration services. There are APIs already available to perform things like invoking the Workflow service, retrieving tasks details etc. There is detailed blog which shows how to trigger workflows from Integration services by Archana Shukla

Prerequisites

As a perquisite, you would need SAP Cloud Platform Portal service. This provides the Fiori Launchpad where all the approval and monitoring applications will run.

Once you subscribe to the workflow service, you will get a set of Fiori Apps which would allow the administration, monitoring of the Workflows as well as an App for end users to action the tasks.

 

Workflow Editor

When you launch the Workflow service, you will notice a BPMN based web editor which can be used for modelling your scenario. There are four sections. If you have used Cloud Platform Process Integration service, you will be able to find lot of similarities.

(1) The BPMN palette contain the list of objects which you can use to model your scenario

(2) The Properties section list the related properties of each object which you use in the scenario

(3) You can use the save option to download the metadata of the Workflow model or deploy it to the Cloud Platform. Once you deploy the workflow, it will be available in the Fiori App “Monitor Workflow Definitions”.

(4) Canvas where you would model the workflow scenario.

Let’s take a closer look at the key objects which are available to model a workflow.

Events:

These below events are supported by the Workflow service. As the name indicates, the Start and End events mark the beginning and end of the Workflow.

User Task:

A user task is to be used when you want a user to perform an action during the workflow scenario. Notice there are several sections in the properties editor. You can configure the text to be displayed for the task in the My Inbox App. You can also define who the recipients are for this particular task and finally in the user Interface section, you can refer to SAPUI5 components which will provide the UI for the task within the My Inbox App. These SAPUI5 apps need to be deployed in the Cloud Platform.

Service Task:

A Service task is to be used when you want the system to perform some tasks. This would ideally be APIs which would be invoked to either cloud or on-premise solutions. When invoking APIs exposed from on-premise systems, the Cloud Connector can be leveraged. In the below example, SM2 is the backend system which I have configured as destination in SAP Cloud Platform cockpit and this service task invokes an API to retrieve a customer detail. Supported REST operations are GET/POST/PUT/DELETE.

Script Task:

A script task is to be used when you want the system to execute a script based. This could be used to process an input from the workflow context and store the output as a variable which could be used in the following steps. You can use Java script to read and modify context variables of the Workflow service.

Clicking on “Open Script” take you to another screen where you will use insert your scripts.

To know more about how to use read and set the workflow context, you can look at these examples in SAP Help.

Gateways:

Gateways are used in the workflow service to control the flow of execution. An Exclusive gateway is used to model a decision whereas parallel gateways are used to either split the flow into multiple paths or merge multiple incoming paths. There are options to use expressions in order to define

Workflow Apps

As I mentioned earlier, once you subscribe to the Workflow service, your account will automatically get provisioned with the below Fiori Apps. You should be able to find them in the catalog and add them your Launchpad.

My Inbox:

You probably know the My Inbox App which has been available on the Cloud Platform for a while. The Workflow service uses the same My Inbox App for end users to actions their workflow items. You would need to develop the UI for each of your tasks as UI5 components and these UIs would be displayed within the My Inbox App when the user selects the relevant task.

Monitor Workflow Definition

Unlike My Inbox, this Fiori App is meant for Administrators. It can be used to view all the deployed workflow scenarios. An administrator can view all the instances of a particular workflow and also start a new instance by providing a JSON payload. There is also an option to download the metadata of the workflow model which can be imported into the Workflow editor to view the model

Monitor Workflow Instance

This is another Fiori App meant for administrators to view all the workflow instances. If a particular workflow instance has gone into error, the administrator can view the error details from within the App.

 

I hope this blog gave you an overview of the capability of the service. The workflow service is for sure going to add more flexibility to the cloud platform allowing customers to automate some of their processes and thereby differentiate themselves.

Please bookmark the SAP Help documentation for the Workflow Serivce which would get updated with new features added during the bi-weekly updates.

Assigned Tags

      37 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mike Doyle
      Mike Doyle

      Great blog Murali, thanks for sharing.  I think this workflow service is going to be a 'killer app' for SCP.  It seems so obvious to run the workflow on SCP as a way to co-ordinate processes across disparate cloud and on-prem systems.  The integration with MyInbox and UI5 apps is nice too.  I never got the chance to develop workflows in R/3 or ECC so hopefully soon I will get a chance to do something similar on Cloud Platform.

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Thanks Mike. Yes, I agree. The Workflow service will start to play a key role in co-coordinating processes in cloud. It should be easy to start building workflow scenarios as you can leverage on SAPUI5 skills to build the UIs for tasks and use the modeler to design the flow.

      Author's profile photo Sukanta Rudra
      Sukanta Rudra

      Hi,

      Nice update with features. However my free Cloud account till yesterday did not show up any service for workflow. Today I see the service, but nothing can be done except for viewing the document (screen capture). Is not not released for folks using free Cloud account? Note: I have been using my free account for last two years and have never had any issues.

      Thanks - Sukanta Rudra

       

      Author's profile photo Sukanta Rudra
      Sukanta Rudra

       

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      This is the confusion few people are having. You need click on "Home" and then select "Europe(trial") from data centers. This will get you back to the same trial instance which you were using for the last 2 years.

      Author's profile photo Christian Loos
      Christian Loos

      Hi Sukanta,

       

      the Workflow service is not yet available in the free developer edition (Trial), but only in productive accounts.

      We are planning to make it available in Trial by end of Q2.

       

      Regards,

      Christian

      Author's profile photo Raj Govender
      Raj Govender

      Nice blog Murali! Looking forward to playing with this.

      Author's profile photo Peter Chezowitch
      Peter Chezowitch

      Thank you for this introduction. What is the strategic purpose for workflow service? Is it rather replacing abap workflow in the s4 world and if so, is it Targeting both, cloud and on premise Installations or is it rather a cloud replacement of the BPM part of process orchestration? Also: will there be a tighter integration with integration service similar to the xi protocol?

      final question: is it already available for partners?

      Author's profile photo Christian Loos
      Christian Loos

      Hi Peter,

      • The Workflow service is not intended to replace either Business Workflow (ABAP) or BPM/Process Orchestration. All three solutions will continue to exist and will also be enhanced further. In simple terms, Business Workflow drives standard business processes in S/4HANA (e.g. Purchase Requestion Approvals), while differentiating/custom processes (also cross-system) can be implemented and managed either on-premise (Process Orchestration) or on the SAP Cloud Platform (Workflow service). See this SAPInsider article for a full overview of all three solutions.
      • Yes, we plan to have a tighter integration with the SAP Cloud Platform Integration service in the future, e.g. by directly looking up available integration flows from the workflow editor or by providing end-to-end monitoring across workflows and integration messages.
      • Yes, the service is available to partners for development/testing/demo purposes as part of the Innovation Pack for SAP CP.
        We are currently finalizing the commercial models for embedding the service in a partner application.

      Regards,

      Christian

      Author's profile photo Peter Chezowitch
      Peter Chezowitch

      Hi Christian,

      Thank you for your response and the interesting SAPInsider article.

      Regarding installation of  workflow services as part of the innovation pack:

      Where would I find a manual how to activate the service? I have looked up the documentation, but there it is just mentioning to "enable" the service which is not available in our tenant despite having the innovation pack license.

      Author's profile photo Christian Loos
      Christian Loos

      Hi Peter,

      the "Enable" button should automatically show up in your cockpit, if you have a valid license.

      We had a few cases where the license check was missing a few cases, but those should be fixed now.

      If it still doesn't show up, please create a support ticket on component LOD-BPM-WFS.

      Regards,

      Christian

       

      Author's profile photo Vladimir Savchenko
      Vladimir Savchenko

      Hi Murali,

       

      I have a question regarding the User Task. Sorry for asking here, but i couldn't find the answer in the SAP Documentation and i can't get it working.

      In the list of users for the USER Task, i need to add some user ids. But what are those? I login to my idp with an e-mail, and upon trying to add an email - it rejects it and says that @ is not allowed.

      I assume i am missing some core knowledge to get it running but so far i cannot solve it 🙁

       

      Regards, Vladimir

      Author's profile photo Former Member
      Former Member

      Hi Vladimir,

       

      In that field you need to give the SUser or PUser id of the members who will be acting as a RECIPIENT. You can make multiple recipients by providing the values separated by ','(comma).

      e.g.: - p123456,s8950348.

      Author's profile photo Deeksha R
      Deeksha R

      Hi Vladimir,

      Thank you for the comment. We have added a note in the user task configuration that says

      " To provide multiple recipients to process the task, separate each unique ID with a comma."

      Do you suggest that this information would suffice or that some more information is required additionally?

      Author's profile photo Former Member
      Former Member

      Hi Murali,

      Thank a lot for the informative blog.

      I have a question regarding the Start Event. I am unable to figure out the option, where can I set a condition to start event which will automatically trigger the workflow?

      I understand we can do it manually from Workflow Tile using Start new Instance feature, but I would like to get the automatic triggering of workflow using Event condition.

      I am new to HCP Workflow concept, so please bear with my silly question.

      Regards,

      Arpit

      Author's profile photo Sitakant Tripathy
      Sitakant Tripathy

      Hi Murali,

      thanks for introducing to workflows on SCP.

      a silly question please, where can I see all the metadata around context variables like $.info and $.context. Am just relating back to workflows in ABAP stack where you could clearly see the container variables

      Regards,

      Sitakant.

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Sitakant,

      Thanks. There is never a silly question.  Context variables are documented here

      Creating and Reading Workflow Context Structures

      https://help.sap.com/viewer/f63bbdc234ce4211ab2cdb44564a0acd/Cloud/en-US/d633ecfc347c4c0ba9471fb2c9dcd0fc.html

      Accessing Contextual Information During Execution of Script Tasks

      https://help.sap.com/viewer/f63bbdc234ce4211ab2cdb44564a0acd/Cloud/en-US/e6c27b9cc7544497b9eae7b0c0dd53f7.html

       

      Author's profile photo Francisco Delvalle
      Francisco Delvalle

      Hi, just one question: Should it work with SAP Hybris? Mainly, C4C in order to extend the workflow functionality?

      Thank you!

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Franciso, It should be able to work with any SaaS solution as long as APIs are exposed for the workflows to interact with.

      Author's profile photo Raghavendra H K
      Raghavendra H K

      Hi, Is multiple level of approval possible in workflow services?

       

      Regards,

      Raghavendra H K

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Raghavendra, You can achieve multiple level of approvals by modeling your workflow with several "User Tasks".

       

      Author's profile photo Jing Biscocho
      Jing Biscocho

      Hi Murali,

       

      Nice Blog ... very helpful ... have you tried consuming OData service from OData provisioning? We are facing challenges in creating a test workflow with this scenario.

       

      Regards,

      Jing

      Author's profile photo Emiliano Prigue
      Emiliano Prigue

      Hi Jing, we are faceing some problems when we try to consume OData Service form OData Provisioning too. Did you find a way to do it?

      Murali, do you have any insights regarding this?

       

      Thanks,

      Emiliano

      Author's profile photo Jing Biscocho
      Jing Biscocho

      Hi Emiliano,

       

      Looks like only NONE and BASIC AUTHENTICATION is supported at this point. This is based on the answer from SAP in this blog:

      https://blogs.sap.com/2017/06/08/consume-sap-gateway-odata-service-in-sap-cloud-platform-workflow/comment-page-1/#comment-395773

      This will not work with OData Provisioning. We're waiting for SAP to address this.

       

      Regards,

      Jing

      Author's profile photo Ankush Singh
      Ankush Singh

      Hi Murli,

      Thanks for the blog. Is it possible to convert old SAP workflows to workflow service in cloud platform?

      Regards

      Ankush

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Ankush, If you are looking for an automatic conversion/migration tool - then the answer is no. SAP Workflows in ERP system are on a different runtime. If you think there is better way of modeling an existing workflow process (which spans across Cloud/on-premise landscape), you can start to remodel the same flow using the Workflow service in SAP Cloud Platform.

      Author's profile photo Raghavendra H K
      Raghavendra H K

       

      Hi Murali,

      Thank u for the blog,

      Is service task is only used for business rules or we can use it for hana services also?

      and  I have called ajax method for hana services  in my html5 application,

       

       

      but I could not able to post the data. I am getting following error,

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Raghavendra,

      You should be able to call any API from the service task. Please check out the sample code and Help documentation referenced in this blog. Also, please raise a question in the forum to get more support on your question. Thanks,

       

      Author's profile photo Former Member
      Former Member

      Hi Murali,

      I see  in your snapshot for inbox that there is a Forward button for forwarding the task. Below is the snapshot of the My Inbox, but I donot see a Forward button. Is there any specific role for getting this button?

       

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Puneet,

      The forward button is part of the My Inbox configuration. I believe there are task level settings which need to be need to be configured in the backend SAP system.

       

      Author's profile photo Sarah Lottman
      Sarah Lottman

      I have enabled workflow, developed a few scenarios and tried deploying it back to SCP.  When I run the Manage Workflow Destination app however I never see any workflows - it shows "No Destinations Found".  Any ideas?  This is needed for a customer demo soon.

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Sarah, There have been changes to the Workflow service and its best to check the Help documentation to verify if the prerequisites have been met. The Learning journey has also got links to the new tutorials. I would suggest you raise a question in the forum if you still get the No Destinations Found" error.

       

      Author's profile photo Oliver Port
      Oliver Port

      Hello Murali,

      very nice blog. I played a little bit around and created some dummy workflows. Now i try to delete or disable them. But no idea. In the documentation i did not find any hints how to "undeploy" workflows in the cloud. Is there any kind of administration area where i can do things like this?

      Author's profile photo Archana Shukla
      Archana Shukla

      Hello Oliver,

      You can delete the workflow from Monitor Workflow Application or delete them using workflow APIs: https://api.sap.com/shell/discover/contentpackage/SAPCPWorkflowAPIs/api/SAP_CP_Workflow [DELETE method for workflow definition]

      Regards,
      Archana

      Author's profile photo Jillette Esguerra
      Jillette Esguerra

      Do the 'Monitor Workflow' apps, by default, also logs the standard workflow activities from S4HC if subscribed to the Workflow Service?

      Author's profile photo Murali Shanmugham
      Murali Shanmugham
      Blog Post Author

      Hi Jillette, The Monitor Workflow app is used to report on workflows initiated using the SAP CP Workflow service. This wouldn't be able to report on workflow logs in S4HC.

      Author's profile photo Jillette Esguerra
      Jillette Esguerra

      Thanks for confirming Murali! I am trying to look for an app that serves the purpose of standard workflow monitoring but I can't seem to find any.