Workflow Runs
The /workflows/runs
endpoints allows you to manage your Workflows Runs.
List Workflow Runs
Endpoint: /workflows/runs
Method: POST
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Content-Type | application/json |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
document_id | string | (Optional) The ID of the document to filter by. |
event_name | string | (Optional) The name of the event to filter by. |
rule_id | string | (Optional) The ID of the rule to filter by. |
Example Request
{
"document_id": "<DOCUMENT_ID>",
"event_name": "create",
"rule_id": "<RULE_ID>"
}
Example Response
{
"runs": [
{
"status": "COMPLETED",
"started_at": 1678886400,
"closed_at": 1678886460,
"execution_duration": 60,
"run_id": "<RUN_ID>",
"workflow_id": "<WORKFLOW_ID>",
"type": "StandardContentIngestion"
}
]
}
Code Examples
List Workflow Runs
curl --location 'https://studio-server-production.api.becomposable.com/api/v1/workflows/runs' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"document_id": "<DOCUMENT_ID>",
"event_name": "create",
"rule_id": "<RULE_ID>"
}'
Get Run Details
Endpoint: /workflows/runs/<WORKFLOW_ID>/<RUN_ID>
Method: GET
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<WORKFLOW_ID> | The ID of the Workflow. |
<RUN_ID> | The ID of the Run. |
Example Request
There is no JSON body with this request.
Example Response
{
"status": "COMPLETED",
"started_at": 1678886400,
"closed_at": 1678886460,
"execution_duration": 60,
"run_id": "<RUN_ID>",
"workflow_id": "<WORKFLOW_ID>",
"type": "StandardContentIngestion",
"history": [
{
"event_id": 1,
"event_time": 1678886400,
"event_type": "WorkflowExecutionStarted",
"task_id": "1",
"attempt": 0,
"activity": {
"name": "StandardContentIngestion",
"id": "1",
"input": {
"documentId": "<DOCUMENT_ID>"
}
}
},
{
"event_id": 2,
"event_time": 1678886460,
"event_type": "WorkflowExecutionCompleted",
"task_id": "2",
"attempt": 0,
"result": {
"documentId": "<DOCUMENT_ID>"
}
}
]
}
Code Examples
Get Run Details
curl --location 'https://studio-server-production.api.becomposable.com/api/v1/workflows/runs/<WORKFLOW_ID>/<RUN_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Terminate Workflow Run
Endpoint: /workflows/runs/<WORKFLOW_ID>/<RUN_ID>/terminate
Method: POST
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Content-Type | application/json |
Path Parameters
Parameter | Description |
---|---|
<WORKFLOW_ID> | The ID of the Workflow. |
<RUN_ID> | The ID of the Run. |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
reason | string | (Optional) The reason for terminating the Workflow Run. |
Example Request
curl --location 'https://studio-server-production.api.becomposable.com/api/v1/workflows/runs/<WORKFLOW_ID>/<RUN_ID>/terminate' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"reason": "User requested termination"
}'
Example Response
{
"message": "Workflow <RUN_ID> terminated"
}
Code Examples
Terminate Workflow Run
curl --location 'https://studio-server-production.api.becomposable.com/api/v1/workflows/runs/<WORKFLOW_ID>/<RUN_ID>/terminate' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"reason": "User requested termination"
}'
Cancel Workflow Run
Endpoint: /workflows/runs/<WORKFLOW_ID>/<RUN_ID>/cancel
Method: POST
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Content-Type | application/json |
Path Parameters
Parameter | Description |
---|---|
<WORKFLOW_ID> | The ID of the Workflow. |
<RUN_ID> | The ID of the Run. |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
reason | string | (Optional) The reason for cancelling the Workflow Run. |
Example Request
curl --location 'https://studio-server-production.api.becomposable.com/api/v1/workflows/runs/<WORKFLOW_ID>/<RUN_ID>/cancel' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"reason": "User requested cancellation"
}'
Example Response
{
"message": "Workflow <RUN_ID> cancelled"
}
Code Examples
Cancel Workflow Run
curl --location 'https://studio-server-production.api.becomposable.com/api/v1/workflows/runs/<WORKFLOW_ID>/<RUN_ID>/cancel' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"reason": "User requested cancellation"
}'