For the complete documentation index, see llms.txt. This page is also available as Markdown.

Step 3: Create Self-Service Workflows

spinner

Service and Infrastructure onboarding in today's world is slow, manual and tedious. Developers often spend days, or even weeks, setting up new software and completing Day-2 operations. This inefficiency arises from either waiting for ticket resolutions (TicketOps) or manually handling repetitive tasks, which results in a poor developer experience and decreased productivity.

Harness IDP addresses these challenges with Self-Service Workflows.

Workflows enable developer self-service by automating manual tasks and processes. Using Workflows, platform engineering teams can:

  • Automate new service onboarding.

  • Simplify Day 2 operations for developers.

  • Provide developers with golden paths to production that include guardrails and best practices.

This guide will take you through the journey of creating, configuring and executing a starter sample Workflow.


Before you begin

Before getting started with Workflows in IDP 2.0, ensure you have the following prerequisites:


Create a workflow

In this guide, you will create a "Hello World" Workflow that:

  • Input: Collects developer information through a simple form

  • Process: Triggers a Harness Pipeline to process the information

  • Output: Generates a personalized welcome message

This example showcases the fundamental workflow pattern: Input → Process → Output that can be applied to any automation use case.


Step 1: Understanding workflow components

Before creating your workflow, it is important to understand the key components that make up a Self-Service Workflow. A Workflow is defined through a YAML configuration file that contains all the Workflow's metadata and logic. Go to Workflow YAML to learn more.

This YAML has three main components that work together to facilitate Workflow automation:

1. Workflow frontend (parameters)

The Workflow Frontend serves as the entry point where users fill in necessary details to execute the Workflow. This component configures the input fields required for the Workflow. This includes form fields, validation rules, and user interface elements that collect information from users.

In our example: We will create a form to collect developer information with validation and default values. The spec.parameters field defines the input form structure, with each parameter representing a form page or section.

Go to Workflow Frontend to learn more.

Example: Workflow Frontend YAML

2. Workflow backend (steps)

The Workflow Backend is the "brain" of your Workflow - it takes user inputs from the frontend and performs the desired automation tasks. This component configures the actions to be triggered and the orchestration pipelines to be executed. This includes the core execution units that define the Workflow logic.

In our example: We will trigger a Harness Pipeline that processes the developer information and generates a welcome message. The steps field defines the automation actions, with each step having an id, name, action, and input configuration.

Go to Workflow Backend to learn more.

Example: Workflow Backend YAML

3. Workflow outputs

Workflow Outputs configure output variables to be used after backend execution. This includes links to created resources, status messages, and feedback for users.

In our example: We will display a success message and provide a link to view the pipeline execution. The output field defines what users see after completion, with links for navigation and text for messages.

Go to Workflow Outputs to learn more.

Example: Workflow Outputs YAML

Workflow metadata

Workflow Metadata provides information about the Workflow itself, including name, description, tags, and ownership details for catalog discovery.

In our example: We will define basic metadata to make our workflow discoverable and understandable. The metadata section contains the workflow's identity, while the spec section defines ownership and type.

Go to Workflow YAML Structure to learn more.

Note: When creating Workflows through the Harness IDP UI, this metadata can be automatically generated based on the information you provide in the creation form.

Example: Workflow Metadata YAML
Example Workflow YAML

Step 2: Create the supporting Harness IDP pipeline

Harness IDP Workflows can trigger Harness Pipelines to perform the actual automation. This is used to handle the backend orchestration of the Workflow. First, create a simple pipeline that will process your workflow inputs.

Example Pipeline YAML
Create the supporting Harness IDP Pipeline
  1. Navigate to Pipelines in your Harness IDP project.

  2. Click Create a Pipeline.

  3. Add a Developer Portal Stage with a Run step. This step will execute the given shell script that will generate the welcome message.

  1. Configure the pipeline with these variables:

    • developer_name (String, Runtime Input)

    • team_name (String, Runtime Input)

    • favorite_language (String, Runtime Input)

  2. Save the pipeline and copy its execution URL. This URL will be used in the Workflow YAML to trigger the pipeline.


Step 3: Create the workflow

Now create the workflow that will collect user inputs and trigger your pipeline.

Create Workflow in Harness IDP
  1. Navigate to IDP and click Create in the sidebar.

  2. Select Workflow from the entity types.

  3. Fill in basic details:

    • Name: Hello World Workflow

    • Description: A simple workflow to demonstrate self-service automation

    • Tags: getting-started, demo

  4. Define the scope: Choose Account, Org, or Project level scope access.

  5. Review the YAML: Switch to the YAML view and paste your Workflow YAML here. Replace YOUR_PIPELINE_URL_HERE with your actual pipeline URL.

  6. Save the Workflow and navigate to the Catalog to find your "Hello World Workflow".


Step 4: Execute your workflow

Once created, execute your workflow to ensure it works correctly.

  1. Navigate to the Catalog and find your "Hello World Workflow".

  2. Click on the workflow to open its details page.

  3. Click Launch to start the workflow execution.

  4. Fill out the form with your information:

    • Enter your name

    • Specify your team

    • Select your favorite programming language

  5. Submit the form and watch the pipeline execute.

  6. View the results in the pipeline execution logs.


Next steps

Now that you have learned how to create and manage a Workflow, here is what to explore next:

  1. Deep dive into the Workflow YAML

  2. Learn how to configure Inputs, Actions and Outputs in a Workflow.

  3. Learn how to configure RBAC for Workflows.

Last updated

Was this helpful?