Skip to Content
Technical Articles
Author's profile photo Mike Doyle

Cloud Platform Workflow: Your Quick-Start Guide

If you haven’t tried out the SAP Cloud Platform Workflow Service you really should.  It’s simple, and easy to use even if you don’t have a background in SAP Business Workflow (disclosure: I don’t).  Read on if you want to learn what it can do for you and if you want some tips to get you productive faster.  I won’t dwell on the basics and setup so you may want to refer to the references section first for some introductory reading.

Here’s a guide to this blog series, in workflow form of course

What does it do?

The Workflow Service can interact with the world by making service calls (e.g. OData), by creating user tasks that users can see in their Fiori My Inbox app and by sending emails.

On my current project I’m building a request/creation form for new projects. My customer (a professional services firm) wants an approval process that has an optional first round, a mandatory second round and a third round that is applicable depending on the contents of the request (i.e. is it higher risk?).  Once the request has received final approval I need to create the following objects in S/4HANA Cloud: One or many customers, one or many projects (that will be linked to one of those customers) and also some Custom Business Objects.  There could be 100 projects linked to 100 matching customers!

Not only has the Workflow Service been able to do everything I need, I’ve found it intuitive to use and I got up to speed very fast.

The service has been available on the Neo environment of SAP Cloud Platform for some time and was released on the Cloud Foundry environment this month.  I’ve been using the Neo version exclusively so that will be the focus of this post.

Why do I need workflow?

Workflow is great for asynchronous business processes.  In my case the key requirements were the approval process and the creation of the projects.  With the former we need to wait for the approver to review the form and approve or reject.  With the latter we can’t make the user wait while we create 100 customers and 100 projects in S/4!

In my personal experience workflow has been somewhat under-used.  SAP Business Workflow  (as found in Netweaver systems like S/4HANA and ECC) development is considered a specialist skill and because resource isn’t always available teams sometimes don’t use it when they should.  As a consequence they end up compromising on user experience (UX) and/or doing more custom development than necessary.

For example, I could put up a busy indicator in my UI5 app, and make my user wait while we create all those objects in S/4.  That would compromise UX.

What’s great about the Workflow Service is that it makes building workflows much more accessible.

Can you or someone on your team write JavaScript, often cited as the world’s most ‘popular’ language?  (Your UI5 devs would be good people to ask).  If so, you are ready to write Script Tasks in the Workflow Service.

Are you familiar with RESTful services, like OData?  If so, you are ready to write Service Tasks.  Have you ever sent an email?  Well, I’m sure you could write an Email Task.

What’s so great about the Cloud Platform Workflow Service, anyway?

  • The workflow service integrates well with the tools I’m already using on Cloud Platform.  I build the workflow in Web IDE, the user tasks appear in the Fiori My Inbox and I can build a custom UI5 app to display when the inbox item is opened.  The service tasks can call RESTful services like the OData services that are sprouting all over the ‘SAPverse’.  We can use GIT for source code management.
  • They didn’t go crazy on the scope.  It doesn’t take long to read through the help pages and at first I thought it seemed quite limited.  However, you have just enough in your toolbox to get the job done.  By limiting the scope the team made the Workflow Service fast to learn and I’m sure it contributed to the reliability, too.
  • You aren’t limited to OData services.  You can call more or less any service which supports the application/json content type.  That means there are a lot of things your workflow can do.
  • You get the Monitor Workflow admin apps.  With these you can track a workflow instance and also create new test instances.
  • If there is an error in your workflow it stops in its tracks.  Perhaps there is an issue with an OData service or with the master data.  After fixing the service or the data you can retry the offending task and the workflow will pickup exactly where it left off.
  • I found it very intuitive.  There are two ways to add components: the palette on the left and the speed buttons which appear against each control.  Just plug the components together and you have a workflow.  You’ll get error messages (in Web IDE) if you’ve missed something out.
  • I can arrange my workflow controls (e.g. tasks) however I want and Web IDE won’t re-arrange it unless I ask it to.  This is important because it’s easier to understand the workflow if components can be grouped logically, and if we don’t have long flow lines going everywhere.
  • As well as the graphical Workflow Editor we can access the Code Editor too.  The latter shows the source file which gets updated every time we make a change.  If we edit in the Code Editor we can see our changes in the Workflow Editor and vice versa.  It’s easy to track changes to the code using GIT.
  • It doesn’t require any new skills.  As someone who develops UI5 apps I can already use Web IDE, I know JavaScript and I know RESTful services (in particular OData).  If you’re missing these skills then it’s worth investing time in them because you will likely use them elsewhere.
  • There is a published API that we can use to interact with the Workflow Service.  To be more precise we have two. The Task Consumption Model (TCM) is a RESTful service (but not an OData service).  It’s the one that the Fiori Launchpad and My Inbox app use to count inbox items (task instances) and get details of a particular task.  The Workflow OData Service is much more extensive.  It can be used to create new workflow instances, for example.

What’s Next?

Are you keen to get started with the Workflow Service?  Would it fit a requirement you have?  I’ve collated some tips to help you get started.  Check them out.

You may have noticed that I’ve become a bit of a fan of the Workflow Service.  Even so, I’ve thought hard to come up with some suggestions for SAP to make it even better.

References

The SAP Cloud Platform site has a Workflow Service Page with a link to the technical documentation homepage, ultimately leading to the SAP Cloud Platform Workflow in the Neo Environment Overview page.

I presented a session on the workflow service for the SAP Online Track event in May 2020

I wrote about creating a Fiori app to edit workflow context variables

Stephan Schluchter has put together a Compendium, which has links to blogs, tutorials and videos

I highly recommend DJ Adams‘ series Discovering SCP Workflow.  DJ explores the service in detail and there’s a lot to learn just by following DJ’s investigations and how he goes about learning the nuts and bolts of the service

Christian Loos wrote a nice Getting Started series which covers the setup you need on your Cloud Platform trial account

Archana Shukla has written many blogs including on Using Business Rules in SAP Cloud Platform Workflow

Murali Shanmugham wrote a nice introduction piece as well as a series entitled Implementing a user self-registration scenario using Workflow and Business rules in SAP Cloud Platform

Joachim Meyer introduced the newish Workflow Forms

Seshadri Sreenivas R produced this overview and more recently has written about How to handle attachments in SAP Cloud Platform Workflow

Alan Rickayzen has written a comparison post SAP S/4HANA Flexible Workflow Overview and Comparison with SAP Business Workflow

Sharadha K gave us a series on an IoT Prototype with Business Rules and Workflow

Venugopal Chembrakalathil has shared details of the new Referenced Subflow feature which enables you to make your workflows more modular

 

 

 

 

 

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo DJ Adams
      DJ Adams

      Nice one Mike, and thanks for the link!

      Author's profile photo Susan Keohan
      Susan Keohan

      Well done, Mike!  You (and assorted others, mentioned here) may be able to drag me from my comfort zone of SAP Business Workflow - or I could drag you *into* it?   <bwah ha ha>

       

      Sue

       

      Author's profile photo Mike Doyle
      Mike Doyle
      Blog Post Author

      So glad you liked it, Sue.  I would love to learn Business Workflow.  I think they'll both be around for quite a while...

      Author's profile photo Enric Castella Gonzalez
      Enric Castella Gonzalez

      Great article!

      Author's profile photo Vinod Patil
      Vinod Patil

      Hello Mike,

      Thanks for blog. I have few basic questions. It will be really great if you can answer those.

      1. How workflow gets triggered? Do we need to call workflow APIs from business system from where we want to trigger it?
      2. In case of user tasks, how to identify the processor( how workflow service will know employee hierarchy)? Do we again need to call some API in say business suite in order to get approver for initiator present in workflow context?
      3. In case of decisions (approve/reject), do we again need to call some APIs to capture to process decision?

      Regards,

      Vinod Patil

      Author's profile photo Mike Doyle
      Mike Doyle
      Blog Post Author

      Hi Vinod, I'm glad you found the blog useful. With regard to your questions, you should think of the workflow service as being quite generic and flexible.  You can easily shape the workflow you build to suit your requirements.

      To be specific, yes you need to call the API to start your workflow, but this could be from a Fiori app, from some ABAP code or from another app or system altogether.

      The processor of a user task is determined by a simple field, and that field can be mapped to the context.  If the value in the field is a valid user (or group) on Cloud Platform then that user (or group) will see the work item in their inbox.

      With regard to capturing the decision and acting on it the specifics depend on whether you are implementing a workflow form, a UI5 component sitting in the detail pane of My Inbox (using the My Inbox API) or a standalone app which uses the workflow service API.  When the user task is completed the decision is written to the workflow context, which means that subsequent processing will depend on the decision made.

      Author's profile photo Phil Cooley
      Phil Cooley

      Great blog post Mike Doyle - have been involved in projects recently that are starting to utilise the SAP Cloud Platform workflow service and SAP Cloud Platform Business Rules. Great blog for those starting out and really helpful that you added alot of other links in the references section for those interesting in finding out more about the functionality.

      Thanks for sharing!