Skip to content

Automate browser based workflows with AI

Add bundle key to artifact model (#5092)

Shuchang Zhenge08ff39a4944
diff --git a/alembic/versions/2026_03_13_1956-d38cca7e13b8_add_bundle_key_column_to_artifacts.py b/alembic/versions/2026_03_13_1956-d38cca7e13b8_add_bundle_key_column_to_artifacts.py
new file mode 100644
index 000000000..0325b85ab
--- /dev/null
+++ b/alembic/versions/2026_03_13_1956-d38cca7e13b8_add_bundle_key_column_to_artifacts.py
@@ -0,0 +1,31 @@
+"""add bundle_key column to artifacts
+
+Revision ID: d38cca7e13b8
+Revises: b37f05a2bfbf
+Create Date: 2026-03-13 19:56:03.116922+00:00
+
+"""
+
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision: str = "d38cca7e13b8"
+down_revision: Union[str, None] = "b37f05a2bfbf"
+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.add_column("artifacts", sa.Column("bundle_key", sa.String(), nullable=True))
+ # ### end Alembic commands ###
+
+
+def downgrade() -> None:
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.drop_column("artifacts", "bundle_key")
+ # ### end Alembic commands ###
diff --git a/skyvern/forge/sdk/artifact/models.py b/skyvern/forge/sdk/artifact/models.py
index adeb1e780..76c6d0ae4 100644
--- a/skyvern/forge/sdk/artifact/models.py
+++ b/skyvern/forge/sdk/artifact/models.py
@@ -55,6 +55,12 @@ class ArtifactType(StrEnum):
# PDF files
PDF = "pdf"
+ # Step archive: one ZIP per step containing all step artifacts (text + screenshots)
+ STEP_ARCHIVE = "step_archive"
+
+ # Task archive: one ZIP per task containing task-level cleanup artifacts (HAR, console log, trace, final screenshot)
+ TASK_ARCHIVE = "task_archive"
+
class Artifact(BaseModel):
created_at: datetime = Field(
@@ -75,6 +81,7 @@ class Artifact(BaseModel):
artifact_id: str
artifact_type: ArtifactType
uri: str
+ bundle_key: str | None = None
task_id: str | None = None
step_id: str | None = None
workflow_run_id: str | None = None
diff --git a/skyvern/forge/sdk/db/models.py b/skyvern/forge/sdk/db/models.py
index 19109201d..4a3d2f346 100644
--- a/skyvern/forge/sdk/db/models.py
+++ b/skyvern/forge/sdk/db/models.py
@@ -239,6 +239,7 @@ class ArtifactModel(Base):
step_id = Column(String, index=True)
artifact_type = Column(String)
uri = Column(String)
+ bundle_key = Column(String, nullable=True)
run_id = Column(String, nullable=True, index=True)
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)
modified_at = Column(