Skip to content

Workflow status

Request this API resource to know about the status of a workflow.
The response contains detailed information similar to that which can be obtained in the workflow editor.

Endpoint

The API endpoint for workflow status is:

https://host/api/v1/runtime/workflow/workflowId/action/status

where you have to replace:

  • host with the host name or IP address of the NL Flow runtime.
  • workflowId with the workflow ID.

To get the endpoint you can access the NL Flow application and:

  1. Open the workflow in the Workflows view of the dashboard.
  2. Display identifying information.
  3. 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: the workflow is in the desired status. If published, all the instances of the workflow's blocks are active, the workflow is usable.
    • YELLOW: not all the instances of multi-instance blocks are active, but at least one instance of each bock is active, so the workflow is usable.
    • ORANGE: at least one block doesn't have any active instance.
      For synchronous workflows this means that the workflow is not usable until status becomes green.
      For asynchronous workflows this means that the workflow accepts analysis tasks, so it's usable, but needs to activate block instances to actually perform analysis (its status will become green then).

      Note

      Green status asynchronous workflows can automatically go back to orange status after some inactivity if the auto-scaling option was turned on at publish time.

  • publishingMode: SYNC for synchronous or ASYNC for 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 ID
      • desired: target number of instances
      • actual: number of currently active instances
      • status current status of the service:

        • GREEN: all target instances are active
        • ORANGE: some instances are active, but not all
        • RED: there are no active instances
    • 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 ID
      • desired: target number of instances
      • actual: number of currently active instances
      • status current status of the service:

        • GREEN: all target instances are active
        • ORANGE: some instances are active, but not all
        • RED: there are no active instances
      • rolloutStatus, rolloutStatusReason and replicasDetail: troubleshooting information that may be requested from you by support personnel if you report a problem with the workflow.