Skip to main content

Engine API Documentation

This documentation provides a detailed overview of all the routes and endpoints available in the Workflow Engine. Each endpoint is described with its HTTP method, URL, expected payload, and response format.

REST Endpoints

GET /

Description: Fetches the list of available workflows.

URL: /

Method: GET

Response:

{
"workflows": ["ExampleWorkflow@2.0", "LoanApplicationWorkflow@1.0", ...],
"globalPrefix": "somePrefix"
}

POST /init

Description: Initializes a new workflow instance.

URL: /init

Method: POST

Payload with JSON:

{
"messages": [
{
"typeWithVersion": "ExampleWorkflow@2.0",
"correlationId": "123",
"invocationPoint": "",
"instanceId": "123"
}
],
"payload": {
"payloadType": "json",
"userId": "user@123",
"email": "sample@email.com"
}
}

or

Payload with FILE:

{
"messages": [
{
"typeWithVersion": "ExampleWorkflow@2.0",
"correlationId": "123",
"invocationPoint": "",
"instanceId": "123"
}
],
"payload": {
"payloadType": "media",
},
"file": fileAttachment
}

Response:

{
"success": true,
"message": "Workflow initialization request sent."
}

POST /message

Description: Processes a workflow message.

URL: /message

Method: POST

Payload:

{
"messages": [
{
"typeWithVersion": "ExampleWorkflow@2.0",
"correlationId": "123",
"invocationPoint": "",
"instanceId": "123"
}
],
"payload": {
"payloadType": "json",
"userId": "user@123",
"email": "sample@email.com"
}
}

or

Payload with FILE:

{
"messages": [
{
"typeWithVersion": "ExampleWorkflow@2.0",
"correlationId": "123",
"invocationPoint": "",
"instanceId": "123"
}
],
"payload": {
"payloadType": "media",
},
"file": fileAttachment
}

**Response:**

```json
{
"success": true,
"message": "Workflow message processing request sent."
}

POST /system/:command

Description: Handles system commands.

URL: /system/:command

Method: POST

Example Commands:

Example hostName: localhost, secondaryHost etc.
/system/:kill:hostName:node-1
/system/:start:hostName:node-5
/system/:config
/system/:pause:hostName:node-1
/system/:resume:hostName:node-1
/system/:deleteNode:hostName:node-5
/system/:ping:hostName:node-5
/system/:ping:hostName:SecondaryArbiter
/system/:ping:PrimaryArbier
/system/:config:PrimaryArbier
/system/:instance:terminate:1e5f9c5231 etc.
/system/:instance:pause:1e5f9c5231 etc.
/system/:instance:resume:1e5f9c5231 etc. \

Response:

{
"success": true,
"message": "Received new system message"
}

GET /allWorkflows

Description: Fetches all workflows.

URL: /allWorkflows

Method: GET

Response:

{
"success": true,
"workflows": [...]
}

GET /completeWorkflows

Description: Fetches all completed workflows.

URL: /completeWorkflows

Method: GET

Response:

{
"success": true,
"workflows": [...]
}

GET /workflow/:workflowId

Description: Fetches details of a specific workflow by ID.

URL: /workflow/:workflowId

Method: GET

Response:

{
"success": true,
"workflow": {...}
}

GET /workflow/:workflowId/check

Description: Checks if a specific workflow exists by ID.

URL: /workflow/:workflowId/check

Method: GET

Response:

{
"success": true
}

POST /uploadWorkflow

Description: Uploads a new workflow file.

URL: /uploadWorkflow

Method: POST

Payload: Multipart form-data with the workflow file.

Response:

{
"success": true,
"message": "Workflow uploaded and registered successfully"
}

POST /deleteWorkflow

Description: Deletes a workflow file.

URL: /deleteWorkflow

Method: POST

Payload:

{
"typeWithVersion": "ExampleWorkflow@2.0"
}

Response:

{
"success": true,
"message": "Workflow file deleted successfully"
}

POST /workflowCode

Description: Fetches the code of a specific workflow.

URL: /workflowCode

Method: POST

Payload:

{
"typeWithVersion": "ExampleWorkflow@2.0"
}

Response:

{
"success": true,
"code": "..."
}

POST /workflowDetail

Description: Fetches the details of a specific workflow, including its methods.

URL: /workflowDetail

Method: POST

Payload:

{
"typeWithVersion": "ExampleWorkflow@2.0"
}

Response:

{
"success": true,
"workflows": [
{
"workflow": "ExampleWorkflow@2.0",
"methods": ["TestActivity", "ResumeAndTerminate"]
}
]
}

POST /workflowNames

Description: Fetches the names of all workflows with pagination, filtering, and sorting.

URL: /workflowNames

Method: POST

Payload:

{
"currentPage": 1,
"rowsPerPage": 10,
"filter": "",
"sort": "asc"
}

Response:

{
"success": true,
"workflows": [...],
"totalWorkflows": 100,
"pagesCount": 10,
"rowsPerPage": 10,
"currentPage": 1
}

GET /configuration

Description: Fetches the current configuration.

URL: /configuration

Method: GET

Response:

{
"success": true,
"config": {...}
}

GET /ping

Description: Pings the server to check if it's alive.

URL: /ping

Method: GET

Response:

{
"success": true,
"message": "pong"
}

POST /auth

Description: Authenticates the user.

URL: /auth

Method: POST

Payload:

{
"authorizationKey": "someKey"
}

Response:

{
"success": true,
"message": "Authentication successful for cluster someCluster",
"clusterName": "someCluster"
}

POST /logs

Description: Fetches logs.

URL: /logs

Method: POST

Payload:

{
"serverName": "node-1",
"startTime": 0,
"endTime": 0,
"numOfLogs": 15,
"page": 1,
"instanceId": "sample-instance-ID",
"correlationId": "sample-correlation-ID",
"workflowName": "sample-workflow-name",
"logMessage": "sample-log-message",
}

Response:

{
"success": true,
"message": "Logs retrieved successfully",
"data": [...]
}

POST /grpcConnect

Description: Adds a new gRPC client.

URL: /grpcConnect

Method: POST

Payload:

{
"url": "someUrl",
"host": "someHost",
"port": 1234,
"name": "Workflow Engine Frontend"
}

Response:

{
"success": true,
"message": "gRPC Client added successfully"
}

GET /ports

Description: Fetches the list of ports.

URL: /ports

Method: GET

Response:

{
"success": true,
"ports": [...]
}
X

Graph View