---
title: "useWorkflowStatus"
description: "useWorkflowStatus, auto-imported in the app: its options, return value and types."
canonical_url: "https://nuxt-backend.dev/docs/reference/api/use-workflow"
---
# useWorkflowStatus

## Interfaces

### UseWorkflowStatusOptions

Defined in: [src/runtime/vue/composables/use-workflow.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workflow.ts)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="workflowid">
        
      </a>
      
       <code>
        workflowId
      </code>
    </td>
    
    <td>
      <code>
        MaybeRefOrGetter
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        null
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      The workflow to watch (a value, ref or getter). The subscription pauses while it is <code>
        null
      </code>
      
      , <code>
        undefined
      </code>
      
       or blank.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workflow.ts" rel="nofollow">
        src/runtime/vue/composables/use-workflow.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### UseWorkflowStatusReturn

Defined in: [src/runtime/vue/composables/use-workflow.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workflow.ts)

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-query">
        
      </a>
      
       <code>
        Query
      </code>
      
       <em>
        extends
      </em>
      
       | <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      > | <code>
        FunctionReference_future
      </code>
      
      <<code>
        "query"
      </code>
      
      >
    </td>
  </tr>
</tbody>
</table>

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="data">
        
      </a>
      
       <code>
        data
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        FunctionReturnType
      </code>
      
      <<code>
        Query
      </code>
      
      > | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      The status your query returns: <code>
        undefined
      </code>
      
       until the first read lands, while paused, and after a failed read.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workflow.ts" rel="nofollow">
        src/runtime/vue/composables/use-workflow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="isloading">
        
      </a>
      
       <code>
        isLoading
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      <code>
        true
      </code>
      
       until the first read for the current id lands; <code>
        false
      </code>
      
       while paused.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workflow.ts" rel="nofollow">
        src/runtime/vue/composables/use-workflow.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="error">
        
      </a>
      
       <code>
        error
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      < | <a href="https://nuxt-backend.dev/docs/reference/api/functions#backenderror">
        <code>
          BackendError
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Why the read failed, or <code>
        null
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workflow.ts" rel="nofollow">
        src/runtime/vue/composables/use-workflow.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Functions

### useWorkflowStatus()

```ts
function useWorkflowStatus<Query>(query, options): UseWorkflowStatusReturn<Query>;
```

Defined in: [src/runtime/vue/composables/use-workflow.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workflow.ts)

**Experimental**

Reactively track a durable [Workflow](https://www.convex.dev/components/workflow)'s status. Pass a query that takes `{ workflowId }` (wrapping
`workflow.status`) and the id to watch; the subscription pauses while the id
is empty and updates live as the workflow progresses. It never throws: a
failed read shows in `error`.

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-query-1">
        
      </a>
      
       <code>
        Query
      </code>
      
       <em>
        extends
      </em>
      
       | <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      > | <code>
        FunctionReference_future
      </code>
      
      <<code>
        "query"
      </code>
      
      >
    </td>
  </tr>
</tbody>
</table>

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        query
      </code>
    </td>
    
    <td>
      <code>
        Query
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options
      </code>
    </td>
    
    <td>
      <a href="#useworkflowstatusoptions">
        <code>
          UseWorkflowStatusOptions
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

[`UseWorkflowStatusReturn`](#useworkflowstatusreturn)<`Query`>

#### Example

```vue
<script setup lang="ts">
import { useWorkflowStatus } from '#imports'
import { api } from '#backend/api'

const status = useWorkflowStatus(api.workflows.status, { workflowId })
// status.data.value?.type: 'inProgress' | 'completed' | 'failed' | 'canceled'
</script>
```

Tracks the upstream workflow component's status shape, which
is still pre-1.0; may change in a minor release (see STABILITY.md).


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
