Skip to Content
Technical Articles
Author's profile photo Seshadri Sreenivas Ramanarayanan

Extend SuccessFactors with SAP Cloud Platform Workflow (Part 2/2)

In my previous blog post, I had explained how ITeLo (an imaginary company) wanted to extend the SuccessFactors new hire Onboarding process to suit their business requirement. To achieve that, SAP Cloud Platform Business Rule, Workflow & Integration flows were created.

In this blog, I will explain how to trigger the SAP Cloud Platform Integration flow from SuccessFactors whenever a new hire is recruited, so that the Onboarding extension process is initiated.

SuccessFactors Integration Center

In the SuccessFactors Integration Center, a new Integration is created and the following information has been maintained:

  • ‘Trigger Type’ as Intelligent Services
  • ‘Destination Type’ as REST,
  • ‘Source Type’ as SuccessFactors
  • ‘Format’ as JSON (or XML)

In the next screen, the particular event in Intelligent Services is chosen. For ITeLo’s use case, the required event is ‘Employee Hire’. Based on the event, the OData entity is automatically determined. In the case of Employee Hire event, the OData entity available by default is Job Information (EmpJob).

Depending on the context information needed for the extension process, you need to make additional information available in the integration. For example, ITeLo requires a different process for different countries. Hence the employment country of the new hire needs to be available. ITeLo also requires to automatically determine equipment based on certain business conditions role, department, etc. and hence this information also needs to be made available in the event context before connecting to the endpoint. Hence the entities EmpJob, PerPersonal & User are made available as mapped fields in any output structure you would want (in ITeLo’s case all these entities are collected under a node called empData in the output). For more information on how to choose the starting OData entity for outbound integration refer to this help document.

ITeLo doesn’t want to extend the standard Onboarding process for the operations in Israel since the total headcount is less than 10 employees. So, they have applied a filter in the integration model so that if the extension process is initiated for all hiring countries other than Israel.

Finally, in the destination settings, the endpoint for connecting to the SAP Cloud Platform Integration Flow is maintained. Note that the HTTP method is of type POST (since there is a need to pass the context payload in the body of the message) and the payload format is JSON.

Note: The Integration center has been configured to pass the context to theSAP Cloud Platform Integration flow. So, based on the format that you choose in the Integration Center(XML/JSON) the handling of the context will be different in the integration flow.

Solution in Action

With this setup whenever a new employee is hired, the integration center immediately picks up the business event (the trigger type was Intelligent Services) and call the integration flow in SAP Cloud Platform Integration along with the details of the new hire. The Integration Flow will create a workflow instance based on the country of new hire and also pass the details of the new hire to SAP CP Workflow.

As per the workflow definition (for example, when the country of a new hire is the USA), the buddy will get a task in SAP Cloud Platform’s My Inbox application, where he/she can add/remove equipment which is proposed by the Business Rule.

Note that the user interface shown in the task details page (which contains Personal Information, Job Information & Equipment table) is custom developed based on the information available in the help document. The Personal & Job information shown on the page is the information that is available as the workflow context and is provided by the SuccessFactors Integration Center.

Once the buddy confirms the equipment based on the need and availability, a task is created for the hiring manager and available in the SAP Cloud Platform’s My Inbox application. The manager decides to approve or reject the task. If the manager decides to approve, then a shopping cart for the requested equipment is created in the S/4HANA system. The shopping process continues as it is defined in S/4HANA, and once the equipment is delivered, the buddy will get a task to confirm the same.

Conclusion

With the use of Intelligent Services, Integration Center & SAP Cloud Platform Workflow we were able to easily extend the standard Onboarding process in SuccessFactors. There are a lot of pre-delivered events as part of Intelligent Services spanning across multiple modules like Employee Central, Recruiting, Onboarding, Operational Workforce Planning, Compensation Management, Talent Management, etc. So, not just the new hire Onboarding process but a lot of other processes in SuccessFactors can be extended to meet the growing business need with the solution landscape detailed in this blog.

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Venu Ravipati
      Venu Ravipati

      Hi Seshadri Sreenivas,

      Thank you for the great blog.

      I could try this and working while triggering the call to CPI from Postman.

      But i have some trouble integrating from SF to CPI

      I created new integration in Integration Center -> My Integrations for "Employee Hire" Event. When triggered using "Run Now" option, empty payload is coming to CPI.

      But when i created new employee, there is no message to CPI.

      Can you help me how to troubleshoot/ where to find logs why New employee creation is not triggering the interface.

      Many thanks in advance,

      Best Regards,
      Venu

      Author's profile photo Seshadri Sreenivas Ramanarayanan
      Seshadri Sreenivas Ramanarayanan
      Blog Post Author

      Hi,

      Can you confirm if you have chosen the payload from the available context, that will be sent to CPI? If not the payload will be empty. Also, make sure the method is POST and not GET. On a side note, you can now directly trigger the workflow without CPI via OAuth 2.0. You could directly call the workflow if you don't need to perform any processing in CPI.

      Regards,

      Seshadri Sreenivas

      Author's profile photo Massimo Nanni
      Massimo Nanni

      Hello Seshadri Sreenivas,

      I have a problem calling SAP Cloud Platform Workflow from SuccessFactors Integration Center.

      The POST request to start the workflow instance needs the X-CSRF-Token, otherwise it gives a 403.

      Usually a previous request with header "X-CSRF-Token=Fetch" is required, but in Integration Center I found no way to do it.

      How did you manage to succeed?

       

       

      Author's profile photo Seshadri Sreenivas Ramanarayanan
      Seshadri Sreenivas Ramanarayanan
      Blog Post Author

      Hello Massimo Nanni

      You can use the OAuth client credentials flow to call the workflow API to start an instance.

      • Register an OAuth client in your workflow subaccount (refer help documentation for Neo environment, for Cloud Foundry environment)
      • Provide at least the role "WorkflowInitiator" to the OAuth user (oauth_client_<client_id>)
      • Use the client ID, secret and the OAuth endpoint and call the workflow API.

      Regards,

      Sesh

      Author's profile photo Massimo Nanni
      Massimo Nanni

      Thank you very much!