Skip to content

Automate browser based workflows with AI

remove include history flag from workflow run model (#2354)

Shuchang Zheng9424324baab9
diff --git a/alembic/versions/2025_05_15_1919-ecdba16ef45c_remove_include_history_flag_out_of_.py b/alembic/versions/2025_05_15_1919-ecdba16ef45c_remove_include_history_flag_out_of_.py
new file mode 100644
index 000000000..aee11540c
--- /dev/null
+++ b/alembic/versions/2025_05_15_1919-ecdba16ef45c_remove_include_history_flag_out_of_.py
@@ -0,0 +1,38 @@
+"""remove_include_history_flag_out_of_workflow_run_block
+
+Revision ID: ecdba16ef45c
+Revises: d90177b2b935
+Create Date: 2025-05-15 19:19:37.737352+00:00
+
+"""
+
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision: str = "ecdba16ef45c"
+down_revision: Union[str, None] = "d90177b2b935"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.create_index(
+ op.f("ix_persistent_browser_sessions_runnable_id"), "persistent_browser_sessions", ["runnable_id"], unique=False
+ )
+ op.drop_column("workflow_run_blocks", "include_action_history_in_verification")
+ # ### end Alembic commands ###
+
+
+def downgrade() -> None:
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.add_column(
+ "workflow_run_blocks",
+ sa.Column("include_action_history_in_verification", sa.BOOLEAN(), autoincrement=False, nullable=True),
+ )
+ op.drop_index(op.f("ix_persistent_browser_sessions_runnable_id"), table_name="persistent_browser_sessions")
+ # ### end Alembic commands ###
diff --git a/skyvern/forge/sdk/db/client.py b/skyvern/forge/sdk/db/client.py
index 4f18ee983..443dbb7a6 100644
--- a/skyvern/forge/sdk/db/client.py
+++ b/skyvern/forge/sdk/db/client.py
@@ -2566,7 +2566,6 @@ class AgentDB:
wait_sec: int | None = None,
description: str | None = None,
block_workflow_run_id: str | None = None,
- include_action_history_in_verification: bool | None = None,
) -> WorkflowRunBlock:
async with self.Session() as session:
workflow_run_block = (
@@ -2607,8 +2606,6 @@ class AgentDB:
workflow_run_block.description = description
if block_workflow_run_id:
workflow_run_block.block_workflow_run_id = block_workflow_run_id
- if include_action_history_in_verification is not None:
- workflow_run_block.include_action_history_in_verification = include_action_history_in_verification
await session.commit()
await session.refresh(workflow_run_block)
else:
diff --git a/skyvern/forge/sdk/db/models.py b/skyvern/forge/sdk/db/models.py
index b65b57107..99902b616 100644
--- a/skyvern/forge/sdk/db/models.py
+++ b/skyvern/forge/sdk/db/models.py
@@ -533,7 +533,6 @@ class WorkflowRunBlockModel(Base):
workflow_run_block_id = Column(String, primary_key=True, default=generate_workflow_run_block_id)
workflow_run_id = Column(String, nullable=False)
- include_action_history_in_verification = Column(Boolean, default=False, nullable=True)
# this is the inner workflow run id of the taskv2 block
block_workflow_run_id = Column(String, nullable=True)
parent_workflow_run_block_id = Column(String, nullable=True)
diff --git a/skyvern/forge/sdk/db/utils.py b/skyvern/forge/sdk/db/utils.py
index 8d9fd3b65..c421b28a5 100644
--- a/skyvern/forge/sdk/db/utils.py
+++ b/skyvern/forge/sdk/db/utils.py
@@ -412,7 +412,6 @@ def convert_to_workflow_run_block(
body=workflow_run_block_model.body,
created_at=workflow_run_block_model.created_at,
modified_at=workflow_run_block_model.modified_at,
- include_action_history_in_verification=workflow_run_block_model.include_action_history_in_verification,
)
if task:
block.url = task.url
@@ -422,5 +421,6 @@ def convert_to_workflow_run_block(
block.data_schema = task.extracted_information_schema
block.terminate_criterion = task.terminate_criterion
block.complete_criterion = task.complete_criterion
+ block.include_action_history_in_verification = task.include_action_history_in_verification
return block
diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.py
index a2e4e33a3..c3f0e8e3b 100644
--- a/skyvern/forge/sdk/workflow/models/block.py
+++ b/skyvern/forge/sdk/workflow/models/block.py
@@ -545,7 +545,6 @@ class BaseTaskBlock(Block):
workflow_run_block_id=workflow_run_block_id,
task_id=task.task_id,
organization_id=organization_id,
- include_action_history_in_verification=self.include_action_history_in_verification,
)
current_running_task = task
organization = await app.DATABASE.get_organization(organization_id=workflow_run.organization_id)