Creating a workflow using a YaWL specification
Preparing a YaWL specification
Save the workflow YaWL specification to a YAML file, e.g., yawl-spec.yaml
.
Specification example:
yawl: "0.1"
start: collect_info
steps:
collect_info:
parallel:
branches:
collect_users:
start: fetch_users
steps:
fetch_users:
httpCall:
url: https://jsonplaceholder.typicode.com/users
output: '\({users: .})'
collect_posts:
start: fetch_posts
steps:
fetch_posts:
httpCall:
url: https://jsonplaceholder.typicode.com/posts
output: '\({posts: .})'
Creating a workflow
- In the management console
, select the folder where you want to create a workflow. - Select Serverless Integrations.
- In the left-hand panel, click
Workflows. - In the top-right corner, click Create workflow.
- Choose the
YaML specification
method. - In the code editor, describe the workflow YaWL specification.
-
Expand Additional parameters:
-
Enter a name and description for the workflow. The naming requirements are as follows:
- It must be from 2 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
Optionally, add labels.
-
Optionally, specify a cloud network.
-
Select a service account or create a new one.
Make sure to assign the service account roles to access private resources used in the workflow steps.
-
Optionally, set up logging.
-
- Click Create.
If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for creating a workflow:
yc serverless workflow create --help
-
Create a workflow:
yc serverless workflow create \ --yaml-spec <specification_file> \ --name <workflow_name> \ --description "<workflow_description>" \ --labels <label_list> \ --network-id <network_ID> \ --service-account-id <service_account_ID>
Where:
-
--yaml-spec
: Path to the YaWL specification file for the workflow, e.g.,./yawl-spec.yaml
. -
--name
: Workflow name. -
--description
: Workflow description. This is an optional parameter. -
--labels
: List of labels. This is an optional parameter.You can specify one or more labels separated by commas in
<key1>=<value1>,<key2>=<value2>
format. -
--network-id
: ID of the cloud network the workflow will run in. This is an optional parameter. -
--service-account-id
: Service account ID.
Result:
id: dfqjl5hh5p90******** folder_id: b1g681qpemb4******** specification: spec_yaml: "yawl: ..." created_at: "2025-03-11T09:27:51.691990Z" name: my-workflow description: created via cli labels: owner: "admin" version: "alpha" status: ACTIVE log_options: {} service_account_id: aje4tpd9coa******** network_id: enpm8v48ehcl********
-
To create a workflow, use the Create REST API method for the Workflows resource or the workflow/Create gRPC API call.