Step 3: Create Self-Service Workflows
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:
You have reviewed the IDP 2.0 Overview and Upgrading to IDP 2.0 guide.
IDP 2.0 is enabled behind the
IDP_2_0Feature Flag. Contact Harness Support to enable it on your account.You should have a clear understanding of Managing Workflows and Workflow YAML to effectively configure and use the components of a Workflow.
It is recommended to have a Harness Pipeline in place, which acts as the orchestrator for Self-Service Workflows. Learn more about setting up Harness IDP Pipelines here.
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.
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.
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.
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.
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.
Navigate to Pipelines in your Harness IDP project.
Click Create a Pipeline.
Add a Developer Portal Stage with a Run step. This step will execute the given shell script that will generate the welcome message.
Configure the pipeline with these variables:
developer_name(String, Runtime Input)team_name(String, Runtime Input)favorite_language(String, Runtime Input)
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.
Navigate to IDP and click Create in the sidebar.
Select Workflow from the entity types.
Fill in basic details:
Name:
Hello World WorkflowDescription:
A simple workflow to demonstrate self-service automationTags:
getting-started,demo
Define the scope: Choose Account, Org, or Project level scope access.
Review the YAML: Switch to the YAML view and paste your Workflow YAML here. Replace
YOUR_PIPELINE_URL_HEREwith your actual pipeline URL.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.
Navigate to the Catalog and find your "Hello World Workflow".
Click on the workflow to open its details page.
Click Launch to start the workflow execution.
Fill out the form with your information:
Enter your name
Specify your team
Select your favorite programming language
Submit the form and watch the pipeline execute.
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:
Deep dive into the Workflow YAML
Explore how to setup a Harness IDP Pipeline.
Learn how to configure RBAC for Workflows.
Last updated
Was this helpful?