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:
- Create an Executor Pool
- Create a Runnable
- Create a Workflow with Workflow Steps
- Run the Workflow
- View Workflow Executions
Access H2O Orchestrator
Follow the steps below.
Click Activate to start working on your personal workspace. Alternatively, you can also create a new workspace to work on.
Create an Executor Pool
An Executor Pool is the main entity that handles the execution of tasks or runnables within a Workflow.
Click Executor pools on the left navigation panel.
Click Create Executor pool.
Enter a name for the Executor and leave the rest of the default values as they are.
NoteFor more information on the rest of the advanced settings you can configure when creating an Executor Pool, see Executor Pool Settings.
Click Save Changes to finish creating the Executor Pool.
Create a Runnable
Next, let's create two Runnables that we will execute one after the other in a Workflow.
Click Runnables on the left navigation panel.
Click Create Runnable.
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.
Enter the following sample script in the code section.
print("This is sample Runnable 1!")
Click Save Changes to finish creating the Runnable. You will see a success notification confirming that the runnable was created successfully.
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!")
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.
Click Workflows on the left navigation panel.
Click Create Workflow.
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").
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").
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
Click Workflows on the left navigation panel.
Click on the kebab menu of the Workflow you just created and click Run workflow.
Schedule the Workflow
Click Workflows on the left navigation panel.
Click on the Workflow you just created.
Navigate to the Triggers tab and click Create Trigger.
Enter a name for the Trigger and select Schedule as the Trigger type.
Enter your relevant Time zone and then enter the following Cron expression to trigger the workflow to run every 5 minutes.
*/5 * * * *
Click Save Changes.
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
Navigate to the Executions tab of the relevant Workflow. While the Workflow is still running, you will see the following loading icon.
Once the Workflow has finished running, click on the kebab menu of the relevant Execution and click View execution.
Click on each Workflow Step to see the output result of each step.
- Submit and view feedback for this page
- Send feedback about H2O Orchestrator | Docs to cloud-feedback@h2o.ai