---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/run-workflow-manually.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/operations/run-workflow-manually.md
  - href: https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/run-workflow-manually.md
    type: text/markdown
    title: Markdown version
  - href: https://sourcecraft.dev/portal/docs/en/llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

# Starting a workflow manually in a SourceCraft repository

In addition to automatically starting CI/CD [workflows](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ci-cd.md#workflows) based on specific [trigger events](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ci-cd.md#on), you can start the process manually from the SourceCraft interface.


## Simple start {#simple-run}

1. [Configure](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ci-cd.md) CI/CD in your repository.
1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, under ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace**, navigate to ![image](../../_assets/console-icons/archive.svg) **Repositories** and select your repository.
1. Under ![image](../../_assets/console-icons/code.svg) **Code** on the repository page, go to ![image](../../_assets/console-icons/arrows-3-rotate-right.svg) **CI/CD**.
1. At the top right, click **New launch** and configure the start:

    1. Select the branch housing the `.sourcecraft/ci.yaml` file with the workflow you need.
    1. Select a workflow.
    1. Select a branch to start the workflow in.
    1. Click **Launch now**.

1. Check the workflow run:

    <!-- source: en/_includes/sourcecraft/ci-cd/ui-overview.md -->
    1. Under ![image](../../_assets/console-icons/code.svg) **Code** on the repository page, go to ![image](../../_assets/console-icons/arrows-3-rotate-right.svg) **CI/CD**.
    1. Select a running workflow.
    1. The page that opens will display all workflow tasks, cubes (task steps), as well as statuses and execution results.
    <!-- endsource: en/_includes/sourcecraft/ci-cd/ui-overview.md -->


## Starting with custom parameters {#run-with-params}

<!-- source: en/_includes/sourcecraft/configuration-tip.md -->
{% note tip %}

You can set up and view repository configurations in the SourceCraft interface under ![image](../../_assets/console-icons/gear.svg) **Repository settings** in the ![image](../../_assets/console-icons/nut-hex.svg) **Configurations** section. Learn more in [this article](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/configuration-edit.md).

{% endnote %}
<!-- endsource: en/_includes/sourcecraft/configuration-tip.md -->

1. [Configure](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ci-cd.md) CI/CD in your repository.
1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, under ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace**, navigate to ![image](../../_assets/console-icons/archive.svg) **Repositories** and select your repository.
1. Under ![image](../../_assets/console-icons/code.svg) **Code** on the repository page, go to ![image](../../_assets/console-icons/code-trunk.svg) **Branches**.
1. Select the branch for editing.
1. Open the `.sourcecraft/ci.yaml` file.
1. In the top-right corner, click ![image](../../_assets/console-icons/pencil.svg) **Edit**.
1. Add the [inputs](https://sourcecraft.dev/portal/docs/en/sourcecraft/ci-cd-ref/workflows.md#inputs) block to the workflow parameters. Here is an example:

    ```yaml
    workflows:
      test-workflow:
        inputs:
          username:
            type: string
            required: true
            default: John Doe
            description: Required string value.
          show-name:
            type: bool
            default: true
            description: Optional Boolean value: true or false. Default value is true.
          language:
            type: choice
            default: Russian
            options:
              - Russian
              - English
              - Chinese
            description: Optional value: select one. Default value is Russian.

        tasks:
          - name: sample-task
            env:
              # Replace with the names of the elements from the inputs block,
              # such as inputs.username, inputs.show-name, inputs.language.
              NAME: ${{ inputs.<name_of_first_element_from_inputs> }}
              SHOW_NAME: ${{ inputs.<name_of_second_element_from_inputs> }}
              LANGUAGE: ${{ inputs.<name_of_third_element_from_inputs> }}
            cubes:
              - name: sample-cube
                script:
                  - |
                    case "$LANGUAGE" in
                        "Russian")
                            echo "Hello world!"
                            if [ "$SHOW_NAME" = "true" ]; then
                                echo "My name is $NAME."
                            fi
                            ;;
                        "English")
                            echo "Hello, world!"
                            if [ "$SHOW_NAME" = "true" ]; then
                                echo "My name is $NAME."
                            fi
                            ;;
                        "Chinese")
                            echo "你好，世界！"
                            if [ "$SHOW_NAME" = "true" ]; then
                                echo "我的名字是 $NAME。"
                            fi
                            ;;
                    esac

    on:
      push: test-workflow
    ```

    <!-- source: en/_includes/sourcecraft/ci-cd/input-configs.md -->
    Where:
    * `type`: Parameter type. The possible values are:
        * `string`: String.
        * `bool`: Logical value, `true` or `false`.
        * `choice`: Select from the preset values. 

        {% note info %}

        If the configuration contains the `options` parameter, you do not need to set the `type: choice` parameter.

        If the type is not specified and there is no `options` parameter, the default parameter type is `string`.

        {% endnote %}

    * `required`: Required parameter. The possible values are `true` or `false`.
    * `description`: Any description of the parameter that will be displayed in the SourceCraft interface when manually running the workflow.
    * `default`: Default parameter value. You can also specify it if the parameter is required.
    * `options`: Possible values ​​for the `choice` parameter type.
    <!-- endsource: en/_includes/sourcecraft/ci-cd/input-configs.md -->

1. In the top-right corner, click **Commit changes**.
1. In the window that opens, configure the procedure for changes:

    * In the **Commit message** field, give a comment that will describe the changes you make.
    * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
    * Under **After commit action**, select how to make changes: via a commit or a [pull request](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#pr).

1. Confirm your changes.

    If you opted for a pull request, [finish](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/pr-create.md) creating it.

1. Under ![image](../../_assets/console-icons/code.svg) **Code** on the repository page, go to ![image](../../_assets/console-icons/arrows-3-rotate-right.svg) **CI/CD**.
1. At the top right, click **New launch** and configure the start:

    1. Select the branch housing the `.sourcecraft/ci.yaml` file with the workflow you need.
    1. Select a workflow.
    1. Select a branch to start the workflow in.
    1. Specify other parameters.
    1. Click **Launch now**.

1. Check the workflow run:

    <!-- source: en/_includes/sourcecraft/ci-cd/ui-overview.md -->
    1. Under ![image](../../_assets/console-icons/code.svg) **Code** on the repository page, go to ![image](../../_assets/console-icons/arrows-3-rotate-right.svg) **CI/CD**.
    1. Select a running workflow.
    1. The page that opens will display all workflow tasks, cubes (task steps), as well as statuses and execution results.
    <!-- endsource: en/_includes/sourcecraft/ci-cd/ui-overview.md -->

<!-- source: en/_includes/sourcecraft/ci-cd/inputs-note.md -->
{% note tip %}

Navigate to ![image](../../_assets/console-icons/terminal-line.svg) **CI/CD** **→** ![image](../../_assets/console-icons/arrows-3-rotate-right.svg) **CI/CD** in your repository or an execution page to view parameter values for each manually executed [workflow](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ci-cd.md#workflows).

This enables you to distinguish between workflows executed with different parameters.

{% cut "Example of how it looks in the interface" %}

![image](../../_assets/sourcecraft/manual-workflow-configs.png)

{% endcut %}

{% endnote %}
<!-- endsource: en/_includes/sourcecraft/ci-cd/inputs-note.md -->

#### Useful links {#see-also}

* [Configuring CI/CD in a SourceCraft repository](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ci-cd.md)
* [Continuous integration and continuous deployment in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ci-cd.md)
* [CI/CD reference](https://sourcecraft.dev/portal/docs/en/sourcecraft/ci-cd-ref/index.md)
