add organization_id filter for get_workflow and get_workflow_run (#1422)

This commit is contained in:
Shuchang Zheng
2024-12-22 17:49:33 -08:00
committed by GitHub
parent b256bace6a
commit 2e37542218
7 changed files with 44 additions and 18 deletions

View File

@@ -248,7 +248,10 @@ class ForgeAgent:
) -> Tuple[Step, DetailedAgentStepOutput | None, Step | None]:
workflow_run: WorkflowRun | None = None
if task.workflow_run_id:
workflow_run = await app.DATABASE.get_workflow_run(workflow_run_id=task.workflow_run_id)
workflow_run = await app.DATABASE.get_workflow_run(
workflow_run_id=task.workflow_run_id,
organization_id=organization.organization_id,
)
if workflow_run and workflow_run.status == WorkflowRunStatus.canceled:
LOG.info(
"Workflow run is canceled, stopping execution inside task",