---
title: "get a workflow's status and results(if completed & requested), wait if the workflow is still running"
method: POST
path: "/api/v1/workflow/getWithWait"
---

# get a workflow's status and results(if completed & requested), wait if the workflow is still running

`POST /api/v1/workflow/getWithWait`

## Request body

- WorkflowGetRequest
  - `workflowId` string, required
  - `workflowRunId` string
  - `needsResults` boolean
  - `waitTimeSeconds` integer

## Response `200`

successful operation

- WorkflowGetResponse
  - `workflowRunId` string, required
  - `workflowStatus` 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMEOUT' | 'TERMINATED' | 'CANCELED' | 'CONTINUED_AS_NEW', required
  - `results` StateCompletionOutput[]
    - `completedStateId` string, required
    - `completedStateExecutionId` string, required
    - `completedStateOutput` EncodedObject
      - `extStoreId` string
      - `extPath` string
      - `encoding` string
      - `data` string
  - `errorType` 'STATE_DECISION_FAILING_WORKFLOW_ERROR_TYPE' | 'CLIENT_API_FAILING_WORKFLOW_ERROR_TYPE' | 'STATE_API_FAIL_ERROR_TYPE' | 'INVALID_USER_WORKFLOW_CODE_ERROR_TYPE' | 'RPC_ACQUIRE_LOCK_FAILURE' | 'SERVER_INTERNAL_ERROR_TYPE'
  - `errorMessage` string

## Other responses

- `400` — Invalid input
- `420` — wait has exceeded timeout

---

[API](https://skmtc.net/indeedeng/apis/workflow-apis.md) · [All operations](https://skmtc.net/indeedeng/apis/workflow-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/indeedeng/workflow-apis/versions/fe9c7606824c/schema)
