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

Version: nuxt-backend 0.6.x · Tab: Reference · Kind: reference · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

## Interfaces

### JobProgress

Defined in: [src/convex/integrations/ai/jobs.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts)

How far a job got, as `job.progress` reports it.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="done">
        
      </a>
      
       <code>
        done
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="total">
        
      </a>
      
       <code>
        total
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="label">
        
      </a>
      
       <code>
        label?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### JobView

Defined in: [src/convex/integrations/ai/jobs.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts)

A job as `getJob` reads it, for `useJob`.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="id">
        
      </a>
      
       <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="kind">
        
      </a>
      
       <code>
        kind
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="status">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        "failed"
      </code>
      
       | <code>
        "canceled"
      </code>
      
       | <code>
        "running"
      </code>
      
       | <code>
        "queued"
      </code>
      
       | <code>
        "done"
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="waitingon">
        
      </a>
      
       <code>
        waitingOn?
      </code>
    </td>
    
    <td>
      <code>
        "owner"
      </code>
      
       | <code>
        "paused"
      </code>
      
       | <code>
        "line"
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="position">
        
      </a>
      
       <code>
        position?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="estimatedwait">
        
      </a>
      
       <code>
        estimatedWait?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="progress">
        
      </a>
      
       <code>
        progress?
      </code>
    </td>
    
    <td>
      <a href="#jobprogress">
        <code>
          JobProgress
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="result">
        
      </a>
      
       <code>
        result?
      </code>
    </td>
    
    <td>
      <code>
        unknown
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="error">
        
      </a>
      
       <code>
        error?
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Why it failed, as a catalog error payload: <code>
        { code, ...fields }
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="joinedat">
        
      </a>
      
       <code>
        joinedAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="startedat">
        
      </a>
      
       <code>
        startedAt?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="endedat">
        
      </a>
      
       <code>
        endedAt?
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cancancel">
        
      </a>
      
       <code>
        canCancel
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether the caller may cancel it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="provenance">
        
      </a>
      
       <code>
        provenance?
      </code>
    </td>
    
    <td>
      <a href="#jobprovenance">
        <code>
          JobProvenance
        </code>
      </a>
    </td>
    
    <td>
      What made its result, once it is <code>
        done
      </code>
      
       and <code>
        setupAi({ provenance })
      </code>
      
       is on: the models its steps called, when it finished, and the ids of the inputs its <code>
        ctx.storeImage
      </code>
      
       calls named.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="charged">
        
      </a>
      
       <code>
        charged
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      The credits it was charged so far: its <code>
        cost
      </code>
      
       once charged at start, what <code>
        job.charge
      </code>
      
       charged for a kind charged by output, <code>
        0
      </code>
      
       before a charge. A failed or canceled job's refund may still be on its way.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="free">
        
      </a>
      
       <code>
        free
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Put in line <code>
        { free: true }
      </code>
      
      : it holds, charges and counts nothing.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="owed">
        
      </a>
      
       <code>
        owed?
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/reference/api/ai#jobowed">
        <code>
          JobOwed
        </code>
      </a>
    </td>
    
    <td>
      A charge it still owes, for a kind charged by output whose <code>
        job.charge
      </code>
      
       the provider refused: the credits, and whether the queue gave up trying (<code>
        givenUp
      </code>
      
      , after its last try or at once for a refusal no try changes) or still tries. <code>
        charged
      </code>
      
       reads <code>
        0
      </code>
      
       until it lands. Absent when nothing is owed.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/jobs.ts" rel="nofollow">
        src/convex/integrations/ai/jobs.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### JobProvenance

Defined in: [src/convex/integrations/ai/provenance.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/provenance.ts)

What made a result: the models its calls went to, when it finished, and the ids of its inputs.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="models">
        
      </a>
      
       <code>
        models
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/provenance.ts" rel="nofollow">
        src/convex/integrations/ai/provenance.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="finishedat">
        
      </a>
      
       <code>
        finishedAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/provenance.ts" rel="nofollow">
        src/convex/integrations/ai/provenance.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="inputs">
        
      </a>
      
       <code>
        inputs
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      Ids of your own rows and files it was made from, never their content.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/ai/provenance.ts" rel="nofollow">
        src/convex/integrations/ai/provenance.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### JobApiRefs

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

The job functions re-exported from your `backend/jobs.ts`.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="getjob">
        
      </a>
      
       <code>
        getJob?
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "public"
      </code>
      
      , { <code>
        jobId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#jobview">
        <code>
          JobView
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="canceljob">
        
      </a>
      
       <code>
        cancelJob?
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "public"
      </code>
      
      , { <code>
        jobId
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        refund?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }, <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### UseJobOptions

Defined in: [src/runtime/vue/composables/use-job.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.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="api">
        
      </a>
      
       <code>
        api?
      </code>
    </td>
    
    <td>
      <a href="#jobapirefs">
        <code>
          JobApiRefs
        </code>
      </a>
    </td>
    
    <td>
      Override the injected <code>
        api.jobs
      </code>
      
       namespace.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### UseJobReturn

Defined in: [src/runtime/vue/composables/use-job.ts](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.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="status-1">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        "failed"
      </code>
      
       | <code>
        "canceled"
      </code>
      
       | <code>
        "running"
      </code>
      
       | <code>
        "queued"
      </code>
      
       | <code>
        "done"
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      Where the job is; <code>
        undefined
      </code>
      
       while it loads, and for a job the caller may not read.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="waitingon-1">
        
      </a>
      
       <code>
        waitingOn
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        "owner"
      </code>
      
       | <code>
        "paused"
      </code>
      
       | <code>
        "line"
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      What holds a waiting job: a slot (<code>
        'line'
      </code>
      
      ), its owner's other jobs (<code>
        'owner'
      </code>
      
      ) or a paused queue (<code>
        'paused'
      </code>
      
      ); <code>
        undefined
      </code>
      
       once it runs.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="position-1">
        
      </a>
      
       <code>
        position
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        number
      </code>
      
       | <code>
        null
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      About its place in line while it waits, <code>
        1
      </code>
      
       starts next; <code>
        null
      </code>
      
       past 100 jobs ahead, while <code>
        'owner'
      </code>
      
       or <code>
        'paused'
      </code>
      
      , and once it runs.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="estimatedwait-1">
        
      </a>
      
       <code>
        estimatedWait
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        number
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      About how long until it starts, in ms; <code>
        undefined
      </code>
      
       while paused, once it runs, and before any job has finished.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="progress-1">
        
      </a>
      
       <code>
        progress
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<a href="#jobprogress">
        <code>
          JobProgress
        </code>
      </a>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      What the job last reported with <code>
        job.progress
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="result-1">
        
      </a>
      
       <code>
        result
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      What its handler returned, once it is <code>
        done
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="provenance-1">
        
      </a>
      
       <code>
        provenance
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<a href="#jobprovenance">
        <code>
          JobProvenance
        </code>
      </a>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      What made the result, once it is <code>
        done
      </code>
      
       and <code>
        setupAi({ provenance })
      </code>
      
       is on: the models its steps called, when it finished, and the ids of its inputs. <code>
        <AiLabel :provenance>
      </code>
      
       shows it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="error-1">
        
      </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 it failed, as a catalog error whose message is safe to show; <code>
        null
      </code>
      
       otherwise.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cancancel-1">
        
      </a>
      
       <code>
        canCancel
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      Whether the caller may cancel it now.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cancel">
        
      </a>
      
       <code>
        cancel
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Take it out of line and release its hold; a running job stops after its current step, and stays charged.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-job.ts" rel="nofollow">
        src/runtime/vue/composables/use-job.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Functions

### useJob()

```ts
function useJob(jobId, options?): UseJobReturn;
```

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

**Experimental**

One queued job, live: its status, what holds it and its place in line
while it waits, its progress while it runs, and its result or the reason
it failed. Reads through `getJob` and `cancelJob` of `backend/jobs.ts`,
and pauses while the id is empty.

#### Parameters

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

<tbody>
  <tr>
    <td>
      <code>
        jobId
      </code>
    </td>
    
    <td>
      <code>
        MaybeRefOrGetter
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        null
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options?
      </code>
    </td>
    
    <td>
      <a href="#usejoboptions">
        <code>
          UseJobOptions
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

[`UseJobReturn`](#usejobreturn)

#### Example

```vue
<script setup lang="ts">
const strip = useQuery(api.strips.get, () => ({ id: route.params.id as string }))
const job = useJob(() => strip.value?.jobId)
</script>
<template>
  <p v-if="job.waitingOn.value === 'line'">Number {{ job.position.value ?? '100+' }} in line</p>
  <progress v-else-if="job.status.value === 'running'" :value="job.progress.value?.done" :max="job.progress.value?.total" />
</template>
```


## Sitemap

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