Create your first pipeline
Create and run your first Harness pipeline using the Pipeline Studio visual editor. Covers creating a pipeline, adding a stage and steps, and running an execution.
This quickstart walks you through creating and running your first Harness pipeline using the Pipeline Studio.
This topic uses a Custom stage with a Shell Script step. A Custom stage does not require build infrastructure or deployment prerequisites, allowing you to focus on creating and running the pipeline.
After completing this quickstart, you can add CI Build stages, CD Deploy stages, or any other stage type.
What you will learn from this topic
How to create a pipeline in Pipeline Studio.
How to add a stage and steps to the pipeline.
How to run the pipeline and view the execution.
How to view execution logs for a step.
Before you begin
Harness account: You need an active Harness account. If you do not have one, sign up for free.
Project: You need an existing project. For more information, refer to Organizations and Projects.
Permissions: You need the Pipeline: Create/Edit permission in the project. For more information, refer to RBAC in Harness.
Delegate: A Harness Delegate is required to execute steps on your infrastructure. If you do not have a delegate yet, go to Install a delegate to install one.
Pipeline creation architecture
You create and manage pipelines in a Harness project. If you are new to Harness pipelines, use this flow to get started:
The exact configuration depends on what you want the pipeline to do and which Harness module you are using.
Pipeline studio modes
Harness Pipeline Studio provides two interchangeable editors. To switch between editors, use the Visual / YAML toggle at the top of Pipeline Studio.

Visual
The Visual editor is a graphical canvas where you configure stages and steps using the Harness UI. It is the recommended starting point for new pipeline authors.
Key areas in the visual editor:
Pipeline canvas: Shows stages as cards arranged left to right. Select a stage to open its configuration panel.
Stage configuration panel: Contains the Overview, Infrastructure, Execution, and Advanced tabs for the selected stage.
Step Library: A searchable catalog of available steps. Open it by selecting Add Step in a stage's execution view.
Pipeline header: Contains Run, Save, Triggers, Input Sets, Variables, and Notifications controls.

YAML
The YAML editor is a full-featured text editor for the pipeline YAML. Use it when you prefer to write or review pipeline configuration as code.
Key features:
Autocomplete: Press
Cmd/Ctrl + Spaceto see context-aware suggestions for keys and values.On a blank line: Suggestions include valid keys at that level, such as
timeout,stage, andstep.
In context: Suggestions narrow to keys valid at the current nesting level.

For a key without a value: Suggestions include valid values for that key.

Find and replace: Press
Cmd/Ctrl + F.
Command palette: Press
F1to see all available commands and shortcuts.
Inline validation: Errors are highlighted in real time. Hover over an error marker to see details.


Everything you configure in the visual editor is reflected immediately in the YAML editor, and vice versa.
YAML schema
The Harness YAML schema formally defines all valid keys, values, and structures. It is available at github.com/harness/harness-schema. That repository also includes instructions for embedding the schema in VS Code and Sublime Text for local validation and autocomplete support.
You can also inspect the schema at runtime using Chrome DevTools:
Open Chrome DevTools and select the Network tab.
Open the relevant configuration section in Harness and reload it if necessary.
Identify the successful network request that loads the configuration or schema metadata for that section.
Open the request's Preview or Response tab.
Inspect the returned metadata or schema for the relevant definitions, properties, or configuration fields.

Schema conventions
key: value
Standard YAML associative arrays. Settings are not quoted.
2-space indentation
Default indentation. Lines prefaced by - use 4-space indentation from the position of the -.
<+input>
Marks a field as a runtime input. The value is provided at execution time.
<+expression>
Marks a field as an expression. Harness evaluates it at runtime.
[] (empty brackets)
Inline empty array. To add items: delete the brackets, add a new line, enter - followed by the item, and use autocomplete to see valid item structures.
{} (empty braces)
Inline empty map. To add entries: delete the braces, add a new line, and enter key: value pairs.
| (block style)
Multiline string. Every new line becomes a literal new line, with one added at the end.
|- (block scalar, strip)
Multiline string. Strips trailing new lines. Use for multi-line scripts.
Create a pipeline
This section demonstrates how to create a pipeline with a Custom stage and a Shell Script step using the visual editor. The same workflow applies when you create pipelines with other stage types and steps.
Perform the following steps to create a pipeline.
In Harness, navigate to your project.
In the left navigation, select Pipelines.
Select + Create a Pipeline.
In the Create new Pipeline dialog, enter a Name for your pipeline. For this quickstart, enter
DemoPipeline.Harness automatically generates an ID from the name. You can edit the ID now; after saving, the ID cannot be changed.
Choose where to store the pipeline definition:
Select Inline to store the pipeline configuration in Harness.
Select Remote to store it as code in a Git repository. For more information, refer to Git Experience.
Select Start.

Harness opens Pipeline Studio in the visual editor.
Add a Custom stage
Perform the following steps to add a Custom stage to the pipeline.
On the pipeline canvas, select Add Stage.
Select Custom Stage as the stage type.
Enter a Stage Name. For this quickstart, enter
Teststage.Select Set Up Stage.
The stage configuration panel opens with the following tabs: Overview, Execution, and Advanced.
Overview tab
The Overview tab contains basic stage information and optional settings.

In the Stage Name field, enter
Teststage(if not already entered).Optionally, add a Description for the stage.
Optionally, add Tags to categorize the stage.
Optionally add a Timeout.
Add a stage variable if needed using Stage variable.
Select + New Variable.
In Type, select the variable type.
In Name, enter a name for the variable.
In Value, enter the variable value.
To require the value when the pipeline runs, select Set variable as required during runtime. You can configure a pipeline setting to accept a value when the pipeline runs instead of specifying a fixed value when you create the pipeline. When you run the pipeline, Harness prompts you to provide a value for the variable. For more information, go to Use runtime input.
Optionally, enter a description in Description.
Select Save to add the variable.
Click Next
Execution tab
The Execution tab is where you add and configure the steps that run in this stage. For more information, refer to Add a Shell Script step.

Advanced tab
The Advanced tab includes optional configuration that you can add at the stage or step level, depending on your requirements:
Conditional Execution: Run the stage only when specific conditions are met. For more information, refer to Conditional execution.
Failure Strategy: Define what happens when the stage fails. For more information, refer to Failure strategies.
Looping Strategy: Repeat the stage for multiple items or configurations. For more information, refer to Looping strategies.
Delegate Selector: Choose which delegate runs this stage. For more information, refer to Delegate overview.

For example, you can add the pipeline marked as failed for unknown errors as a Failure Strategy.

Add a Shell Script step
Perform the following steps to add a shell script step to the stage.
In the Execution tab, select Add Step.
In the Step Library, search for Shell Script and select it.
Configure the step:
FieldValueName
Print messageTimeout
10m(default)Script Type
BashSelect script location
InlineScript
echo "Hello from Harness!"
Select Apply Changes. The step appears on the stage execution canvas.
You can arrange steps sequentially, in step groups, or in parallel. Each step type has its own configuration options. For more information about organizing steps into groups, go to Organize steps in step groups.
Run the pipeline
In Pipeline Studio, select Run in the top right corner.
The Run Pipeline dialog opens. This pipeline has no runtime inputs, so no additional configuration is needed.
Select Run Pipeline.
Harness queues and starts the execution. You are redirected to the execution view.
View execution logs
After the pipeline starts running, the execution view shows the pipeline graph with stage and step status.
On the execution graph, select the Teststage stage.
Select the Print message step.
The Console View panel opens on the right, showing real-time logs for the step.
You should see output similar to the following:
After the step completes, the stage and pipeline statuses update to Success.

Pipeline YAML
The following example shows the complete YAML for the pipeline created in this quickstart,including the pipeline, stage, step, variables, and failure strategy.
Next steps
Get started with Harness CI: Add a Build stage to compile code, run tests, and push artifacts.
Get started with Harness CD: Add a Deploy stage to deploy a service to Kubernetes, a VM, or a serverless target.
Triggers overview: Automate pipeline runs on Git events or a schedule.
Input sets and overlays: Parameterize the pipeline with runtime inputs and save reusable input sets.
Last updated
Was this helpful?