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

# Retrieve optimization workflow status

> Returns the current state of an optimization workflow, including `status`, `current_step`, `current_hitl_gate` (when the workflow is paused at a review gate), per-phase progress, and aggregated review and reviewer summaries.

Poll this endpoint to track a workflow through its lifecycle. A `401` response indicates that the access token has expired; re-authenticate and retry the request.

The `status` value progresses through `PENDING`, then `RUNNING` or `IN_PROGRESS`, then `REVIEW_PENDING` when paused at a human-in-the-loop gate, and ultimately `COMPLETED`. `FAILED` and `CANCELLED` are terminal alternatives.

**When `status` is `REVIEW_PENDING`**, the value of `current_hitl_gate` identifies the active gate. Gate approval is performed in the [CommerceOS](https://commerceos.fabric.inc) web application — direct the assigned reviewer to CommerceOS to evaluate and approve the gate. Once the reviewer acts, the workflow resumes and subsequent polls reflect the new state.




## OpenAPI

````yaml product-agent.openapi get /v2/optimize/workflows/{workflow_id}
openapi: 3.0.1
info:
  contact:
    email: support@fabric.inc
    name: fabric Support Team
  description: >
    The Product Agent API helps brands optimize product data for AI-driven
    commerce.

    Monitor how your catalog performs in AI search experiences, enrich product

    content for stronger semantic visibility, and publish optimized data across

    channels. Designed for iterative improvement, Product Agent enables teams to

    measure, refine, and enhance product content as AI shopping behavior
    evolves.
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
  title: fabric Orders API
  version: 3.0.0
  x-audience: external-public
servers:
  - url: https://commerceos.aiagents.fabric.inc/api
    description: Production API
security:
  - authorization: []
externalDocs:
  description: Find out more about Product Agent.
  url: https://developer.fabric.inc/product-agent/overview
paths:
  /v2/optimize/workflows/{workflow_id}:
    get:
      summary: Retrieve optimization workflow status
      description: >
        Returns the current state of an optimization workflow, including
        `status`, `current_step`, `current_hitl_gate` (when the workflow is
        paused at a review gate), per-phase progress, and aggregated review and
        reviewer summaries.


        Poll this endpoint to track a workflow through its lifecycle. A `401`
        response indicates that the access token has expired; re-authenticate
        and retry the request.


        The `status` value progresses through `PENDING`, then `RUNNING` or
        `IN_PROGRESS`, then `REVIEW_PENDING` when paused at a human-in-the-loop
        gate, and ultimately `COMPLETED`. `FAILED` and `CANCELLED` are terminal
        alternatives.


        **When `status` is `REVIEW_PENDING`**, the value of `current_hitl_gate`
        identifies the active gate. Gate approval is performed in the
        [CommerceOS](https://commerceos.fabric.inc) web application — direct the
        assigned reviewer to CommerceOS to evaluate and approve the gate. Once
        the reviewer acts, the workflow resumes and subsequent polls reflect the
        new state.
      operationId: getOptimizeWorkflowStatus
      parameters:
        - $ref: '#/components/parameters/DomainHeader'
        - name: workflow_id
          in: path
          required: true
          description: Workflow identifier returned by `POST /v2/optimize/workflows`.
          schema:
            type: string
            example: 9349773c-27fe-4d4f-a093-a5793dff8702
      responses:
        '200':
          description: Workflow state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptimizeWorkflowResponse'
              example:
                id: 9349773c-27fe-4d4f-a093-a5793dff8702
                brand_id: 691df5949676c8e0b1d7b6b3
                type: OPTIMIZE
                origin: API
                workflow_type: null
                status: REVIEW_PENDING
                current_step: TAXONOMY_MAP
                current_hitl_gate: TAXONOMY_REVIEW
                name: Spring 2026 catalog enrichment
                tags: []
                started_at: '2026-05-15T10:35:12Z'
                completed_at: null
                last_error: null
                retry_count: 0
                workflow_metadata: null
                progress:
                  current_phase: taxonomy
                  current_step: TAXONOMY_MAP
                  current_gate: TAXONOMY_REVIEW
                  phases:
                    validation:
                      status: COMPLETED
                    taxonomy:
                      status: REVIEW_PENDING
                    enrichment:
                      status: NOT_STARTED
                    publish:
                      status: NOT_STARTED
                review_summary:
                  total_categories: 12
                  decided_categories: 3
                  pending_categories: 9
                  rerunning_categories: 0
                  rejected_categories: 0
                  ready_for_publish_categories: 0
                  published_categories: 0
                reviewer_summary:
                  - reviewer_user_id: user_xyz
                    name: Alex Reviewer
                    email: alex@acme.com
                    first_name: Alex
                    last_name: Reviewer
                    category_ids:
                      - cat_apparel
                      - cat_outerwear
                    categories_at_open_gate: 2
                    current_gate: TAXONOMY_REVIEW
                created_by:
                  id: user_xyz
                  type: user
                  name: Integration Bot
                  email: integration@acme.com
                updated_by:
                  id: user_xyz
                  type: user
                  name: Integration Bot
                  email: integration@acme.com
                created_at: '2026-05-15T10:35:00Z'
                updated_at: '2026-05-15T10:42:08Z'
        '401':
          description: Unauthorized. The access token is missing or has expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '403':
          description: Forbidden. The workflow belongs to a different brand.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          description: Workflow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    DomainHeader:
      name: domain
      in: header
      required: true
      schema:
        type: string
        example: vessel.com
      description: >-
        The brand domain name (for example, `vessel.com` or
        `containerstore.com`) used to scope the request to a specific brand's
        data and configuration. The authenticated principal must be authorized
        for the specified brand.
  schemas:
    OptimizeWorkflowResponse:
      type: object
      required:
        - id
        - brand_id
        - status
        - created_at
        - updated_at
      description: >
        Workflow state envelope returned by `POST /v2/optimize/workflows` and
        `GET /v2/optimize/workflows/{workflow_id}`. The `status` value
        progresses through `PENDING`, then `RUNNING` or `IN_PROGRESS`, then
        `REVIEW_PENDING`, and ultimately `COMPLETED`. `FAILED` and `CANCELLED`
        are terminal alternatives.
      properties:
        id:
          type: string
          description: >-
            Workflow identifier. Use this value to poll for status and to
            construct deep links into the Commerce OS UI.
          example: 9349773c-27fe-4d4f-a093-a5793dff8702
        brand_id:
          type: string
          example: 691df5949676c8e0b1d7b6b3
        type:
          type: string
          nullable: true
          example: OPTIMIZE
        origin:
          type: string
          nullable: true
          enum:
            - COMMERCEOS
            - API
          example: API
        workflow_type:
          type: string
          nullable: true
          example: null
        status:
          type: string
          description: Current lifecycle state.
          enum:
            - PENDING
            - RUNNING
            - IN_PROGRESS
            - REVIEW_PENDING
            - COMPLETED
            - FAILED
            - CANCELLED
          example: REVIEW_PENDING
        current_step:
          type: string
          nullable: true
          description: >
            Current step in the workflow. One of `VALIDATE` / `VALIDATION`,
            `TAXONOMY_MAP` / `TAXONOMY`, `ENRICH` / `ENRICHMENT`, or `PUBLISH` /
            `PUBLISHED`.
          example: TAXONOMY_MAP
        current_hitl_gate:
          type: string
          nullable: true
          description: >
            Active human-in-the-loop review gate. Populated when `status` is
            `REVIEW_PENDING`. One of `VALIDATION_REVIEW`, `TAXONOMY_REVIEW`,
            `SAMPLE_REVIEW`, `ENRICHMENT_SAMPLE_REVIEW`,
            `FULL_ENRICHMENT_REVIEW`, `ENRICHMENT_FULL_REVIEW`, or
            `PUBLISH_APPROVAL`.
          example: TAXONOMY_REVIEW
        name:
          type: string
          nullable: true
          example: Spring 2026 catalog enrichment
        tags:
          type: array
          items: {}
          example: []
        started_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-05-15T10:35:12Z'
        completed_at:
          type: string
          format: date-time
          nullable: true
          example: null
        last_error:
          type: string
          nullable: true
          description: Most recent error message. Populated when `status` is `FAILED`.
          example: null
        retry_count:
          type: integer
          default: 0
          example: 0
        workflow_metadata:
          type: object
          nullable: true
          additionalProperties: true
        progress:
          allOf:
            - $ref: '#/components/schemas/WorkflowProgress'
          nullable: true
        review_summary:
          $ref: '#/components/schemas/WorkflowReviewSummary'
        reviewer_summary:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowReviewerSummaryResponse'
        created_by:
          allOf:
            - $ref: '#/components/schemas/AuditPrincipal'
          nullable: true
        updated_by:
          allOf:
            - $ref: '#/components/schemas/AuditPrincipal'
          nullable: true
        created_at:
          type: string
          format: date-time
          example: '2026-05-15T10:35:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-05-15T10:42:08Z'
    errorResponse:
      description: Error response
      properties:
        errors:
          description: Errors
          items:
            $ref: '#/components/schemas/errorResponse'
          type: array
        message:
          description: Error message
          example: Bad request
          type: string
        type:
          description: Error type
          example: CLIENT_ERROR
          type: string
      type: object
    WorkflowProgress:
      type: object
      description: >
        Phase-keyed progress for the workflow, computed at read time. The
        `phases` object contains one key per phase (`validation`, `taxonomy`,
        `enrichment`, `publish`), each carrying a phase-specific structure.
      properties:
        current_phase:
          type: string
          nullable: true
          example: taxonomy
        current_step:
          type: string
          nullable: true
          example: TAXONOMY_MAP
        current_gate:
          type: string
          nullable: true
          example: TAXONOMY_REVIEW
        phases:
          type: object
          additionalProperties: true
          description: >-
            Phase-keyed progress map. Keys are `validation`, `taxonomy`,
            `enrichment`, `publish`; each value is a phase-specific progress
            object.
    WorkflowReviewSummary:
      type: object
      description: >
        Aggregate counts across categories at the current enrichment-side review
        gate. This summary supports diagnosing which categories are blocking
        progression. For non-enrichment gates (taxonomy, validation, publish)
        the counts are typically zero, because those gates are workflow-level
        rather than per-category.
      properties:
        total_categories:
          type: integer
          default: 0
        decided_categories:
          type: integer
          default: 0
        pending_categories:
          type: integer
          default: 0
        rerunning_categories:
          type: integer
          default: 0
        rejected_categories:
          type: integer
          default: 0
        ready_for_publish_categories:
          type: integer
          default: 0
        published_categories:
          type: integer
          default: 0
    WorkflowReviewerSummaryResponse:
      type: object
      required:
        - reviewer_user_id
      description: >-
        Per-reviewer summary included in the workflow response. The `name` and
        `email` fields are resolved from `auth_users` at read time.
      properties:
        reviewer_user_id:
          type: string
          example: user_xyz
        name:
          type: string
          nullable: true
          example: Alex Reviewer
        email:
          type: string
          nullable: true
          example: alex@acme.com
        first_name:
          type: string
          nullable: true
          example: Alex
        last_name:
          type: string
          nullable: true
          example: Reviewer
        category_ids:
          type: array
          items:
            type: string
          example:
            - cat_apparel
            - cat_outerwear
        categories_at_open_gate:
          type: integer
          default: 0
          example: 2
        current_gate:
          type: string
          nullable: true
          example: TAXONOMY_REVIEW
    AuditPrincipal:
      type: object
      required:
        - id
        - type
      description: >
        Resolved reference for the `created_by` and `updated_by` audit fields. A
        `type` of `unknown` is returned when the referenced identifier can no
        longer be resolved (for example, when a user has been hard-deleted).
      properties:
        id:
          type: string
          description: Either `auth_users.id` or `auth_service_clients.client_id`.
          example: user_xyz
        type:
          type: string
          enum:
            - user
            - service
            - unknown
          description: >-
            Indicates the principal type: `user` for end-user actors, `service`
            for machine clients, and `unknown` when the principal cannot be
            resolved.
        name:
          type: string
          nullable: true
          description: Display name. Null when `type` is `unknown`.
          example: Alex Reviewer
        email:
          type: string
          nullable: true
          description: Email address. Null when `type` is `service` or `unknown`.
          example: alex@acme.com
  securitySchemes:
    authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````