Generate or update a BPMN workflow definition using an LLM
Learn more about how to generate a new BPMN workflow definition or update an existing BPMN workflow definition from prompt history.
Overview
Use the Workflow to generate a BPMN workflow definition from user prompts or update an existing BPMN workflow definition based on conversation history.
HTTP method and endpoint
Use the following HTTP method and endpoint path to submit the request for generating a new BPMN workflow definition or updating an existing BPMN workflow definition.
POST {host}/workflow-adapter/workflow/{tenant}/ai
The following table describes the endpoint path parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
tenant | String | Yes | Unique identifier of the tenant. |
Replace {host} with the base URL of your environment.
Request headers
The following request headers must be included.
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <access_token> | Yes |
Content-Type | application/json | Yes |
Request body
The following table describes the request body parameters.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
messages | Array of strings | Yes | List of user prompts that define the requested workflow changes. The most recent prompt appears at the end of the array. | One or more prompt strings |
currentXml | String | No | Existing BPMN XML definition to update. Escape string-breaking characters before sending the XML in the JSON payload. | BPMN XML string / Optional |
Example request
Use the following example to see how a complete request is structured with headers and a JSON body.
POST {host}/workflow-adapter/workflow/{tenant}/ai
Authorization: Bearer <access_token>
Content-Type: application/json
{
"messages": [
"improve the default data change review process by adding a second step that is assigned to data stewards with 'ROLE_REVIEWER_DS' role"
],
"currentXml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>...."
}
Response body
The response body contains the generated or updated BPMN workflow definition in XML format.
Example response
The following example shows a response with a BPMN workflow definition in XML format.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process id="dataChangeRequestReview" name="Data Change Request Review" isExecutable="true">
<startEvent id="startEvent1" name="Start"/>
<userTask id="userTask1" name="DCR Review"/>
<endEvent id="endEvent1" name="End"/>
</process>
</definitions>