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

# Get run window

> Returns the workflow's run window and whether it is open right now. When the workflow has no run window, both `run_window` and `state` are `null`.

See [Run Window](/concepts/run-window).



## OpenAPI

````yaml workflow-api/workflow-api.yaml get /workflows/{workflow_id}/run-window
openapi: 3.0.0
info:
  title: Workflow API
  version: 1.0.0
  description: API for managing workflows and their metadata
servers:
  - url: https://api.cloudcruise.com
    description: CloudCruise Platform Production API Server
security:
  - AuthScheme: []
paths:
  /workflows/{workflow_id}/run-window:
    get:
      summary: Get run window
      description: >-
        Returns the workflow's run window and whether it is open right now. When
        the workflow has no run window, both `run_window` and `state` are
        `null`.


        See [Run Window](/concepts/run-window).
      operationId: getRunWindow
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the workflow
        - name: cc-key
          in: header
          required: false
          schema:
            type: string
          description: CloudCruise API key for authentication
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunWindowResponse'
        '401':
          description: Unauthorized - Invalid or missing authentication
        '404':
          description: Workflow not found
components:
  schemas:
    RunWindowResponse:
      type: object
      properties:
        run_window:
          allOf:
            - $ref: '#/components/schemas/RunWindow'
          nullable: true
        state:
          allOf:
            - $ref: '#/components/schemas/RunWindowState'
          nullable: true
    RunWindow:
      type: object
      description: >-
        A run window. For any date, dated special hours win over recurring
        special hours, which win over regular hours. Needs at least one regular
        period or one active special entry.
      required:
        - time_zone
        - regular_hours
      properties:
        time_zone:
          type: string
          example: America/Chicago
          description: IANA time zone the hours are evaluated in
        regular_hours:
          type: array
          items:
            $ref: '#/components/schemas/RunWindowRegularPeriod'
        special_hours:
          type: array
          items:
            $ref: '#/components/schemas/RunWindowSpecialHours'
    RunWindowState:
      type: object
      properties:
        open:
          type: boolean
          description: Whether runs may start right now
        nextOpenAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the window next opens. `null` when it is open now, or when no
            opening falls within the next 400 days.
    RunWindowRegularPeriod:
      type: object
      description: >-
        One weekly period. It belongs to the day it starts and may end on the
        next day.
      required:
        - active_start_day
        - active_start_time
        - active_end_day
        - active_end_time
      properties:
        active_start_day:
          $ref: '#/components/schemas/RunWindowDay'
        active_start_time:
          $ref: '#/components/schemas/RunWindowTime'
        active_end_day:
          $ref: '#/components/schemas/RunWindowDay'
        active_end_time:
          $ref: '#/components/schemas/RunWindowTime'
    RunWindowSpecialHours:
      type: object
      description: >-
        Overrides the weekly hours for particular dates. Provide either
        `start_date` (with optional `end_date`) or `recurrence` with
        `recurrence_start`, never both. When `active` is `true`,
        `active_start_time` and `active_end_time` are required and the end must
        be after the start.
      required:
        - active
      properties:
        label:
          type: string
          example: Thanksgiving
        start_date:
          $ref: '#/components/schemas/RunWindowDate'
        end_date:
          allOf:
            - $ref: '#/components/schemas/RunWindowDate'
          description: Last day of a dated entry. Defaults to `start_date`.
        recurrence:
          type: string
          example: FREQ=MONTHLY;BYDAY=1SA
          description: >-
            RFC 5545 rule. Only DAILY, WEEKLY, MONTHLY and YEARLY frequencies
            are supported.
        recurrence_start:
          $ref: '#/components/schemas/RunWindowDate'
        active:
          type: boolean
          description: >-
            `true` opens the hours on matching dates, `false` closes them for
            the whole date
        active_start_time:
          $ref: '#/components/schemas/RunWindowTime'
        active_end_time:
          $ref: '#/components/schemas/RunWindowTime'
    RunWindowDay:
      type: string
      enum:
        - MONDAY
        - TUESDAY
        - WEDNESDAY
        - THURSDAY
        - FRIDAY
        - SATURDAY
        - SUNDAY
    RunWindowTime:
      type: object
      required:
        - hours
      properties:
        hours:
          type: integer
          minimum: 0
          maximum: 23
        minutes:
          type: integer
          minimum: 0
          maximum: 59
          description: Defaults to 0
    RunWindowDate:
      type: object
      required:
        - year
        - month
        - day
      properties:
        year:
          type: integer
        month:
          type: integer
          minimum: 1
          maximum: 12
        day:
          type: integer
          minimum: 1
          maximum: 31
  securitySchemes:
    AuthScheme:
      type: apiKey
      name: cc-key
      in: header
      description: >-
        API key-based authentication. Provide your CloudCruise API key in the
        cc-key header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.