---
title: Creating a Workflow
slug: creating-a-workflow
description: Learn how to create a customized workflow using the Workflow editor in our Automation section. Design and execute workflows with ease using elements like nodes, actions, and triggers. Achieve tailored automation based on your specific needs.
docTags: 
createdAt: 2023-07-19T12:45:55.996Z
---

Here's a step-by-step guide to help you set up a workflow:

## Creating a workflow using the Workflow Editor


**Step 1: Navigate to the Automation Menu**

- Go to the left-side panel and look for the **Automation** section
- Navigate to **Workspace** then select **Workflows**

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/nILwwo37oX1-z9avfTSKr_image.png)

**Step 2: Select the Workspace**

- In the top right corner of the screen, find and click on the dropdown list to select your workspace.
- Once selected, a list of all existing workflows within the chosen workspace will be displayed in the working area.

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/dZDpyAAuVle3qoIffYIry_image.png)

**Step 3: Create a New Workflow**

- Click on the **Create a Workflow** button on the top left side of the working area

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/VGAXKBLTOZrRLxHW5jcFo_image.png)

**Step 4: Enter Workflow Details**

- A prompt will appear for you to provide details of the workflow.
- Enter the `Name`, `Description`, and `Tags` for the workflow.
- Set the `Active` toggle to on or off based on whether you want the workflow to be active immediately upon creation.
- Click on **Save**

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/2bfkIx_wPlXIkk8ap8svO_image.png)

**Step 5: Access the Workflow Editor**

- The workflow editor will then open up. Here, you will see the available nodes on the left side panel.&#x20;
- The central part of the screen is the active area where you'll construct your workflow.
- On the top right, you'll find options for history, webhooks, and the code editor.

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/rCH_c8GoB1vjbRDwCG6z3_image.png)

**Step 6: Add and Configure Nodes**

- Begin by clicking the plus sign on the workflow editor
- A list with **top level nodes** will be displayed&#x20;



![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/E-pUkNyb1n_FSENIcj8Vy_image.png)

:::hint{type="info"}
Each node in Kubeark's Workflow Editor has its own set of customizable arguments and settings, allowing for tailored functionality within your workflow.
:::

Here's an overview of the **top level nodes&#x20;**&#x61;nd their specific customization options.&#x20;

| **Node Type**      | **Detailed Customization Options**                                                                                     |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `Action`           | Default actions can be found here [About Nodes](docId:_gz60tk0O28jqZNSBch9W)                                           |
| `Approve`          | Allows you to set up a manual intervention point, where a workflow pauses until manual approval is given.              |
| `Workflow`         | Provides a window for scripting custom logic or actions, where you can write or paste your script code.                |
| `Define variables` | Presents options to create and assign values to variables used within the workflow\..                                  |
| `For Loop`         | Configures loop iterations, setting how many times a particular set of actions within the workflow should be repeated. |
| `Function`         | Brings up a window where you can define variables, set parameters, and configure other function-specific settings.     |
| `Branch`           | Enables you to define the conditions under which different paths of the workflow will be executed.                     |
| `Sleep`            | Allows you to set a duration for the workflow to pause before proceeding to the next step.                             |
| `Terminate`        | Involves setting the conditions under which a workflow should be prematurely ended.                                    |
| `While Loop`       | Provides the ability to set a condition that keeps the workflow in a loop as long as the condition remains true.       |

A few examples below:

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/14RClVxIsBZHxzrihZIvy_image.png "Node arguments")

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/-oyUSVItaIBI_ZzFxnxZo_image.png)

**Step 7: Test the Workflow**

- Once you have added and configured the nodes, test the workflow.
- Click the “Play” button located at the upper middle side of the working area. This action will execute the workflow, allowing you to verify its functionality and make any necessary adjustments.
- The Execution History will pop-up, displaying the output for the recent run.

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/giqiCXPm3YueRlycwJf7V_image.png)

## Creating a workflow using the Code editor

For those who are more inclined towards coding or require finer control over their workflows, Kubeark offers a specialized feature: the Code Editor.&#x20;

This tool is ideal for creating and editing a workflow manifest directly through code. It caters to users who are comfortable with scripting and prefer a more hands-on approach to defining the intricacies of their workflows.&#x20;

The Code Editor provides an interface where you can write, modify, and fine-tune the workflow's underlying code, offering a high level of customization and precision. This feature is especially useful for complex workflows where specific programming logic or advanced configurations are needed.&#x20;

Whether you're looking to draft a new workflow from scratch or make detailed adjustments to an existing one, the Code Editor in Kubeark is a key functionality to leverage.

A sample manifest can be found below:

```yaml
- name: def_variables
  def:
    api_token: [add your api token]
    URL: [add your url]
    owner: owner_name
    owner_update: owner_update
    user_id: 53
- name: create_deployment_checks
  action: CreateDeployment
  input:
    api_token: ${{api_token}}
    time_out: 30
    wait_for_result: false
    deployment:
      name: workflow-${{random_string(2)}}
      owner: ${{owner}}
      tags:
        - test
      template_id: 677
      cluster_id: 7
      default_time: 7
      additional_time: 6
      grace_time: 5
      namespace: wftest
      environment_action: terminate
      extra_args:
        date: ${{ current_date() }}
        ingress:
          hostname: hello-${{ random_int(5) }}.domain.name
        ipTarget: 51.124.141.121
        uuid: ${{ random_uuid() }}
      extra_args_sensitive:
        - uuid

```



