Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
Log the runs still waiting to start, by lane and age, from the reaper cron (SKY-16590) (#8725)
Shuchang Zhengaa3bcf63a43b
diff --git a/skyvern/forge/sdk/workflow/models/workflow.py b/skyvern/forge/sdk/workflow/models/workflow.pyindex 8d529c0da..dd8d07137 100644--- a/skyvern/forge/sdk/workflow/models/workflow.py+++ b/skyvern/forge/sdk/workflow/models/workflow.py@@ -413,6 +413,15 @@ class WorkflowRun(BaseModel):return self.debug_session_id is not None+def start_hold_reason(*, sequential_key: str | None, depends_on_workflow_run_id: str | None) -> str:+ """Why a run may wait by design before it starts: a sequential lane, a dependency, or neither."""+ if sequential_key:+ return "sequential"+ if depends_on_workflow_run_id:+ return "dependency"+ return "none"++def resolve_reuse_browser_session(*, run_override: bool | None, workflow_default: bool) -> bool:"""Resolve browser-session reuse with the run override taking precedence."""return workflow_default if run_override is None else run_overridediff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.pyindex fda8c219f..9aa989964 100644--- a/skyvern/forge/sdk/workflow/service.py+++ b/skyvern/forge/sdk/workflow/service.py@@ -217,6 +217,7 @@ from skyvern.forge.sdk.workflow.models.workflow import (is_adaptive_caching,resolve_reuse_browser_session,should_acquire_reused_session,+ start_hold_reason,)from skyvern.forge.sdk.workflow.private_settings import (resolve_cdp_connect_headers,@@ -1105,14 +1106,6 @@ def _request_to_start_seconds(workflow_run: WorkflowRun) -> float | None:return (workflow_run.started_at.replace(tzinfo=UTC) - workflow_run.created_at.replace(tzinfo=UTC)).total_seconds()-def _start_hold(workflow_run: WorkflowRun) -> str:- if workflow_run.sequential_key:- return "sequential"- if workflow_run.depends_on_workflow_run_id:- return "dependency"- return "none"--def _failure_attribution_log_fields(workflow_run: WorkflowRun, status: WorkflowRunStatus) -> dict[str, str | None]:if status == WorkflowRunStatus.completed:return {"primary_infra_component": None, "primary_failure_category": None, "attribution_evidence_source": None}@@ -12908,7 +12901,10 @@ class WorkflowService:organization_id=workflow_run.organization_id,debug_session_id=workflow_run.debug_session_id,copilot_session_id=workflow_run.copilot_session_id,- start_hold=_start_hold(workflow_run),+ start_hold=start_hold_reason(+ sequential_key=workflow_run.sequential_key,+ depends_on_workflow_run_id=workflow_run.depends_on_workflow_run_id,+ ),backup_queue=app.AGENT_FUNCTION.is_backup_queue_organization(workflow_run.organization_id),run_with=workflow_run.run_with,ai_fallback=workflow_run.ai_fallback,