# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class WorkflowReference(UncheckedBaseModel):
    """
    The workflow to run.
    """

    id: str = pydantic.Field()
    """
    The ID of the workflow.
    
    Example: `"workflow_BMdfq_yWM3sT-ZzvCnA3f"`
    """

    version: typing.Optional[str] = pydantic.Field(default=None)
    """
    An optional version of the workflow that files will be run through. This number can be found when viewing the workflow on the Extend platform. When a version number is not supplied, the most recent published version of the workflow will be used. If no published versions exist, the draft version will be used. To run the `"draft"` version of a workflow, use `"draft"` as the version.
    
    Examples:
    - `"3"` - Run version 3 of the workflow
    - `"draft"` - Run the draft version of the workflow
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
