Overview
Previously, triggering an SAP Build Process Automation (SBPA) workflow from a CAP application required direct REST API calls. On April 26, 2026, the Node.js plugin `@cap-js/process` was released as its first beta, offering a native CAP integration. This guide walks through the complete setup step by step.
Prerequisites
Procedure
Step 1 — Develop and Deploy a Process in SBPA
Create and deploy your process in the SAP Build Process Automation designer.
After deployment, locate the workflow instance ID in the deployment details.
In this example the process definition ID is:
ap10.iac-apj-workshop-i30jhz3m.wfcap1.wfcap1
Note this value — it is required in Steps 5 and 7.
Step 2 — Generate a Sample CAP Project
cds init capwf --nodejs --add sample
cd capwf
Step 3 — Add the `@cap-js/process` Plugin
npm add @cap-js/process
Step 4 — Bind the CAP Project to the SBPA Service Instance
Log in to Cloud Foundry and bind the `ProcessService` to your SBPA service instance.
cf login -a https://api.cf..hana.ondemand.com --sso
cds bind ProcessService -2
> Replace `
Step 5 — Import the Process as a CDS Service
Use the `process_definition_id` from [Step 1].
cds import --from process --name
Step 6 — Open the Project in VS Code
Step 7 — Annotate the CDS Service to Trigger the Workflow
Edit `srv/admin-service.cds` to add `@bpm.process` annotations to the `Books` entity.
**Before:**
using {sap.capire.bookshop as my} from '../db/schema';
service AdminService {
entity Authors as projection on my.Authors;
entity Books as projection on my.Books;
entity Genres as projection on my.Genres;
}
After:
“`cds
using {sap.capire.bookshop as my} from ‘../db/schema';
service AdminService {
entity Authors as projection on my.Authors;
id : ‘ap10.iac-apj-workshop-i30jhz3m.wfcap1.wfcap1',
on : ‘submit',
inputs: [
{ path: $self.idStr, as: ‘id' },
{ path: $self.authorName, as: ‘author' },
$self.title,
$self.descr,
{ path: $self.genreName, as: ‘genre' },
$self.stock,
$self.price,
{ path: $self.currencyCode, as: ‘currency' }
]
}
entity Books as projection on my.Books {
*,
cast(ID as String) as idStr : String,
author.name as authorName : String,
genre.name as genreName : String,
currency.code as currencyCode: String
}
actions {
action submit();
};
entity Genres as projection on my.Genres;
}
“`
Key annotations explained:
| Annotation | Purpose |
| ————————– | —————————————————————————————————— |
| `@bpm.process.start` | Triggers the SBPA workflow when the `submit` action is called, mapping entity fields to process inputs |
| `@bpm.process.cancel` | Cancels the running workflow instance when the entity is deleted |
| `@bpm.process.businessKey` | Sets the business key used to correlate the workflow instance with the CAP entity |
Step 8 — Run the Application Locally
Start the application in hybrid mode so it connects to the bound SBPA service instance.
cds watch --profile hybrid
Step 9 — Test the `submit` Action
Create `test/http/AdminService.http` and send the following request to trigger the SBPA workflow for an existing active book.
@server=http://localhost:4004
@username=alice
@password=
### Books Submit action on an existing active Book (ID=201)
# @NAME Books_Submit_Existing
POST {{server}}/odata/v4/admin/Books(ID=201,IsActiveEntity=true)/AdminService.submit
Content-Type: application/json
Authorization: Basic {{username}}:{{password}}
{}
The terminal confirms the workflow was triggered — notice `[process] – Starting process ap10.iac-apj-workshop-i30jhz3m.wfcap1.wfcap1` and the book data passed as inputs.
Step 10 — Verify the Workflow Task in SBPA My Inbox
Open the SAP Build Process Automation **My Inbox**. The approval task appears with the book data (ID, author, title, description, genre, stock, price, currency) populated from the CAP entity.
The End!
Thank you for your time!


