Skip to Content
Technical Articles
Author's profile photo shivam shukla

Automate your Job Postings Using Generative AI (ChatGPT) & SAP Build Process Automation Apps

Hi ,

Generative AI + SAP BTP

This Article demonstrates the capabilities of Generative AI + SAP BTP together means if you mix the right things then outcome will be beautiful for sure.

This is a generic approach can be followed to automate the Job Posting in SuccessFactors as well , I will be working more onto this topic to create a custom GenAI Model which can serve the purpose of data extraction in a very proficient way and rest is just integration, GenAI has really changed the way of Approaching problems now a days. Idea is to infuse these intelligent tech and extract the meaning information and use that in a efficient manner – thats the end goal and we are working towards it.

Let’s reduce the time for Job Posting from (N) days to (N) Minutes – and I am working on this goal

 

What is the problem which we tried to solve:

In Large organizations HR Departments are receiving 100s of emails daily for posting a job on their Portal and really lot of Manual efforts goes into this

  • You got one email from Competency that we are looking for candidates for these open positions
  • HR Receives the email and tries to extract the meaningful information out of it
  • Prepare a very good Job Description
  • Post it on Portal
  • Repeat these steps for all the emails ( or may you can copy some details )

But this is not an efficient approach to do the job hence I decided to solve this problem using latest Tech Stack in Hand.

End Goal

Perform Job Posting Successfully in SAP Fieldglass without any Manual intervention — Just one click and the Job is done.

Processed%20to%20be%20followed

Processes to be followed

 

Let’s Break down the problem statement in multiple Sub-problems

  1. Read the email content ( Only those which are not processed / unread emails )
  2. Setup OpenAI Service to be used ( Create Account at OpenAI & get your API Keys )
  3. Prepare the data using email content we received and process this data using OpenAI
  4. Prepare the Input request for API ( For Posting Job in SAP Fieldglass )
  5. Respond back to that email with Job Posting ID if Success in case there is any error please respond back that too.

 

We can start solving these problems one by one.

Read the email content ( Only those emails which are not processed / unread )

Solution: 

  • Create a process automation task using SAP Build Process Automation & Add Outlook SDK In dependencies
  •  After that follow standard tutorials from developers.sap.com to read emails from Microsoft Outlook & Specify the folder path to read email from
  • I have also added a send reply activity just to check if it is properly reading the email content ( Email Body )

       

 

  • Result :- we can now read emails from outlook and can also get the content in our Process Automation Activity ( Store them into some variable to use it later )

 

Setup OpenAI Service to be used ( Create Account at OpenAI & get your API Keys )

Solution: 

  • Create a paid account on https://chat.openai.com/ and then go to settings and get your API Keys
  • Lets create a simple CAP Application which will help us in exposing the OpenAI call as an API at BTP Layer
  • Approach – Develop CAP Application having one CDS Entity called as GTPRequest which has one Input and one Output column with Data Type as LargeString

Test your CAP Application ( CDS RUN )

         

  • Run your CAP Application and pass input as “Give me Sample ABAP CDS for PO Data” And ChatGPT API is giving you sample CDS Code for PO Data
  • Deploy your CAP Application and Perform the testing using POSTMAN as well so that we can consume this API in our SAP Build Process Automation App
  • Result :- we are ready with OpenAI API up and running in our BTP Cloud Foundry Space

 

Prepare the data using email content we received and process this data using OpenAI

 

Note:- This step holds significant importance as it ensures the data is retrieved in the required format compatible with the fieldglass connector. Therefore, I urge you to evaluate the functionality of the Job Posting Upload connector within the fieldglass environment. Confirm its operational status, as we intend to utilize this identical connector for automating the process of Job Posting through our application.

 

Data Format for Job Posting

 

Pre-requisite: 

  1. You have your SAP Fieldglass Account ready
  2. You got your FG Keys for Job Posting ( Make sure FG Connector is Accepting JSON Data as input)

 

Solution: 

  • In Solution 2, we have acquired the email content. Now, let’s proceed with preparing the request for the GPT feed. We will begin by including specific instructions for GPT.
  • Present the data in JSON format and encapsulate the output within a data variable.
  • Provide instructions to incorporate both the Start Date and End Date within the output.
  • Provide instructions to include weekly timesheet data, considering a 40-hour workweek if there are 8 working hours per day.
  • I’ve outlined a few instructions here, but it’s crucial to ensure that we provide accurate input to the model to effectively fulfill its purpose. (I’ve included a testing snapshot for your reference.)

       

  • You can see start date is immediate which is incorrect here , we can instruct ChatGPT to put current date or today’s date in this case.
  • 2-3 Parameters contains default values but we will have instruct the ChatGPT API about the mapping of fields example if email has something like — there are 4 open positions in this case API should Add one Variable “No of Positions and Assign the Value 4 to it”  And Off-course this is going to require a very good training of model.
  • You can also test the API using POSTMAN before proceeding further
  • Result :- ChatGPT API is giving the response back in desired format

 

Prepare the Input request for API ( For Posting Job in SAP Fieldglass )

 

Solution 1: 

  • The ChatGPT API is operational within the Cloud Foundry Space. Obtain the necessary Credentials to invoke the API by downloading the keys from SAP Build Process Automation Apps.
  • Develop a custom script within SAP Build Process Automation to retrieve the API token.
  • Develop a custom script within SAP Build Process Automation to initiate a call to the GPT Service. This involves providing the token and delivering the text that has been formatted and instructed as per requirements.
  • Execute the GPT Service call and retain the response within a variable. This stored response can subsequently be utilized for calling with the Fieldglass API at a later stage.

Solution 2:

  • Develop a custom script within SAP Build Process Automation to retrieve the API token for Fieldglass Connector.
  • Develop a custom script within SAP Build Process Automation to initiate a call to the Fieldglass API Service. This requires token plus formatted response from GPT Service from Solution 1.
  • If all goes well — this will post a Job Posting in Fieldglass

 

Respond back to that email with Job Posting ID if Success in case there is any error please respond back that too

  • Add send reply activity in SAP Build Process Automation task in the end so that we can inform the end use about success/failure

 

If you have followed the development Approach then you will end-up with below Process Automation App

SAP Build Process Automation Apps enables the integration of various tasks into a unified platform, allowing you to streamline different activities efficiently. The availability of standard libraries enhances this process by providing flexibility. This empowers you to concentrate on the critical tasks rather than getting bogged down by less significant ones, ensuring a smoother workflow.

Activity Workflow

Automation%20Flow

Automation Flow

I believe I’ve covered all the essential tasks required for the development of this compact job posting product. Naturally, there’s room for fine-tuning and further enhancements in this endeavor. However, my primary goal was to initiate the process and set the stage. The outcome remains to be seen as we blend the power of Generative AI with SAP BTP.

Here I am attaching the architecture diagram of the Application which contains the flow of execution.

 

Behind the Scenes:

 

Test GPT Service in POSTMAN

Yeah it’s demo time 🙂

  • Got 2 emails for Job Posting and they are waiting in my inbox for execution
  • Execute SAP Build Process automation workflow
  • Call GenAI APIs
  • Prepare Input for Fieldglass API ( Job Posting Connector )
  • Call FG API for Job Posting
  • Send Confirmation email to end users

 

This is my first steps towards unlocking the potential of Generative AI + SAP BTP —- “A long way to go & a lot to be done” ……

 

Stay Curious and Keep Learning 🙂

Thanks Shivam

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Syambabu Allu
      Syambabu Allu

      Hi Shivam,

      really impressive blog combination with AI+SAP Build.Thanks for sharing.

      Thank you,

      Syam

      Author's profile photo shivam shukla
      shivam shukla
      Blog Post Author

      Thanks you Shyam

      Author's profile photo Prashant Sharma
      Prashant Sharma

      Hi Shivam,

      Informative Blog. Thank you for sharing.

      Author's profile photo shivam shukla
      shivam shukla
      Blog Post Author

      Thank you Prashant

      Author's profile photo Mohit Bansal
      Mohit Bansal

      Really impressive and useful blog. It would be great if you can share the github repo also.

       

      Regards,

      Mohit Bansal

      Author's profile photo shivam shukla
      shivam shukla
      Blog Post Author

      Hi Mohit Bansal ,

       

      Thank you for the Kind Words Yes i will upload in a week.

      Thank you for encouragement.

       

      Thanks,

      Shivam