Get a workflow status

Provisioning a workflow may take a significant amount of time, particularly when the action is associated with OpenSearch indexing operations. The Get Workflow State API permits monitoring of the provisioning deployment status until it is complete.

Path and HTTP methods

  1. GET /_plugins/_flow_framework/workflow/<workflow_id>/_status

Path parameters

The following table lists the available path parameters.

ParameterData typeDescription
workflow_idStringThe ID of the workflow from which to obtain the status. Required for the PUT method.

Query parameters

The all parameter specifies whether the response should return all fields.

When set to false (the default), the response contains the following fields:

  • workflow_id
  • any error state
  • state
  • a list of resources_created

When set to true, the response contains the following additional fields:

  • provisioning_progress
  • provision_start_time
  • provision_end_time
  • user
  • user_outputs

To receive all available fields in the response, set all to true:

  1. GET /_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50/_status?all=true

copy

Example request

  1. GET /_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50/_status

copy

Example response

OpenSearch responds with a summary of the provisioning status and a list of created resources.

Before provisioning has begun, OpenSearch does not return any resources:

  1. {
  2. "workflow_id" : "8xL8bowB8y25Tqfenm50",
  3. "state": "NOT_STARTED"
  4. }

While provisioning is in progress, OpenSearch returns a partial resource list:

  1. {
  2. "workflow_id" : "8xL8bowB8y25Tqfenm50",
  3. "state": "PROVISIONING",
  4. "resources_created": [
  5. {
  6. "workflow_step_name": "create_connector",
  7. "workflow_step_id": "create_connector_1",
  8. "resource_type": "connector_id",
  9. "resource_id": "NdjCQYwBLmvn802B0IwE"
  10. }
  11. ]
  12. }

Upon provisioning completion, OpenSearch returns the full resource list:

  1. {
  2. "workflow_id" : "8xL8bowB8y25Tqfenm50",
  3. "state": "COMPLETED",
  4. "resources_created": [
  5. {
  6. "workflow_step_name": "create_connector",
  7. "workflow_step_id": "create_connector_1",
  8. "resource_type": "connector_id",
  9. "resource_id": "NdjCQYwBLmvn802B0IwE"
  10. },
  11. {
  12. "workflow_step_name": "register_remote_model",
  13. "workflow_step_id": "register_model_2",
  14. "resource_type": "model_id",
  15. "resource_id": "N9jCQYwBLmvn802B0oyh"
  16. }
  17. ]
  18. }