Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
skip exception if pre block screenshot failed (#3652)
LawyZheng1424c25f431c
diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.pyindex 2c19066d4..3c452a492 100644--- a/skyvern/forge/sdk/workflow/models/block.py+++ b/skyvern/forge/sdk/workflow/models/block.py@@ -344,13 +344,21 @@ class Block(BaseModel, abc.ABC):if not browser_state:LOG.warning("No browser state found when creating workflow_run_block", workflow_run_id=workflow_run_id)else:- screenshot = await browser_state.take_fullpage_screenshot(- use_playwright_fullpage=app.EXPERIMENTATION_PROVIDER.is_feature_enabled_cached(- "ENABLE_PLAYWRIGHT_FULLPAGE",- workflow_run_id,- properties={"organization_id": str(organization_id)},+ try:+ screenshot = await browser_state.take_fullpage_screenshot(+ use_playwright_fullpage=app.EXPERIMENTATION_PROVIDER.is_feature_enabled_cached(+ "ENABLE_PLAYWRIGHT_FULLPAGE",+ workflow_run_id,+ properties={"organization_id": str(organization_id)},+ ))- )+ except Exception:+ LOG.warning(+ "Failed to take screenshot before executing the block, ignoring the exception",+ workflow_run_id=workflow_run_id,+ workflow_run_block_id=workflow_run_block_id,+ )+ screenshot = Noneif screenshot:await app.ARTIFACT_MANAGER.create_workflow_run_block_artifact(workflow_run_block=workflow_run_block,