# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Dict, Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from .._models import BaseModel

__all__ = ["WorkflowRun"]


class WorkflowRun(BaseModel):
    id: str
    """Unique workflow run ID"""

    agent_name: str = FieldInfo(alias="agentName")
    """Agent name"""

    context: Optional[Dict[str, Optional[object]]] = None
    """Execution context"""

    created_at: str = FieldInfo(alias="createdAt")
    """When the run was created"""

    identity: Dict[str, Optional[object]]
    """Identity fields for run scoping"""

    input: Dict[str, Optional[object]]
    """Original workflow input"""

    pending_action: Optional[Dict[str, Optional[object]]] = FieldInfo(alias="pendingAction", default=None)
    """Pending action when paused"""

    project_id: str = FieldInfo(alias="projectId")
    """Project ID"""

    state: Optional[Dict[str, Optional[object]]] = None
    """Full workflow state"""

    status: Literal["running", "paused", "completed", "failed"]
    """Workflow run status"""

    updated_at: str = FieldInfo(alias="updatedAt")
    """When the run was last updated"""
