Creating complex multi-step workflows
POST api.skyvern.com/api/v1/workflows
Use this API to create a workflow. The response of this API is a workflow_permanent_id
, which can be used to run workflows below
Parameter | Type | Required? | Sample Value | Description |
---|---|---|---|---|
title | String | yes | Calculate a product price diff % | A title for a workflow |
description | String | yes | Compare two products’ price diff % on alibaba vs newlabelwholesale | A description for a workflow |
Parameter | Type | Required? | Sample Value | Description |
---|---|---|---|---|
key | String | yes | alibaba_url | unique key corresponding to a specific parameter |
parameter_type | Enum | yes | workflow | The type of parameter for the workflow. Meant to indicate whether this parameter is being passed in via the run workflow endpoint (workflow), or whether a parameter is the output of a different workflow step (output). Can be workflow , context, aws_secret, or output |
workflow_parameter_type | Enum | no? | string | The actual type of the parameter, meant to be used for type-safety reasons. Supported types: STRING = “string” INTEGER = “integer” FLOAT = “float” BOOLEAN = “boolean” JSON = “json” FILE_URL = “file_url” |
description | string | yes | Alibaba product URL for checking the price of the product | Description of the parameter |
Parameter | Type | Required? | Sample Value | Description |
---|---|---|---|---|
block_type | Enum | yes | Task | Signifying the type of block this is in the workflow |
label | String | yes | get_alibaba_price | The unique identifier for this block within this workflow |
parameter_keys | Array | yes | parameter_keys: - alibaba_price - NLW_price | The list of parameters this block depends on for execution |
output_parameter_key | string | yes | output_parameter_key: price_diff_percentage | The optional output of the block, so that it may be used by other blocks |
{{ block specific parameters }} | ?? | yes | Other parameters, specific to the block_type specified above. These are covered below |
continue_on_failure
continue_on_failure
flag indicates whether a failed block execution should block subsequent blocks or not
error_code_mapping
persist_browser_session
persist_browser_session
flag indicates whether the browser session should be retained between different workflow runs. When enabled, it uses the same user_data_dir
for each run and updates it at the end of each run. This is useful for maintaining the browser state, such as login sessions and cookies, across multiple runs of the same workflow, leading to more efficient and seamless execution.
Note: This flag is set at the workflow level, not the block level, meaning it applies to the entire workflow’s session persistence rather than individual blocks.
output_parameter_key
(autogenerated){label}_output
ie the output parameter for a block like this (which can be referenced in subsequent blocks) would be: login_output
PUT api.skyvern.com/api/v1/workflows/{workflow_permanent_id}
Workflows are versioned. Each time you create a new workflow or update the workflow, you will get a new workflow_id and but the workflow_permanent_id will remain the same.
The update workflow API payload should be exactly the same as the create workflow API payload, a YAML.