> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptjuggler.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a workflow run by ID

> Retrieves the current state of a workflow run, including status, outputs, aggregated token usage, cost, and errors. Poll this endpoint after receiving a webhook notification, or use it to check the status of a run in progress.



## OpenAPI

````yaml /openapi.json get /api/v1/workflowruns/{id}
openapi: 3.1.1
info:
  title: PromptJuggler
  description: PromptJuggler API
  version: 1.0.0
servers:
  - url: https://promptjuggler.com
security:
  - Bearer: []
tags:
  - name: Prompts
    description: Fetch prompts and revisions.
  - name: Prompt Runs
    description: Execute published prompts and retrieve results.
  - name: Workflow Runs
    description: Execute multi-step workflows and retrieve results.
  - name: Knowledge Bases
    description: Upload and manage documents used for retrieval-augmented generation.
paths:
  /api/v1/workflowruns/{id}:
    get:
      tags:
        - Workflow Runs
      summary: Get a workflow run by ID
      description: >-
        Retrieves the current state of a workflow run, including status,
        outputs, aggregated token usage, cost, and errors. Poll this endpoint
        after receiving a webhook notification, or use it to check the status of
        a run in progress.
      operationId: get_workflow_run
      parameters:
        - name: id
          in: path
          description: Workflow run ID
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Workflow Run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRun'
        '401':
          description: Missing or invalid API key
        '403':
          description: No active subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Workflow run not found
      x-codeSamples:
        - lang: PHP
          label: PromptJuggler PHP SDK
          source: $run = $pj->getWorkflowRun('01J...');
        - lang: TypeScript
          label: PromptJuggler TypeScript SDK
          source: const run = await pj.getWorkflowRun('01J...');
        - lang: Python
          label: PromptJuggler Python SDK
          source: run = pj.get_workflow_run('01J...')
        - lang: Java
          label: PromptJuggler Java SDK
          source: WorkflowRun run = pj.getWorkflowRun("01J...");
        - lang: Go
          label: PromptJuggler Go SDK
          source: run, err := pj.GetWorkflowRun(ctx, "01J...")
components:
  schemas:
    WorkflowRun:
      description: Workflow run status and results.
      required:
        - id
        - status
        - createdAt
        - outputs
        - errors
      properties:
        id:
          description: Workflow run ID.
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/RunStatus'
          description: Current run status.
        createdAt:
          description: Timestamp when the run was created.
          type: string
          format: date-time
        finishedAt:
          description: Timestamp when the run finished. Null while the run is pending.
          type:
            - string
            - 'null'
          format: date-time
        outputs:
          description: >-
            Map of output node names to their values. Empty object while
            pending.
          type: object
          additionalProperties:
            type:
              - string
              - 'null'
        errors:
          description: List of error messages from failed nodes. Empty array on success.
          type: array
          items:
            type: string
        tokenUsage:
          description: Aggregated token usage across the workflow run. Null while pending.
          oneOf:
            - $ref: '#/components/schemas/TokenUsage'
            - type: 'null'
        cost:
          description: >-
            Aggregated cost breakdown across the workflow run. Null while
            pending.
          oneOf:
            - $ref: '#/components/schemas/RunCost'
            - type: 'null'
      type: object
    ErrorResponse:
      description: Error response.
      required:
        - error
      properties:
        error:
          description: Error message.
          type: string
      type: object
    RunStatus:
      type: string
      enum:
        - pending
        - completed
        - failed
    TokenUsage:
      required:
        - input
        - inputCached
        - output
        - reasoning
        - total
      properties:
        input:
          type: integer
        inputCached:
          type: integer
        output:
          type: integer
        reasoning:
          type: integer
        total:
          type: integer
        serviceTier:
          $ref: '#/components/schemas/ServiceTier'
      type: object
    RunCost:
      required:
        - success
        - retries
        - total
      properties:
        success:
          $ref: '#/components/schemas/ModelCost'
        retries:
          $ref: '#/components/schemas/ModelCost'
        total:
          type: number
          format: float
      type: object
    ServiceTier:
      type: string
      enum:
        - auto
        - default
        - flex
        - priority
    ModelCost:
      required:
        - input
        - cachedInput
        - output
        - webSearch
        - total
      properties:
        input:
          type: number
          format: float
        cachedInput:
          type: number
          format: float
        output:
          type: number
          format: float
        webSearch:
          type: number
          format: float
        total:
          type: number
          format: float
      type: object
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````