handle workflow run cancel for child workflow runs / task v2 + observer cancel handling (#1776)
This commit is contained in:
@@ -1511,6 +1511,24 @@ class AgentDB:
|
||||
LOG.error("SQLAlchemyError", exc_info=True)
|
||||
raise
|
||||
|
||||
async def get_workflow_runs_by_parent_workflow_run_id(
|
||||
self,
|
||||
organization_id: str,
|
||||
parent_workflow_run_id: str,
|
||||
) -> list[WorkflowRun]:
|
||||
try:
|
||||
async with self.Session() as session:
|
||||
query = (
|
||||
select(WorkflowRunModel)
|
||||
.filter(WorkflowRunModel.organization_id == organization_id)
|
||||
.filter(WorkflowRunModel.parent_workflow_run_id == parent_workflow_run_id)
|
||||
)
|
||||
workflow_runs = (await session.scalars(query)).all()
|
||||
return [convert_to_workflow_run(run) for run in workflow_runs]
|
||||
except SQLAlchemyError:
|
||||
LOG.error("SQLAlchemyError", exc_info=True)
|
||||
raise
|
||||
|
||||
async def create_workflow_parameter(
|
||||
self,
|
||||
workflow_id: str,
|
||||
|
||||
Reference in New Issue
Block a user