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

# Get workflow by id

> Retrieve a single workflow by its ID within the current organization and workspace.

The response includes workflow metadata and a summary of each workflow step (id, type, execution order, and level). Internal step configuration is not exposed.

Retrieve a single workflow by its ID within the organization and workspace bound
to your API key.

## Request Parameters

### Path Parameters

| Parameter  | Type   | Required | Description            |
| ---------- | ------ | -------- | ---------------------- |
| workflowId | string | Yes      | The ID of the workflow |

## Response Structure

### Workflow Object

| Field         | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| id            | string | Unique workflow identifier           |
| name          | string | Workflow name                        |
| description   | string | Workflow description                 |
| status        | string | Workflow status (e.g. `active`)      |
| workflowSteps | array  | Summary of each step in the workflow |
| createdAt     | string | ISO 8601 timestamp of creation       |
| updatedAt     | string | ISO 8601 timestamp of last update    |

### Workflow Step Summary

| Field              | Type   | Description                                     |
| ------------------ | ------ | ----------------------------------------------- |
| id                 | string | Unique step identifier                          |
| stepType           | string | Step type (e.g. `MATCH_COMPARE`)                |
| stepExecutionOrder | number | Zero-based position of the step in the workflow |
| stepExecutionLevel | string | Level the step executes at (e.g. `DOCUMENT`)    |
| status             | string | Step status (e.g. `active`)                     |

<Note>
  Only the step summary is exposed. Internal step configuration is not returned
  by the public API.
</Note>

## Example Response

```json theme={null}
{
  "workflow": {
    "id": "649e2d2d2d2d2d2d2d2d2d2d",
    "name": "PO <> Invoice",
    "description": "Match purchase orders to invoices",
    "status": "active",
    "createdAt": "2024-10-18T16:45:50.064Z",
    "updatedAt": "2024-10-18T16:45:50.064Z",
    "workflowSteps": [
      {
        "id": "649e2d2d2d2d2d2d2d2d2d2e",
        "stepType": "MATCH_COMPARE",
        "stepExecutionOrder": 0,
        "stepExecutionLevel": "DOCUMENT",
        "status": "active"
      }
    ]
  }
}
```

## Errors

| Status | Meaning                                           |
| ------ | ------------------------------------------------- |
| 404    | No workflow with that ID exists in this workspace |
| 422    | `workflowId` is not a valid identifier            |

See [Error responses](/docs-api/api-errors) for the response shape.


## OpenAPI

````yaml get /prod/v1/workflows/{workflowId}
openapi: 3.0.0
info:
  title: Public API
  description: >-

    ### Welcome to fileAI’s Public API Documentation.

    This API allows users to check the health of the system, upload and manage
    files, and manage AI Schemas.

    Should you have any questions, please reach out to fileAI via the “Contact a
    Developer” link below.



    [Contact a Developer](mailto:support@file.ai)



    ### Prerequisites


    Before using our API, please ensure you complete the following prerequisites

    - You must have a fileAI account. Sign up or login
    [here](https://orion.file.ai/en/sign-up)

    - You must have an API Key. After creating your fileAI account, you can
    generate your API Key. Refer to the Authentication section below for more
    details.



    ### Authentication

    All API requests require an API key for authentication.

    - To obtain your API key, please log in to your fileAI account and navigate
    to Project Settings in your dashboard

    - Keep your API key secure and do not share it publicly.


    ![Authentication](https://static.orion.file.ai/authentication.png)


    ### How to Use Your API Key

    Once you have your API key:

    - Click the Authorize button on the top-right of this page

    - Enter your API Key under Value

    - Click Authorize to start making authenticated requests directly from the
    documentation


    ![How to Use Your API
    Key](https://static.orion.file.ai/how-to-use-api-keys.png)
        
  version: '1.0'
  contact: {}
servers:
  - url: https://api.orion.file.ai
    description: Default. Use this unless your workspace is on an instance.
  - url: https://api.orion.{instance}.file.ai
    description: Instance-specific host.
    variables:
      instance:
        default: au
        enum:
          - au
          - sg
          - jp
        description: >-
          Instance hosting your workspace: au (Australia), sg (Singapore), jp
          (Japan).
security: []
tags:
  - name: Public API V1
paths:
  /prod/v1/workflows/{workflowId}:
    get:
      tags:
        - Public API V1
      summary: Get workflow by id
      description: >-
        Retrieve a single workflow by its ID within the current organization and
        workspace.


        The response includes workflow metadata and a summary of each workflow
        step (id, type, execution order, and level). Internal step configuration
        is not exposed.
      operationId: PublicAPIController_getWorkflowById
      parameters:
        - name: workflowId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: The workflow is retrieved
          content:
            application/json:
              example:
                workflow:
                  id: 649e2d2d2d2d2d2d2d2d2d2d
                  name: PO <> Invoice
                  description: Match purchase orders to invoices
                  status: active
                  createdAt: '2024-10-18T16:45:50.064Z'
                  updatedAt: '2024-10-18T16:45:50.064Z'
                  workflowSteps:
                    - id: 649e2d2d2d2d2d2d2d2d2d2e
                      stepType: MATCH_COMPARE
                      stepExecutionOrder: 0
                      stepExecutionLevel: DOCUMENT
                      status: active
              schema:
                type: object
                properties:
                  workflow:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                        nullable: true
                      description:
                        type: string
                        nullable: true
                      status:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      workflowSteps:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            stepType:
                              type: string
                            stepExecutionOrder:
                              type: number
                            stepExecutionLevel:
                              type: string
                            status:
                              type: string
        '401':
          description: Missing or invalid API key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetailsDto'
        '403':
          description: Read-only or inactive API key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetailsDto'
        '404':
          description: Workflow not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetailsDto'
              example:
                type: https://errors.file.ai/not-found
                title: Not found
                status: 404
                detail: Workflow with id 649e2d2d2d2d2d2d2d2d2d2d not found
                instance: /v1/{route}
                code: NOT_FOUND
                requestId: 0f1c8e03-978e-40d5-bc93-6894a57f9324
                errors: []
                message: Workflow with id 649e2d2d2d2d2d2d2d2d2d2d not found
                error: Not Found
                statusCode: 404
        '422':
          description: Invalid workflowId.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetailsDto'
              example:
                type: https://errors.file.ai/validation-failed
                title: Validation failed
                status: 422
                detail: Invalid workflowId.
                instance: /v1/{route}
                code: VALIDATION_FAILED
                requestId: 0f1c8e03-978e-40d5-bc93-6894a57f9324
                errors: []
                message: Invalid workflowId.
                error: Unprocessable Entity
                statusCode: 422
        '429':
          description: Rate limit exceeded.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetailsDto'
        '500':
          description: Unexpected internal error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetailsDto'
      security:
        - x-api-key: []
components:
  schemas:
    ProblemDetailsDto:
      type: object
      properties:
        type:
          type: string
          description: A URI identifying the problem type.
          example: https://errors.file.ai/validation-failed
        title:
          type: string
          description: Stable, human-readable summary of the problem type.
          example: Validation failed
        status:
          type: number
          description: HTTP status code.
          example: 422
        detail:
          type: string
          description: Human-readable explanation specific to this occurrence.
          example: One or more fields are invalid.
        instance:
          type: string
          description: URI reference for this occurrence (the request path).
          example: /v1/files/upload
        code:
          type: string
          description: Stable machine-readable error code.
          example: VALIDATION_FAILED
        requestId:
          type: string
          description: Correlation id for this request.
          example: 0f1c8e03-978e-40d5-bc93-6894a57f9324
        errors:
          description: Field-level violations (validation only).
          type: array
          items:
            $ref: '#/components/schemas/ProblemErrorItemDto'
        retryAfter:
          type: number
          description: Seconds until the client may retry (present on 429 only).
          example: 42
        message:
          type: string
          description: Legacy key (deprecated — use `detail`/`title`).
          example: Validation failed
        error:
          type: string
          description: Legacy key (deprecated — use `title`).
          example: Unprocessable Entity
        statusCode:
          type: number
          description: Legacy key (deprecated — use `status`).
          example: 422
      required:
        - type
        - title
        - status
        - detail
        - instance
        - code
        - requestId
        - errors
        - message
        - error
        - statusCode
    ProblemErrorItemDto:
      type: object
      properties:
        code:
          type: string
          example: REQUIRED
        detail:
          type: string
          example: must not be empty
        pointer:
          type: string
          description: JSON Pointer to the offending body field.
          example: '#/fileName'
        parameter:
          type: string
          description: Name of the offending query/header parameter.
          example: limit
      required:
        - code
        - detail
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````