Workflow Integration
Backend integration can also help trigger both SAP BTP workflows and SAP S/4 workflows from SAP IoT. Workflows can be triggered in a similar way as iFlows. As a customer, you need to define the destination through the SAP BTP Destination service and provide the corresponding payloads.
To trigger a SAP BTP workflow, you need to define the destination as shown in the following sections.
Destination Type and Authentication Mechanisms
| Authentication | Description |
|---|---|
| Authentication | OAuth2ClientCredentials |
| Client ID | <CLIENT ID> of your SAP BTP Workflow Service (CF) |
| Client Secret | <CLIENT SECRET> of your SAP BTP Workflow Service (CF) |
| Token Service URL | https://<SUB DOMAIN of your tenant>.authentication.<YOUR REGION>.hana.ondemand.com/oauth/token |
| Token Service User | <SAP BTP user> to initiate the workflow (user needs to have the required permissions) |
| Token Service Password | <SAP BTP password of above user> |
Destination Proxy Type: Internet
Destination URL: https://api.workflow-sap.cfapps.<REGION>.hana.ondemand.com/workflow-service/rest/v1/workflow-instances.
Sample Payload
Format: JSON
A sample payload (request body) has the following structure. Make sure that you replace the value of the definitionId with your own workflow Id, and remove the context variable placeholder.
To trigger an S/4 workflow, you define the destination as below:
Destination Type and Authentication Mechanisms
| Authentication | Description |
|---|---|
| Authentication | BasicAuthentication |
| User | <S/4 HANA user> to initiate the workflow (You need to have the required permissions) |
| Password | <S/4 HANA user password> |
Destination Proxy Type: OnPremise for On-Premise S/4 HANA Systems
Destination URL: http://<HOST NAME>:<PORT>/SAP/BC/WORKFLOW_XML/?~protocol=01&~localkey=<WORKFLOW ID>&sap-client=<CLIENT NUMBER>.
Sample Payload
Format: WF-XML
A sample payload (request body) has the following structure. Make sure that you replace the value of the <KEY> with your own S/4 system and workflow Id.