Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
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-i...

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-i...

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:
6 Comments