| 12345678910111213141516171819202122232425262728 |
- from datetime import datetime
- from sqlalchemy import DateTime, Integer, String, Text
- from sqlalchemy.orm import Mapped, mapped_column
- from core_db import AuditMixin, Base, TenantMixin, VersionMixin
- class WorkflowRun(TenantMixin, AuditMixin, VersionMixin, Base):
- __tablename__ = "workflow_run"
- app_id: Mapped[str] = mapped_column(String(36), index=True)
- app_version_id: Mapped[str] = mapped_column(String(36))
- workflow_id: Mapped[str] = mapped_column(String(36))
- workflow_version_id: Mapped[str] = mapped_column(String(36))
- session_id: Mapped[str | None] = mapped_column(String(36), nullable=True, index=True)
- parent_run_id: Mapped[str | None] = mapped_column(String(36), nullable=True)
- root_run_id: Mapped[str | None] = mapped_column(String(36), nullable=True, index=True)
- run_type: Mapped[str] = mapped_column(String(32), default="main")
- status: Mapped[str] = mapped_column(String(32), default="pending", index=True)
- trigger_type: Mapped[str] = mapped_column(String(32), default="user")
- priority: Mapped[int] = mapped_column(Integer, default=0)
- current_node_count: Mapped[int] = mapped_column(Integer, default=0)
- started_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
- finished_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
- error_code: Mapped[str | None] = mapped_column(String(64), nullable=True)
- error_message: Mapped[str | None] = mapped_column(Text, nullable=True)
|