Technical Articles
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.
– 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.
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.
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.
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:
- Exchange knowledge: SAP Community | Q&A| Blogs
- Explore: SAP Product Page | Product Demo
- Learn more: SAP Help Portal | SAP Learning Journey
- Follow us on LinkedIn, Twitter, and YouTube
- SAP Process Automation Best Practice Series.
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?
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
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.
Hello I have created the destination "sbpa_trigger". But how am I going to use this destination on my SAPUI5 app? Thank you