mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-02 02:30:07 +00:00
Fix dynamic browsers for workflows (#650)
This commit is contained in:
parent
c52f8f2433
commit
b20f3e13c0
1 changed files with 5 additions and 1 deletions
|
@ -25,6 +25,7 @@ class BrowserManager:
|
||||||
proxy_location: ProxyLocation | None = None,
|
proxy_location: ProxyLocation | None = None,
|
||||||
url: str | None = None,
|
url: str | None = None,
|
||||||
task_id: str | None = None,
|
task_id: str | None = None,
|
||||||
|
workflow_run_id: str | None = None,
|
||||||
) -> BrowserState:
|
) -> BrowserState:
|
||||||
pw = await async_playwright().start()
|
pw = await async_playwright().start()
|
||||||
(
|
(
|
||||||
|
@ -36,6 +37,7 @@ class BrowserManager:
|
||||||
proxy_location=proxy_location,
|
proxy_location=proxy_location,
|
||||||
url=url,
|
url=url,
|
||||||
task_id=task_id,
|
task_id=task_id,
|
||||||
|
workflow_run_id=workflow_run_id,
|
||||||
)
|
)
|
||||||
return BrowserState(
|
return BrowserState(
|
||||||
pw=pw,
|
pw=pw,
|
||||||
|
@ -76,7 +78,9 @@ class BrowserManager:
|
||||||
"Creating browser state for workflow run",
|
"Creating browser state for workflow run",
|
||||||
workflow_run_id=workflow_run.workflow_run_id,
|
workflow_run_id=workflow_run.workflow_run_id,
|
||||||
)
|
)
|
||||||
browser_state = await self._create_browser_state(workflow_run.proxy_location, url=url)
|
browser_state = await self._create_browser_state(
|
||||||
|
workflow_run.proxy_location, url=url, workflow_run_id=workflow_run.workflow_run_id
|
||||||
|
)
|
||||||
|
|
||||||
# The URL here is only used when creating a new page, and not when using an existing page.
|
# The URL here is only used when creating a new page, and not when using an existing page.
|
||||||
# This will make sure browser_state.page is not None.
|
# This will make sure browser_state.page is not None.
|
||||||
|
|
Loading…
Add table
Reference in a new issue