Skip to Content
Technical Articles
Author's profile photo Chaitanya Priya Puvvada

Start your Business Process through an API Trigger in SAP Build Process Automation

Hello everyone,

In this blog post, I will explain how to initiate your Business Process through an API trigger that can be triggered from other applications.

1. Create an API trigger for the Process

2. Get the Definition ID for the process

3. Trigger your process

Create an API trigger

1. In the process builder canvas, Select your Process. On the Trigger tile, select +. Then choose API and  New API Trigger.

2.In the Create API Trigger window do the following:

– Enter the name: API Trigger.
– Choose **Create**.

 

 

3.Click on the **Canvas** in the background.

 

4. In the **Process Details** side panel, choose **Inputs/Outputs** and then **Configure** to configure inputs.

 

5. Configure four inputs. Enter the following names and types as shown below and  Click Apply.

Note: You can even create a Data type using Data type Artifact and consume it in Process Inputs

7. Map these parameters to the other artifacts that are used in the next steps in the Process.

8. Save your changes. Release and Deploy the process.

During the deployment of the Process, Select No trigger creation since you have already created a Trigger for your process.

 

Now you have successfully created an API trigger for your process.

Get  the Definition ID for the  Process

1. Open the SAP Build page. Choose the tab Monitor –>Manage–>Process and Workflow instances.

Select your Process. Copy the ID of the process which would be used to trigger your process.

 

Test the API Trigger

1. The API call to trigger your Process is https://spa-api-gateway-bpi-eu-prod.cfapps.eu10.hana.ondemand.com/public/workflow/rest/v1/workflow-instance 

Note: Please change your region host(EU10/US10/AP10 )accordingly.

For more details on the API Specification,, please check the API.

 

2.Click on Try out

 

3. Configure the Environment to test the Business Process.

The pre-requisite is to create a service key for SAP Build Process Automation  in SAP BTP Cockpit

Click on Configure.

4.After successful configuration, you notice that the Bearer token is already generated in Response Headers.

 

5. Navigate to the Response body and enter the input parameters that were created for the API trigger and the definition ID of your Process.

6. Click on Run to trigger the Process. The response is 201 and the trigger was successful.

You can check the triggering of the process in the Monitor section of the SAP Build Page.

 

Trigger Business Processes from other applications

Refer to the blog post to trigger the Business Process from SAP Build Apps.

Create a Destination with the below details to trigger your process from CAP/SAP UI5.

https://spa-api-gateway-bpi-eu-prod.cfapps.eu10.hana.ondemand.com/public/workflow/rest/v1/workflow-instance 

Note: Please change your region host(EU10/US10/AP10 )accordingly.

 

Refer to the blog post if you want to trigger the Business Process through Postman

Conclusion

You have successfully created an API trigger to start your Business Process from other applications.

 

For more information on SAP Process Automation, please refer to the following sources:

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Daniel Wroblewski
      Daniel Wroblewski

      Nice blog!!

      I was able to trigger the process even without creating a trigger, so I'm wondering what is the advantage of creating a trigger?

      Author's profile photo Audrey Zhang
      Audrey Zhang

      I think by doing that you don't have to trigger from SAP Build Process Automation itself, like in an integrated scenario from other system 🙂

      Author's profile photo Daniel Wroblewski
      Daniel Wroblewski

      No, I could call the process from another app but I did not have to declare a trigger. One advantage is declaring input parameters. Also, I believe there will be other types of triggers -- perhaps the automation trigger is an example (?) -- so there would no longer be a default and I would have to explicitly define a trigger.

      At the time of this comment, I did not have to create a trigger to actual use the the trigger.

      Author's profile photo Mehmet Ali Subasi
      Mehmet Ali Subasi

      Hello I have created the destination "sbpa_trigger". But how am I going to use this destination on my SAPUI5 app? Thank you