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

# WaitRun

> Waits up to 25 seconds, within clients' default request timeout, for the Run to
 finish, and answers it then, or as it stands.



## OpenAPI

````yaml /http-api-reference/openapi.json post /outerproduct.run.v1alpha.RunService/WaitRun
openapi: 3.1.0
info:
  title: OuterProduct Control Plane API
  description: >-
    Control-plane Connect RPCs over HTTP with ProtoJSON request and response
    bodies.
  version: v1alpha
servers:
  - url: https://api.outerproduct.com
security:
  - bearerAuth: []
tags:
  - name: ApiKey
    description: |-
      Manages the current user's application-owned personal access tokens.
       External sign-in is required; personal and execution tokens cannot manage keys.
  - name: BillingAccount
    description: >-
      How a workspace pays: its prepaid balance, topped up through the payment
      processor and spent
       by its usage.
  - name: Image
    description: >-
      The image registry: OCI distribution over its storage, whose formats are
      its own. The
       control plane serves it to users, admitting each only to their workspace's repository, and
       forwards to the OCI registry. Manifests and blobs are addressed by digest and never
       replaced; tags name manifests.
  - name: ImageBuilder
    description: >-
      Builds Images from image specs, and runs their install steps, each adding
      layers to its
       parent image, and package builds, each one pinned package's layer on its base, which
       install steps merge rather than install. The control plane serves `SubmitImageBuild`
       and `WaitImageBuild` to users, and forwards them to the scheduler's, which imports each
       image spec's base through the OCI registry, places each install step and package build on a
       node that builds, and tags the image it built in its workspace's repository. Those nodes
       serve the steps to the scheduler, by the scheduler's certificate, and run each in the
       sandbox the scheduler placed it in.
  - name: Policy
    description: >-
      Resource access policies evaluated by the application's Cedar authorizer.
      A policy belongs to
       the workspace of the credential that created it and governs only that workspace and what it
       owns; deployment-wide grants belong to the operator's policy.
  - name: Run
    description: >-
      Submits and observes product Runs, their Calls, and the Calls' Attempts.
      Every Run
       owns one rooted Call tree.
  - name: Secret
  - name: User
    description: / User crud service
  - name: Volume
  - name: Workspace
    description: >-
      The workspace a request's credential is bound to, and its members. A
      session starts bound
       to its user's workspace and may switch to another the user belongs to; an API key stays bound
       to the workspace it was created in. Requests act in the bound workspace.
paths:
  /outerproduct.run.v1alpha.RunService/WaitRun:
    post:
      tags:
        - Run
      summary: WaitRun
      description: >-
        Waits up to 25 seconds, within clients' default request timeout, for the
        Run to
         finish, and answers it then, or as it stands.
      operationId: outerproduct.run.v1alpha.RunService.WaitRun
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/outerproduct.run.v1alpha.WaitRunRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/outerproduct.run.v1alpha.Run'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
components:
  schemas:
    connect-protocol-version:
      type: number
      examples:
        - 1
      title: Connect-Protocol-Version
      description: Define the version of the Connect protocol
      const: 1
    connect-timeout-header:
      type: number
      examples:
        - 1000
      title: Connect-Timeout-Ms
      description: Define the timeout, in ms
    outerproduct.run.v1alpha.WaitRunRequest:
      type: object
      properties:
        name:
          type: string
          title: name
      title: WaitRunRequest
      additionalProperties: false
    outerproduct.run.v1alpha.Run:
      type: object
      properties:
        name:
          type: string
          title: name
          description: Resource name in the form `runs/{run}`.
        state:
          allOf:
            - $ref: '#/components/schemas/outerproduct.run.v1alpha.Run.State'
          title: state
          description: State of the root Call.
        spec:
          allOf:
            - $ref: '#/components/schemas/outerproduct.run.v1alpha.RunSpec'
          title: spec
          description: What the client submits to start the Run.
        rootCall:
          type: string
          title: root_call
          description: Root Call of this Run.
        displayName:
          type: string
          title: display_name
          description: Display label, defaulting to the root Call's function name.
        summary:
          allOf:
            - $ref: '#/components/schemas/outerproduct.run.v1alpha.RunSummary'
          title: summary
          description: Populated only by GetRun with include_summary.
        output:
          type:
            - string
            - 'null'
          title: output
          format: byte
          description: cloudpickle of the root Call's successful return value.
        outputRepr:
          type:
            - string
            - 'null'
          title: output_repr
          description: Truncated `repr` of the root Call's successful return value.
        created_by:
          type:
            - string
            - 'null'
          title: created_by
          description: User that submitted this Run.
        created_at:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
        updated_at:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: updated_at
        errorMessage:
          type:
            - string
            - 'null'
          title: error_message
          description: Terminal failure or cancellation explanation, when one exists.
        workspace:
          type: string
          title: workspace
          description: >-
            The workspace that owns the Run and pays for it, its creating
            credential's.

             cf. Zitadel `resource_owner`; Modal apps belong to a workspace.
        finished_at:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: finished_at
          description: Completion time of the root Call; unset while the Run is active.
      title: Run
      additionalProperties: false
      description: |-
        A product-level container for one tree of function Calls.

         A Run supplies product ownership, submission identity, discovery,
         cancellation, and the root result. Its Call tree, and the execution dispatches
         summarized by those Calls, are its children.
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/connect.error_details.Any'
          description: >-
            A list of messages that carry the error details. There is no limit
            on the number of messages.
      title: Connect Error
      additionalProperties: true
      description: >-
        Error type returned by Connect:
        https://connectrpc.com/docs/go/errors/#http-representation
    outerproduct.run.v1alpha.Run.State:
      type: string
      title: State
      enum:
        - STATE_UNSPECIFIED
        - STATE_RUNNING
        - STATE_COMPLETED
        - STATE_FAILED
        - STATE_CANCELLED
        - STATE_CANCELLING
    outerproduct.run.v1alpha.RunSpec:
      type: object
      properties:
        call:
          allOf:
            - $ref: '#/components/schemas/outerproduct.run.v1alpha.CallSpec'
          title: call
          description: The root Call.
        objects:
          type: object
          title: objects
          additionalProperties:
            type: string
            title: value
          description: |-
            The server identity of each module-level Python object in the root
             function's module, by `module:name`. Every Attempt gives these identities
             to the objects its import re-creates; an Image's is the Image converted
             from its local files.
      title: RunSpec
      additionalProperties: false
      description: What a client submits to start a Run.
    outerproduct.run.v1alpha.RunSummary:
      type: object
      properties:
        callCount:
          type: string
          title: call_count
          format: int64
        attemptCount:
          type: string
          title: attempt_count
          format: int64
        completedCallCount:
          type: string
          title: completed_call_count
          format: int64
      title: RunSummary
      additionalProperties: false
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2023-01-15T01:30:15.01Z'
        - '2024-12-25T12:00:00Z'
      format: date-time
      description: >-
        A point in time in RFC 3339 format, with up to nanosecond precision.
        Output uses UTC (`Z`); input may use an offset from UTC.
    connect.error_details.Any:
      type: object
      properties:
        type:
          type: string
          description: >-
            A URL that acts as a globally unique identifier for the type of the
            serialized message. For example:
            `type.googleapis.com/google.rpc.ErrorInfo`.
        value:
          type: string
          format: binary
          description: >-
            The Protobuf message, serialized as bytes and base64-encoded. The
            specific message type is identified by the `type` field.
        debug:
          type: object
          title: Debug
          additionalProperties: true
          description: >-
            Deserialized error detail payload. The 'type' field indicates the
            schema. This field is for easier debugging and should not be relied
            upon for application logic.
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message, with an additional debug
        field for ConnectRPC error details.
    outerproduct.run.v1alpha.CallSpec:
      type: object
      properties:
        function:
          type: string
          title: function
          minLength: 1
          description: |-
            `module:qualname` of the callable, which each Attempt imports with
             `pkgutil.resolve_name` from its `file_mounts`.
        arguments:
          type: string
          title: arguments
          format: byte
          description: cloudpickle of `(args, kwargs)`.
        computeSpec:
          allOf:
            - $ref: '#/components/schemas/outerproduct.run.v1alpha.ComputeSpec'
          title: compute_spec
        image:
          allOf:
            - $ref: '#/components/schemas/outerproduct.image.v1alpha.ImageSpec'
          title: image
          description: >-
            The image spec of the Image each Attempt runs, which the scheduler
            builds as the Attempt
             waits to run.
        volumeMounts:
          type: object
          title: volume_mounts
          additionalProperties:
            allOf:
              - $ref: >-
                  #/components/schemas/outerproduct.sandbox.v1alpha.VolumeMountSpec
            title: value
          description: Keyed by absolute container path.
        envVars:
          type: object
          title: env_vars
          additionalProperties:
            allOf:
              - $ref: '#/components/schemas/outerproduct.run.v1alpha.EnvVar'
            title: value
          description: Container environment, keyed by variable name.
        retryStrategy:
          allOf:
            - $ref: '#/components/schemas/outerproduct.run.v1alpha.RetryStrategy'
          title: retry_strategy
          description: Omission allows one Attempt.
        summary:
          allOf:
            - $ref: '#/components/schemas/outerproduct.run.v1alpha.FunctionSummary'
          title: summary
          description: >-
            Display-only description of `function` and `arguments`, recorded by
            the Python API.
        fileMounts:
          type: array
          items:
            type: string
          title: file_mounts
          description: >-
            Images converted from file mounts, placed over the image when each
            container
             starts, rather than built into it; later file mounts win where paths overlap.
        displayName:
          type: string
          title: display_name
          description: >-
            Display label for this Call, and for its Run when this is the root
            Call.
        sourceFileMounts:
          type: object
          title: source_file_mounts
          additionalProperties:
            type: string
            title: value
          description: >-
            Source file mounts' Images, keyed by Python package or standalone
            module.
             Values also appear in file_mounts.
        port:
          type: integer
          title: port
          description: >-
            A port the function serves while it runs, which the URL of the
            sandbox each Attempt
             runs in serves to anyone.
        timeout:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Duration'
          title: timeout
          description: >-
            How long each Attempt may run; unset, up to 24 hours. Nodes do not
            enforce it yet.
      title: CallSpec
      additionalProperties: false
      description: >-
        Everything needed to execute a Call. The control plane accepts
        references
         in `volume_mounts` and `env_vars` and forwards them resolved to the scheduler.
    outerproduct.run.v1alpha.ComputeSpec:
      type: object
      properties:
        cpus:
          type: integer
          title: cpus
        memoryBytes:
          type: string
          title: memory_bytes
          format: int64
          description: Container RAM, including anything written to /dev/shm.
        accelerator:
          type: string
          title: accelerator
        acceleratorCount:
          type: integer
          title: accelerator_count
      title: ComputeSpec
      additionalProperties: false
      description: >-
        Caller hardware requirements. Scheduling configuration belongs to the
        service.
    outerproduct.image.v1alpha.ImageSpec:
      type: object
      properties:
        base:
          type: string
          title: base
          maxLength: 1024
          minLength: 1
          description: Container image, given as a registry tag or digest.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/outerproduct.image.v1alpha.ImageStep'
          title: steps
          maxItems: 64
          description: Ordered steps, each built on its predecessor.
      title: ImageSpec
      additionalProperties: false
      description: A base image and ordered build steps.
    outerproduct.sandbox.v1alpha.VolumeMountSpec:
      type: object
      properties:
        source:
          type: string
          title: source
          description: volumes/<name>
        uid:
          type: string
          title: uid
          description: Immutable identity of the resolved Volume.
        readOnly:
          type: boolean
          title: read_only
        uri:
          type: string
          title: uri
          description: Storage location of `source`.
      title: VolumeMountSpec
      additionalProperties: false
      description: >-
        The control plane accepts a `source` alone and resolves `uri` and
        credentials.
    outerproduct.run.v1alpha.EnvVar:
      type: object
      allOf:
        - oneOf:
            - required:
                - value
            - required:
                - secret
      anyOf:
        - type: object
          properties:
            secret:
              allOf:
                - $ref: '#/components/schemas/outerproduct.run.v1alpha.Secret'
              title: secret
          title: secret
        - type: object
          properties:
            value:
              type: string
              title: value
          title: value
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - secret
              - required:
                  - value
          - not:
              oneOf:
                - required:
                    - secret
                - required:
                    - value
      title: EnvVar
    outerproduct.run.v1alpha.RetryStrategy:
      type: object
      properties:
        maxAttempts:
          type: integer
          title: max_attempts
          minimum: 1
          description: Total number of Attempts, including the first. Must be at least one.
      title: RetryStrategy
      additionalProperties: false
      description: Automatic retries of the same invocation. Cancellation is never retried.
    outerproduct.run.v1alpha.FunctionSummary:
      type: object
      properties:
        name:
          type: string
          title: name
          description: '`__qualname__` of the callable.'
        source:
          type: string
          title: source
          description: Source of the callable, when Python can find it.
        arguments:
          type: array
          items:
            $ref: '#/components/schemas/outerproduct.run.v1alpha.Argument'
          title: arguments
          description: >-
            Truncated `repr` of each argument, named by its parameter when it
            binds.
      title: FunctionSummary
      additionalProperties: false
      description: What a person needs to recognize a Call; execution never reads it.
    google.protobuf.Duration:
      type: string
      format: duration
      description: >-
        A signed duration in seconds, with up to nine fractional digits and an
        `s` suffix (for example, `3s` or `-0.001s`).
    outerproduct.image.v1alpha.ImageStep:
      type: object
      allOf:
        - oneOf:
            - required:
                - uvPipInstall
      anyOf:
        - type: object
          properties:
            uvPipInstall:
              allOf:
                - $ref: '#/components/schemas/outerproduct.image.v1alpha.UvPipInstall'
              title: uv_pip_install
          title: uv_pip_install
      unevaluatedProperties: false
      title: ImageStep
    outerproduct.run.v1alpha.Secret:
      type: object
      properties:
        name:
          type: string
          title: name
          description: Empty only for values the control plane injects itself.
        uid:
          type: string
          title: uid
          description: Immutable identity of the resolved Secret.
      title: Secret
      additionalProperties: false
      description: A generic Secret whose UTF-8 value becomes the variable's value.
    outerproduct.run.v1alpha.Argument:
      type: object
      properties:
        name:
          type: string
          title: name
        value:
          type: string
          title: value
      title: Argument
      additionalProperties: false
    outerproduct.image.v1alpha.UvPipInstall:
      type: object
      properties:
        packages:
          type: array
          items:
            type: string
            maxLength: 512
            minLength: 1
          title: packages
          maxItems: 256
          minItems: 1
      title: UvPipInstall
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      description: A user session token or personal API key.
      scheme: bearer

````

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