> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/mutations/checkworkflowstatus.md).

# Check Workflow Status

checkWorkflowStatus Mutation

Checks the status of a running workflow instance in the Temporal workflow engine.

## Arguments

| Name    | Type                        | Description                                 |
| ------- | --------------------------- | ------------------------------------------- |
| `input` | `CheckWorkflowStatusInput!` | Input data for checking the workflow status |

## Return Type

`CheckWorkflowStatusResponse` - Contains the status information for the requested workflow.

## Input Fields

`CheckWorkflowStatusInput`:

| Field   | Type      | Description                                  |
| ------- | --------- | -------------------------------------------- |
| `id`    | `String!` | Required workflow ID to check status for     |
| `runID` | `String!` | Required workflow run ID to check status for |

## Return Fields

`CheckWorkflowStatusResponse`:

| Field      | Type               | Description                                                                         |
| ---------- | ------------------ | ----------------------------------------------------------------------------------- |
| `status`   | `String!`          | Current status of the workflow (e.g., "RUNNING", "COMPLETED", "FAILED", "CANCELED") |
| `workflow` | `TemporalWorkflow` | Workflow instance details if available                                              |

## Usage Example

```graphql
mutation {
  checkWorkflowStatus(
    input: {
      id: "inventory-restock-workflow-123",
      runID: "abc123de-f456-7890-ghij-klmnopqrstuv"
    }
  ) {
    status
    workflow {
      id
      runID
      status
      type
      startedAt
      completedAt
      result
      failure
    }
  }
}
```

## JavaScript Example

```javascript
const CHECK_WORKFLOW_STATUS = gql`
  mutation CheckWorkflowStatus($input: CheckWorkflowStatusInput!) {
    checkWorkflowStatus(input: $input) {
      status
      workflow {
        id
        runID
        status
        type
        startedAt
        completedAt
        result
        failure
      }
    }
  }
`;

const { data } = await client.mutate({
  mutation: CHECK_WORKFLOW_STATUS,
  variables: {
    input: {
      id: "inventory-restock-workflow-123",
      runID: "abc123de-f456-7890-ghij-klmnopqrstuv"
    }
  }
});

console.log(`Workflow status: ${data.checkWorkflowStatus.status}`);
if (data.checkWorkflowStatus.workflow) {
  console.log(`Workflow type: ${data.checkWorkflowStatus.workflow.type}`);
  console.log(`Started at: ${data.checkWorkflowStatus.workflow.startedAt}`);
}
```

## Possible Status Values

* **RUNNING**: The workflow is currently executing
* **COMPLETED**: The workflow has completed successfully
* **FAILED**: The workflow has failed with an error
* **CANCELED**: The workflow was canceled
* **TERMINATED**: The workflow was terminated
* **CONTINUED\_AS\_NEW**: The workflow continued as a new execution
* **TIMED\_OUT**: The workflow timed out

## Important Notes

* This mutation queries the Temporal workflow engine for real-time status
* Both `id` and `runID` are required to uniquely identify the workflow instance
* The workflow instance must exist in the Temporal cluster for the query to succeed
* Use this mutation to monitor long-running workflow executions
* Status information includes execution details, results, and failure information if applicable
* This is a read operation despite being a mutation (following GraphQL conventions for operations that might have side effects)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/mutations/checkworkflowstatus.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
