mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-14 01:09:43 +00:00
validate browser session id when running tasks or workflows (#2874)
This commit is contained in:
parent
133cee4358
commit
f832206f38
3 changed files with 28 additions and 0 deletions
|
@ -10,6 +10,7 @@ from skyvern import analytics
|
|||
from skyvern.config import settings
|
||||
from skyvern.constants import GET_DOWNLOADED_FILES_TIMEOUT, SAVE_DOWNLOADED_FILES_TIMEOUT
|
||||
from skyvern.exceptions import (
|
||||
BrowserSessionNotFound,
|
||||
FailedToSendWebhook,
|
||||
InvalidCredentialId,
|
||||
MissingValueForParameter,
|
||||
|
@ -779,6 +780,15 @@ class WorkflowService:
|
|||
organization_id: str,
|
||||
parent_workflow_run_id: str | None = None,
|
||||
) -> WorkflowRun:
|
||||
# validate the browser session id
|
||||
if workflow_request.browser_session_id:
|
||||
browser_session = await app.DATABASE.get_persistent_browser_session(
|
||||
session_id=workflow_request.browser_session_id,
|
||||
organization_id=organization_id,
|
||||
)
|
||||
if not browser_session:
|
||||
raise BrowserSessionNotFound(browser_session_id=workflow_request.browser_session_id)
|
||||
|
||||
return await app.DATABASE.create_workflow_run(
|
||||
workflow_permanent_id=workflow_permanent_id,
|
||||
workflow_id=workflow_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue