Workflow status
Request this API resource to know about the status of a workflow.
Endpoint
The API endpoint for workflow status is:
https://host/api/v1/runtime/workflow/workflowId/action/status
where you have to replace:
hostwith the host name or IP address of the NL Flow runtime.workflowIdwith the workflow ID.
To get the endpoint you can access the NL Flow application and:
- Open the workflow in the Workflows view of the dashboard.
- Display identifying information.
- Copy the value of the Workflow status endpoint field.
HTTP verb
The workflow status resource must be requested with the GET verb.
Request headers
In every request you must set the following header:
X-API-KEY: API key
where you have to replace API key with the API key associated with the workflow.
Learn more about API keys in the article dedicated to this topic inside the NL Flow manual.
Response
If the workflow has never been published, the HTTP status is 404 (Not Found) and there is no response body. Otherwise the response body is a JSON object, some examples follow.
Synchronous workflow being published, not usable yet, cluster resources need to be initialized:
{
"desiredStatus": "PUBLISHED",
"actualStatus": "ORANGE",
"publishingMode": "SYNC",
"details": {
"stream": {
"id": "benthos",
"desired": 1,
"actual": 1,
"status": "GREEN"
},
"services": [
{
"id": "knowledge-m-f252bb2b",
"desired": 1,
"actual": 0,
"status": "RED",
"rolloutStatus": "InProgress",
"rolloutStatusReason": "RollingOutReplicaSet",
"replicasDetail": [
{
"name": "depl-knowledge-m-f252bb2b-c1a6414e-4973-45fb-9c6b-c767e2ffvh6zw",
"ready": false,
"available": false,
"age": "512.171355ms",
"status": "Unschedulable",
"statusMessage": "0/2 nodes are available: 1 Insufficient memory, 1 node(s) had untolerated taint {CriticalAddonsOnly: true}. preemption: 0/2 nodes are available: 1 No preemption victims found for incoming pod, 1 Preemption is not helpful for scheduling..",
"atLatestSpec": true
}
]
}
]
}
}
Synchronous workflow being published, not usable yet, a service needs to be instantiated:
{
"desiredStatus": "PUBLISHED",
"actualStatus": "ORANGE",
"publishingMode": "SYNC",
"details": {
"stream": {
"id": "benthos",
"desired": 1,
"actual": 1,
"status": "GREEN"
},
"services": [
{
"id": "knowledge-m-f252bb2b",
"desired": 1,
"actual": 0,
"status": "RED",
"rolloutStatus": "InProgress",
"rolloutStatusReason": "RollingOutReplicaSet",
"replicasDetail": [
{
"name": "depl-knowledge-m-f252bb2b-c1a6414e-4973-45fb-9c6b-c767e2ffvh6zw",
"ready": false,
"available": false,
"startedAt": "2024-02-12T10:12:57Z",
"age": "1m56.138865794s",
"status": "ContainerCreating",
"atLatestSpec": true
}
]
}
]
}
}
Synchronous workflow, published, usable:
{
"desiredStatus": "PUBLISHED",
"actualStatus": "GREEN",
"publishingMode": "SYNC",
"details": {
"stream": {
"id": "benthos",
"desired": 1,
"actual": 1,
"status": "GREEN"
},
"services": [
{
"id": "knowledge-m-f252bb2b",
"desired": 1,
"actual": 1,
"status": "GREEN",
"rolloutStatus": "Complete",
"replicasDetail": [
{
"name": "depl-knowledge-m-f252bb2b-c1a6414e-4973-45fb-9c6b-c767e2ffvh6zw",
"ready": true,
"available": true,
"startedAt": "2024-02-12T10:12:57Z",
"age": "16m26.470291765s",
"status": "Running",
"atLatestSpec": true
}
]
}
]
}
}
Unpublished workflow that has been already published at least once in the past:
{
"desiredStatus": "UNPUBLISHED",
"actualStatus": "GREEN",
"publishingMode": "ASYNC",
"details": {}
}
Asynchronous workflow, usable even if its resources have not been instantiated yet:
{
"desiredStatus": "PUBLISHED",
"actualStatus": "ORANGE",
"publishingMode": "ASYNC",
"details": {
"services": [
{
"id": "knowledge-m-f252bb2b",
"desired": 1,
"actual": 0,
"status": "RED",
"rolloutStatus": "InProgress",
"rolloutStatusReason": "RollingOutReplicaSet",
"replicasDetail": [
{
"name": "depl-knowledge-m-f252bb2b-dcc4a58f-050b-4d9c-a19e-8012275bnc22f",
"ready": false,
"available": false,
"startedAt": "2024-02-12T10:35:23Z",
"age": "601.915101ms",
"status": "ContainerCreating",
"atLatestSpec": true
}
]
},
{
"id": "outprod-4b54ca80",
"desired": 1,
"actual": 0,
"status": "RED",
"rolloutStatus": "InProgress",
"rolloutStatusReason": "RollingOutReplicaSet",
"replicasDetail": [
{
"name": "depl-outprod-4b54ca80-e150d837-532b-4448-ae11-e6c646bd4707rn6c4",
"ready": false,
"available": false,
"startedAt": "2024-02-12T10:35:23Z",
"age": "602.397326ms",
"status": "ContainerCreating",
"atLatestSpec": true
}
]
}
]
}
}
Asynchronous workflow, usable, all the resources have been instantiated:
{
"desiredStatus": "PUBLISHED",
"actualStatus": "GREEN",
"publishingMode": "ASYNC",
"details": {
"services": [
{
"id": "knowledge-m-f252bb2b",
"desired": 1,
"actual": 1,
"status": "GREEN",
"rolloutStatus": "Complete",
"replicasDetail": [
{
"name": "depl-knowledge-m-f252bb2b-dcc4a58f-050b-4d9c-a19e-8012275bnc22f",
"ready": true,
"available": true,
"startedAt": "2024-02-12T10:35:23Z",
"age": "39.092166459s",
"status": "Running",
"atLatestSpec": true
}
]
},
{
"id": "outprod-4b54ca80",
"desired": 1,
"actual": 1,
"status": "GREEN",
"rolloutStatus": "Complete",
"replicasDetail": [
{
"name": "depl-outprod-4b54ca80-e150d837-532b-4448-ae11-e6c646bd4707rn6c4",
"ready": true,
"available": true,
"startedAt": "2024-02-12T10:35:23Z",
"age": "39.092470777s",
"status": "Running",
"atLatestSpec": true
}
]
}
]
}
}
Its properties are:
desiredStatus: target workflow status of the workflow, e.g.PUBLISHED.-
actualStatus: current workflow status:GREEN: published with the configured number of instances of all the services active. The workflow can be used.YELLOW: published with at least one instance of every service active. The workflow can be used.ORANGE: being published, but with at least one service still having zero instances. The workflow cannot be used in synchronous mode, but can be used in asynchronous mode because analysis tasks are queued and kept in the queue until the status becomesYELLOWorGREENor the timeout is reached.RED: unpublished, in error or being published, but without active instances of any service. The workflow cannot be used in synchronous mode, but can be used in asynchronous mode because analysis tasks are queued and kept in the queue until the status becomesYELLOWorGREENor the timeout is reached.
-
publishingMode:SYNCfor synchronous orASYNCfor asynchronous. -
details: details on the publication status of the workflow components. Contains:-
stream: only for synchronous workflows. Information on the data stream, that is the service that deals with the passage of data from one block to another. Its properties are:id: data stream IDdesired: target number of instancesactual: number of currently active instances-
statuscurrent status of the service:GREEN: all the target instances instances are activeYELLOW: some instances of the service are active, but not allRED: there are no active instances of the service
-
services: information about the services corresponding to the workflow blocks plus, for asynchronous workflows, the needed shared services. It is an array, each item of which corresponds to a service and has these properties:id: service IDdesired: target number of instancesactual: number of currently active instances-
statuscurrent status of the service:GREEN: all the target instances instances are activeYELLOW: some instances of the service are active, but not allRED: there are no active instances of the service
-
rolloutStatus,rolloutStatusReasonandreplicasDetail: troubleshooting information that may be requested from you by support personnel if you report a problem with the workflow.
-