////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
[[HopGuiWorkflows]]
:imagesdir: ../../assets/images
:page-pagination:
:description: Getting Started (7/8): Workflows in Hop are where you'll do most of the orchestration work: set the stage by fetching files, checking resource availability etc before your start to do actually run workflows and pipelines. We'll walk through what it takes to build and run a basic first workflow.

= Workflows

In xref:getting-started/hop-concepts.adoc[Concepts], we walked through workflows, actions and hops.
Let’s remember:

* A _workflow_ is by default a sequential process that has a starting point and one or more endpoints.
* An _action_ is an item of workflow functionality that executes pipelines already implemented or any other element that allows orchestrating the execution of the data integration processes.
* A _hop_ in a _workflow_ can conditionally connect _actions_ and determine which _action_ the _workflow_ needs to execute next.

== Create a Workflow

There are two ways to create a workflow.

* Click on the New option on the Horizontal toolbar and select the Workflow option.

image:getting-started/gs-hop-gui-create-workflow-1.png[]

* File -> New -> Workflow

image:getting-started/gs-hop-gui-create-workflow-2.png[]

image:getting-started/gs-hop-gui-create-workflow-3.png[]

Your new workflow is created, and you’ll see the dialog below.

image:getting-started/gs-hop-gui-create-workflow-4.png[]

NOTE: Note that when you create a workflow, Apache Hop automatically adds http://localhost:1313/manual/latest/workflow/actions/start.html[Start^] action by default.

== Add and connect actions

=== Add Actions

Now you are ready to add the first action.
Click anywhere in the workflow canvas, the area where you’ll see the image below.

image:getting-started/gs-hop-gui-create-workflow-5.png[]

After clicking you will see a dialog:

image:getting-started/gs-hop-gui-create-workflow-6.png[]

Just like you did with pipelines, use the search box in this dialog to find the actions you need.
Click or use the arrow keys and hit enter to add an action to your workflow.

For now, add a xref:workflow/actions/pipeline.adoc[Pipeline] action to your workflow.

TIP: check the xref:workflow/actions.adoc[full list of actions].
There are over 50 actions available in Hop 0.70, but you'll soon get to know the most commonly used ones.

=== Create a hop

Creating a hop is identical to creating a hop in a pipeline:

* **shift-drag**: while holding down the shift key on your keyboard.
Click on an action, while holding down your primary mouse button, drag to the second action.
Release the primary mouse button and the shift key.
* **scroll-drag**: scroll-click on an action , while holding down your mouse’s scroll button, drag to the second action.
Release the scroll button.
* click on an action in your pipeline to open the '**click anywhere**' dialog.
Click the 'Create hop' image:getting-started/icons/HOP.svg[Create hop,25px,align="bottom"] button and select the action you want to create the hop to.

image:getting-started/gs-hop-gui-create-workflow-add-pipeline-action.png[]

Save your workflow:

image:getting-started/gs-hop-gui-create-workflow-save.png[]

At first, we have the Workflow run configuration session.
A Workflow Run Configuration is a metadata object in Apache Hop and defines where the workflow is executed.

Select the 'local' workflow runtime configuration that is available by default in your Hop installation and click 'Launch'.

image:getting-started/gs-hop-gui-create-workflow-run.png[]

You’ll now have an execution results pane very similar to the pipeline execution results.
