reorganize workflow updates so that we can sanely check if we need to prompt user about code cache deletion on the frontend (#3639)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Shuchang Zheng
2025-10-07 16:56:53 -07:00
committed by GitHub
parent f48277d298
commit 360def0de5
4 changed files with 328 additions and 241 deletions

View File

@@ -12,7 +12,11 @@ from fastapi.responses import ORJSONResponse
from skyvern import analytics
from skyvern._version import __version__
from skyvern.config import settings
from skyvern.exceptions import BrowserSessionNotRenewable, MissingBrowserAddressError
from skyvern.exceptions import (
BrowserSessionNotRenewable,
CannotUpdateWorkflowDueToCodeCache,
MissingBrowserAddressError,
)
from skyvern.forge import app
from skyvern.forge.prompts import prompt_engine
from skyvern.forge.sdk.api.llm.exceptions import LLMProviderError
@@ -607,6 +611,7 @@ async def update_workflow_legacy(
..., description="The ID of the workflow to update. Workflow ID starts with `wpid_`.", examples=["wpid_123"]
),
current_org: Organization = Depends(org_auth_service.get_current_org),
delete_code_cache_is_ok: bool = Query(False),
) -> Workflow:
analytics.capture("skyvern-oss-agent-workflow-update")
# validate the workflow
@@ -622,7 +627,13 @@ async def update_workflow_legacy(
organization=current_org,
request=workflow_create_request,
workflow_permanent_id=workflow_id,
delete_code_cache_is_ok=delete_code_cache_is_ok,
)
except CannotUpdateWorkflowDueToCodeCache as e:
raise HTTPException(
status_code=422,
detail=str(e),
) from e
except WorkflowParameterMissingRequiredValue as e:
raise e
except Exception as e: