workflow run block (#1332)
This commit is contained in:
@@ -36,6 +36,7 @@ ARTIFACT_PREFIX = "a"
|
||||
WORKFLOW_PREFIX = "w"
|
||||
WORKFLOW_PERMANENT_ID_PREFIX = "wpid"
|
||||
WORKFLOW_RUN_PREFIX = "wr"
|
||||
WORKFLOW_RUN_BLOCK_PREFIX = "wrb"
|
||||
WORKFLOW_PARAMETER_PREFIX = "wp"
|
||||
AWS_SECRET_PARAMETER_PREFIX = "asp"
|
||||
OUTPUT_PARAMETER_PREFIX = "op"
|
||||
@@ -55,6 +56,11 @@ def generate_workflow_permanent_id() -> str:
|
||||
return f"{WORKFLOW_PERMANENT_ID_PREFIX}_{int_id}"
|
||||
|
||||
|
||||
def generate_workflow_run_block_id() -> str:
|
||||
int_id = generate_id()
|
||||
return f"{WORKFLOW_RUN_BLOCK_PREFIX}_{int_id}"
|
||||
|
||||
|
||||
def generate_workflow_run_id() -> str:
|
||||
int_id = generate_id()
|
||||
return f"{WORKFLOW_RUN_PREFIX}_{int_id}"
|
||||
|
||||
@@ -35,6 +35,7 @@ from skyvern.forge.sdk.db.id import (
|
||||
generate_workflow_id,
|
||||
generate_workflow_parameter_id,
|
||||
generate_workflow_permanent_id,
|
||||
generate_workflow_run_block_id,
|
||||
generate_workflow_run_id,
|
||||
)
|
||||
from skyvern.forge.sdk.schemas.tasks import ProxyLocation
|
||||
@@ -473,3 +474,24 @@ class ActionModel(Base):
|
||||
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)
|
||||
modified_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False)
|
||||
|
||||
|
||||
class WorkflowRunBlockModel(Base):
|
||||
__tablename__ = "workflow_run_blocks"
|
||||
__table_args__ = (Index("wfrb_org_wfr_index", "organization_id", "workflow_run_id"),)
|
||||
|
||||
workflow_run_block_id = Column(String, primary_key=True, default=generate_workflow_run_block_id)
|
||||
workflow_run_id = Column(String, ForeignKey("workflow_runs.workflow_run_id"), nullable=False)
|
||||
parent_workflow_run_block_id = Column(
|
||||
String, ForeignKey("workflow_run_blocks.workflow_run_block_id"), nullable=True
|
||||
)
|
||||
organization_id = Column(String, ForeignKey("organizations.organization_id"), nullable=True)
|
||||
task_id = Column(String, ForeignKey("tasks.task_id"), nullable=True)
|
||||
label = Column(String, nullable=True)
|
||||
block_type = Column(String, nullable=False)
|
||||
status = Column(String, nullable=False)
|
||||
output = Column(JSON, nullable=True)
|
||||
continue_on_failure = Column(Boolean, nullable=False, default=False)
|
||||
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)
|
||||
modified_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user