[Yandex Cloud documentation](../../../../index.md) > [Yandex Serverless Integrations](../../../index.md) > [Step-by-step guides](../../index.md) > Workflows > Managing a workflow > Creating a workflow > YaWL specification

# Creating a workflow using a YaWL specification

## Preparing a YaWL specification {#prepare-spec}

Save the workflow [YaWL specification](../../../concepts/workflows/yawl/index.md) to a YAML file, e.g., `yawl-spec.yaml`.

Specification example:

```yaml
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 {#create-workflow}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you want to create a [workflow](../../../concepts/workflows/workflow.md).
  1. Navigate to **Serverless Integrations**.
  1. In the left-hand panel, click ![image](../../../../_assets/console-icons/graph-node.svg) **Workflows**.
  1. In the top-right corner, click **Create workflow**.
  1. Select the `YaML specification` method.
  1. In the code editor, describe the workflow [YaWL specification](../../../concepts/workflows/yawl/index.md).
  1. Expand **Additional parameters**:
     
     1. Enter a name and description for the workflow. The naming requirements are as follows:
     
         * Length: between 3 and 63 characters.
         * It can only contain lowercase Latin letters, numbers, and hyphens.
         * It must start with a letter and cannot end with a hyphen.
     
     1. Optionally, [add](label-add.md) labels.
     1. Optionally, [specify](network-add.md) a cloud network.
     1. Select a [service account](../../../../iam/concepts/users/service-accounts.md) or [create](../../../../iam/operations/sa/create.md) a new one.
     
         Make sure to assign the service account roles to access private resources used in the workflow steps.
     
     1. Optionally, [set up](logs-write.md) logging.
  1. Click **Create**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI command for creating a [workflow](../../../concepts/workflows/workflow.md):

      ```bash
      yc serverless workflow create --help
      ```

  1. Create a workflow:

      ```bash
      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](../../../concepts/workflows/yawl/index.md) file for the workflow, e.g., `./yawl-spec.yaml`.
      * `--name`: Workflow name.
      * `--description`: Workflow description. This is an optional setting.
      * `--labels`: List of labels. This is an optional setting.

          You can specify one or more labels separated by commas in `<key1>=<value1>,<key2>=<value2>` format.

      * `--network-id`: ID of a cloud network where the workflow will run. This is an optional setting.
      * `--service-account-id`: [Service account](../../../../iam/concepts/users/service-accounts.md) ID.

      Result:

      ```text
      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********
      ```

- API {#api}

  To create a [workflow](../../../concepts/workflows/workflow.md), use the [Create](../../../workflows/api-ref/Workflow/create.md) REST API method for the [Workflows](../../../workflows/api-ref/Workflow/index.md) resource or the [WorkflowService/Create](../../../workflows/api-ref/grpc/Workflow/create.md) gRPC API call.

{% endlist %}