mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-14 09:19:40 +00:00
create_empty_workflow interface in workflow service (#1286)
This commit is contained in:
parent
28250e14de
commit
f491b017d1
1 changed files with 23 additions and 1 deletions
|
@ -70,7 +70,12 @@ from skyvern.forge.sdk.workflow.models.workflow import (
|
|||
WorkflowRunStatus,
|
||||
WorkflowRunStatusResponse,
|
||||
)
|
||||
from skyvern.forge.sdk.workflow.models.yaml import BLOCK_YAML_TYPES, ForLoopBlockYAML, WorkflowCreateYAMLRequest
|
||||
from skyvern.forge.sdk.workflow.models.yaml import (
|
||||
BLOCK_YAML_TYPES,
|
||||
ForLoopBlockYAML,
|
||||
WorkflowCreateYAMLRequest,
|
||||
WorkflowDefinitionYAML,
|
||||
)
|
||||
from skyvern.webeye.browser_factory import BrowserState
|
||||
|
||||
LOG = structlog.get_logger()
|
||||
|
@ -1501,3 +1506,20 @@ class WorkflowService:
|
|||
)
|
||||
|
||||
raise ValueError(f"Invalid block type {block_yaml.block_type}")
|
||||
|
||||
async def create_empty_workflow(self, organization: Organization, title: str) -> Workflow:
|
||||
"""
|
||||
Create a blank workflow with no blocks
|
||||
"""
|
||||
# create a new workflow
|
||||
workflow_create_request = WorkflowCreateYAMLRequest(
|
||||
title=title,
|
||||
workflow_definition=WorkflowDefinitionYAML(
|
||||
parameters=[],
|
||||
blocks=[],
|
||||
),
|
||||
)
|
||||
return await app.WORKFLOW_SERVICE.create_workflow_from_request(
|
||||
organization=organization,
|
||||
request=workflow_create_request,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue