run scripts with workflow run paramters (#3219)

This commit is contained in:
Shuchang Zheng
2025-08-17 20:27:53 -07:00
committed by GitHub
parent c1b676f85e
commit 35313508d0
3 changed files with 59 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
import abc
from typing import Any
import structlog
from fastapi import BackgroundTasks, Request
@@ -67,7 +68,9 @@ class AsyncExecutor(abc.ABC):
request: Request | None,
script_id: str,
organization_id: str,
background_tasks: BackgroundTasks | None,
parameters: dict[str, Any] | None = None,
workflow_run_id: str | None = None,
background_tasks: BackgroundTasks | None = None,
**kwargs: dict,
) -> None:
pass
@@ -214,7 +217,9 @@ class BackgroundTaskExecutor(AsyncExecutor):
request: Request | None,
script_id: str,
organization_id: str,
background_tasks: BackgroundTasks | None,
parameters: dict[str, Any] | None = None,
workflow_run_id: str | None = None,
background_tasks: BackgroundTasks | None = None,
**kwargs: dict,
) -> None:
if background_tasks:
@@ -222,5 +227,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
script_service.execute_script,
script_id=script_id,
organization_id=organization_id,
parameters=parameters,
workflow_run_id=workflow_run_id,
background_tasks=background_tasks,
)