BREAGEN Logo
Business Process

Business Process Management

Upload Workflow Endpoint POST /api/v1/workflows/upload

Resource URL/api/v1/workflows/upload
Response FormatJSON
Requires AuthenticationYes
Rate LimitedNo
HTTPSYes

Description

Upload an XML file for workflow processing.

Request Body

ParameterDescriptionRequiredTypeDefault Value
fileXML file to uploadYesBinaryN/A

Example Request

curl -X 'POST' \
'https://braegen.ai/api/v1/workflows/upload' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected]'

Example Response

{
  "isError": false,
  "statusCode": "200",
  "message": "Workflow uploaded successfully",
  "data": "workflow-001"
}

HTTP Responses

HTTP CodeMessage
200Successful Response
400Bad Request
404Not Found
500Internal Server Error

Save Workflow Endpoint POST /api/v1/workflows/save

Resource URL/api/v1/workflows/save
Response FormatJSON
Requires AuthenticationYes
Rate LimitedNo
HTTPSYes

Description

Save a BPMN/XML string for future use.

Request Body

ParameterDescriptionRequiredTypeDefault Value
titleTitle of the workflowNoStringN/A
createdUserUser who created the workflowNoStringN/A
dueDateDue date for the workflowNoStringN/A
workflowBPMN/XML string contentNoStringN/A
isActiveIndicates if workflow deploys immediatelyNoBooleanfalse

Example Request

curl -X 'POST' \
'https://braegen.ai/api/v1/workflows/save' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
    "title": "Sample Workflow",
    "createdUser": "user_123",
    "dueDate": "2025-05-01",
    "workflow": "<bpmn>...</bpmn>",
    "isActive": false
}'

Example Response

{
  "isError": false,
  "statusCode": "200",
  "message": "Workflow saved successfully",
  "data": {
    "id": "workflow-002",
    "key": "order-process",
    "name": "Order Process",
    "isDeployed": false,
    "activityName": null,
    "status": "draft",
    "createdUser": "john",
    "dueDate": "2025-04-15",
    "lastUpdated": "2025-04-08T12:00:00Z",
    "identifier": "wf-002",
    "workflow": "<bpmn:definitions>...</bpmn:definitions>",
    "deployed": false
  }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
400Bad Request
404Not Found
500Internal Server Error

Update Workflow Endpoint PATCH /api/v1/workflows/update

Resource URL/api/v1/workflows/update
Response FormatJSON
Requires AuthenticationYes
Rate LimitedNo
HTTPSYes

Description

Update a BPMN/XML string by ID.

Request Body

ParameterDescriptionRequiredTypeDefault Value
titleTitle of the workflowNoStringN/A
identifierWorkflow ID to updateNoStringN/A
dueDateDue date for the workflowNoStringN/A
workflowUpdated BPMN/XML string contentNoStringN/A
isDeployedIndicates if workflow is deployedNoBooleanfalse
isActiveIndicates if workflow should deploy immediatelyNoBooleanfalse

Example Request

curl -X 'PATCH' \
'https://braegen.ai/api/v1/workflows/update' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
    "title": "Updated Workflow",
    "identifier": "workflow_123",
    "dueDate": "2025-06-01",
    "workflow": "<bpmn>updated...</bpmn>",
    "isDeployed": false,
    "isActive": false
}'

Example Response

{
  "isError": false,
  "statusCode": "200",
  "message": "Workflow updated successfully",
  "data": {
    "id": "workflow-002",
    "key": "order-process",
    "name": "Updated Order Process",
    "isDeployed": false,
    "activityName": null,
    "status": "draft",
    "createdUser": "john",
    "dueDate": "2025-04-20",
    "lastUpdated": "2025-04-08T12:05:00Z",
    "identifier": "wf-002",
    "workflow": "<bpmn:definitions>...</bpmn:definitions>",
    "deployed": false
  }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
400Bad Request
404Not Found
500Internal Server Error

Activate/Deploy a Workflow Endpoint PATCH /api/v1/workflows/activate

Resource URL/api/v1/workflows/activate
Response FormatJSON
Requires AuthenticationYes
Rate LimitedNo
HTTPSYes

Description

Activate an already defined workflow by ID.

Parameters

ParameterDescriptionRequiredTypeDefault Value
identifierWorkflow ID to activateYesStringN/A

Example Request

curl -X 'PATCH' \
'https://braegen.ai/api/v1/workflows/activate?identifier=workflow_123' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'

Example Response

{
  "isError": false,
  "statusCode": "200",
  "message": "Workflow activated successfully",
  "data": {
    "id": "workflow-002",
    "key": "order-process",
    "name": "Updated Order Process",
    "isDeployed": true,
    "activityName": null,
    "status": "active",
    "createdUser": "john",
    "dueDate": "2025-04-20",
    "lastUpdated": "2025-04-08T12:10:00Z",
    "identifier": "wf-002",
    "workflow": "<bpmn:definitions>...</bpmn:definitions>",
    "deployed": true
  }
}

HTTP Responses

HTTP CodeMessage
200Successful Response
400Bad Request
404Not Found
500Internal Server Error

Activate/Deploy a Workflow Endpoint PATCH /api/v1/workflows/activate

Resource URL/api/v1/workflows/activate
Response FormatJSON
Requires AuthenticationNot specified
Rate LimitedNot specified
HTTPSAssumed Yes

Parameters

ParameterDescriptionRequiredTypeDefault Value
pagePage numberNoInteger1
sizeItem per pageNoInteger10
sortOrderSort order (asc/desc)NoString"asc"
searchConfigsSearch configurationNoStringN/A

Example Request

curl -X 'GET' \
'http://activity-be-chicago-dev.braegen.ai/api/v1/workflows?page=1&size=10&sortOrder=asc&sortField=id' \
-H 'accept: */*'

Example Response

{
  "isError": false,
  "statusCode": "200",
  "message": "Workflows retrieved successfully",
  "totalItems": 2,
  "totalPages": 1,
  "currentPage": 1,
  "results": [
    {
      "id": "workflow-001",
      "key": "review-process",
      "name": "Review Process",
      "isDeployed": true,
      "activityName": null,
      "status": "active",
      "createdUser": "alice",
      "dueDate": "2025-04-12",
      "lastUpdated": "2025-04-07T10:00:00Z",
      "identifier": "wf-001",
      "workflow": "<bpmn:definitions>...</bpmn:definitions>",
      "deployed": true
    },
    {
      "id": "workflow-002",
      "key": "order-process",
      "name": "Updated Order Process",
      "isDeployed": true,
      "activityName": null,
      "status": "active",
      "createdUser": "john",
      "dueDate": "2025-04-20",
      "lastUpdated": "2025-04-08T12:10:00Z",
      "identifier": "wf-002",
      "workflow": "<bpmn:definitions>...</bpmn:definitions>",
      "deployed": true
    }
  ]
}

HTTP Responses

HTTP CodeMessage
200Successful Response
400Bad Request
404Not Found
500Internal Server Error