Skip to main content

Create Task

In this example, we will create a new task that prints "Hello, World!" to the console at random intervals. This simulates one of your jobs executing a task within Yak.

Create your first task

1️⃣ Login

Login to your Yak at http:\\127.0.0.1:3501

2️⃣ Create Task

Creating a task is simple. Click the “+” button in the bottom-left corner of the dashboard to open the Task Editor. The Task Editor allows you to create new tasks or modify existing ones.

To edit an existing task, right-click on the task and select “Open in Editor”.

3️⃣ Enter task details

Next, we will define the task we want to run by completing the forms in the Task Editor. A task can consist of multiple steps, but for this tutorial, we will define only one. We will create a single step that will be executed on our master node.

  • Enter name "Test Task" for the name
  • Click the "+" sign to create a new step, call it "Test Step"
  • Select the "Master" node for execution
  • Paste the following script in the script editor based on your OS
    • Linux
      for i in $(seq 1 10); do echo "Step $i"; sleep 1; done
    • Windows
      for /L %i in (1,1,10) do @echo Executing step %i & timeout /t 1 >nul
  • Click "Save" on the top right corner to save the task

4️⃣ Run the task

Run the task on-demand by right clicking the task on the home dashboard and selecting “Run Now” in the context menu.

While the task is running, you can view its real-time output in the Executions section at the bottom of the page.