Skip to main content

Tutorial 1 : Create a workflow

Overview

This tutorial is an end-to-end, hands-on guide to executing a workflow on H2O Hybrid Cloud using H2O Orchestrator.

We will create two basic scripts (runnables) and schedule them to be executed at a specific time by creating a workflow on H2O Orchestrator.

This tutorial guides you through creating a workflow on H2O Orchestrator and executing it. To do this, you must first create an executor pool and a runnable, which you will then use to create the workflow.

Objectives

In this tutorial, you will get hands-on experience covering the following basic functions of H2O Orchestrator:

Access H2O Orchestrator

Follow the steps below.

  1. Access H2O Orchestrator on HAIC.

  2. Click Activate to start working on your personal workspace. Alternatively, you can also create a new workspace to work on.

    activate-workspace

Create an Executor Pool

An Executor Pool is the main entity that handles the execution of tasks or runnables within a Workflow.

  1. Click Executor pools on the left navigation panel.

  2. Click Create Executor pool.

    create-executor-pool

  3. Enter a name for the Executor and leave the rest of the default values as they are.

    Note

    For more information on the rest of the advanced settings you can configure when creating an Executor Pool, see Executor Pool Settings.

  4. Click Save Changes to finish creating the Executor Pool.

    executor-pool-settings

Create a Runnable

Next, let's create two Runnables that we will execute one after the other in a Workflow.

  1. Click Runnables on the left navigation panel.

  2. Click Create Runnable.

  3. Enter a name for the Runnable and select the Executor Pool you created in the previous section. Leave the rest of the default values as they are.

  4. Enter the following sample script in the code section.

    print("This is sample Runnable 1!")
  5. Click Save Changes to finish creating the Runnable. You will see a success notification confirming that the runnable was created successfully.

  6. Next, create another runnable with the name "Sample Runnable 2" and add a similar script as the first runnable we created.

    print("This is sample Runnable 2!")

    sample-runnable

Create a Workflow

Finally, let's create a Workflow with two Workflow Steps. Each step will run one of the runnables we created in the previous section.

  1. Click Workflows on the left navigation panel.

  2. Click Create Workflow.

  3. Enter a name for the Workflow and click on Step 1 to configure the first Workflow Step:

    a. Enter a name for the Workflow Step.

    b. Select Runnable as the Step Type.

    c. Click on Search by runnable name and select the first sample runnable we created ("Sample Runnable 1").

  4. Drag and drop to add a new node and create another Workflow Step:

    a. Enter a name for the second Workflow Step.

    b. Select Runnable as the Step Type.

    c. Click on Search by runnable name and select the second sample runnable we created ("Sample Runnable 2").

    create-workflow-steps

  5. Click Save Changes.

Run the Workflow

Let's try running the sample Workflow that you created. There are two ways you can do this:

Run the Workflow manually

  1. Click Workflows on the left navigation panel.

  2. Click on the kebab menu of the Workflow you just created and click Run workflow.

    run-workflow

Schedule the Workflow

  1. Click Workflows on the left navigation panel.

  2. Click on the Workflow you just created.

  3. Navigate to the Triggers tab and click Create Trigger.

  4. Enter a name for the Trigger and select Schedule as the Trigger type.

  5. Enter your relevant Time zone and then enter the following Cron expression to trigger the workflow to run every 5 minutes.

    */5 * * * *
  6. Click Save Changes.

    create-trigger

The Workflow is scheduled to run every 5 minutes so wait 5 minutes from the time you created the Trigger and then view the Workflow Execution to see the results.

View Executions

  1. Navigate to the Executions tab of the relevant Workflow. While the Workflow is still running, you will see the following loading icon.

    active-execution

  2. Once the Workflow has finished running, click on the kebab menu of the relevant Execution and click View execution.

  3. Click on each Workflow Step to see the output result of each step.

    workflow-result


Feedback