Add organization_name and workflow_permanent_id to skyvern context, pass workflow_permanet_id when deciding which identifier to use with which llm (#2245)

This commit is contained in:
Shuchang Zheng
2025-04-29 03:55:52 +08:00
committed by GitHub
parent 7783bb0327
commit 2f10e3c430
11 changed files with 29 additions and 20 deletions

View File

@@ -7,6 +7,7 @@ from skyvern.exceptions import OrganizationNotFound
from skyvern.forge import app
from skyvern.forge.sdk.core import skyvern_context
from skyvern.forge.sdk.core.skyvern_context import SkyvernContext
from skyvern.forge.sdk.schemas.organizations import Organization
from skyvern.forge.sdk.schemas.task_v2 import TaskV2Status
from skyvern.forge.sdk.schemas.tasks import TaskStatus
from skyvern.forge.sdk.workflow.models.workflow import WorkflowRunStatus
@@ -36,7 +37,7 @@ class AsyncExecutor(abc.ABC):
self,
request: Request | None,
background_tasks: BackgroundTasks,
organization_id: str,
organization: Organization,
workflow_id: str,
workflow_run_id: str,
max_steps_override: int | None,
@@ -120,7 +121,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
self,
request: Request | None,
background_tasks: BackgroundTasks | None,
organization_id: str,
organization: Organization,
workflow_id: str,
workflow_run_id: str,
max_steps_override: int | None,
@@ -133,10 +134,6 @@ class BackgroundTaskExecutor(AsyncExecutor):
workflow_run_id=workflow_run_id,
)
organization = await app.DATABASE.get_organization(organization_id)
if organization is None:
raise OrganizationNotFound(organization_id)
if background_tasks:
background_tasks.add_task(
app.WORKFLOW_SERVICE.execute_workflow,