fix: call_id and stream_id for vobiz pipeline, add workflow run state (#78)

* fix: add workflow run state for pipeline

* fix: call and stream id for vobiz pipeline
This commit is contained in:
Sabiha Khan 2025-12-11 15:42:28 +05:30 committed by GitHub
parent 4640f69f9b
commit c99bd29ef1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 139 additions and 14 deletions

View file

@ -19,7 +19,7 @@ from sqlalchemy import (
)
from sqlalchemy.orm import declarative_base, relationship
from ..enums import IntegrationAction, WorkflowRunMode, WorkflowStatus
from ..enums import IntegrationAction, WorkflowRunMode, WorkflowRunState, WorkflowStatus
Base = declarative_base()
@ -314,6 +314,12 @@ class WorkflowRunModel(Base):
Enum(*[mode.value for mode in WorkflowRunMode], name="workflow_run_mode"),
nullable=False,
)
state = Column(
Enum(*[state.value for state in WorkflowRunState], name="workflow_run_state"),
nullable=False,
default=WorkflowRunState.INITIALIZED.value,
server_default=text("'initialized'::workflow_run_state"),
)
is_completed = Column(Boolean, default=False)
recording_url = Column(String, nullable=True)
transcript_url = Column(String, nullable=True)

View file

@ -306,6 +306,7 @@ class WorkflowRunClient(BaseDBClient):
initial_context: dict | None = None,
gathered_context: dict | None = None,
logs: dict | None = None,
state: str | None = None,
) -> WorkflowRunModel:
async with self.async_session() as session:
result = await session.execute(
@ -337,6 +338,8 @@ class WorkflowRunClient(BaseDBClient):
run.logs = {**run.logs, **logs}
if is_completed:
run.is_completed = is_completed
if state:
run.state = state
try:
await session.commit()
except Exception as e: