Custom Notification templates for Pipeline Notifications
Configure Custom Notification templates for Pipeline Notifications
You can create custom notification templates to customize notification content and reuse templates across Centralized Pipeline Notifications. These templates support Pipeline Expressions and RBAC controls, giving you both flexibility and security.
With this enhancement, you can attach a custom notification template to a notification rule and override the default message format with a custom webhook payload.
Custom templates let you:
Control the structure and content of your notifications.
Use dynamic expressions (such as pipeline or stage variables).
Reuse templates across multiple pipelines and teams.
In this section, you'll learn how to set up notifications for pipeline events using custom notification templates at a specific scope.
You can create custom notification templates at the following scopes: Account, Organization, and Project.
There are two ways to use custom notification templates:
Set Up notifications template
In this example, we are going to discuss setting up custom notification template for Pipeline at Project Level:-
In this example, we are going to discuss setting up custom notification template for Pipeline at Project Level:
In your Harness, go to your project.
Select Project Settings, then, under Project-level resources, select Templates.
Select + New Template, and then select Notifications. The Create New Notifications Template settings open.
In Name, enter a name for the template.
(Optional) Select the pencil icon to enter a Description.
(Optional) Select the pencil icon to add Tags.
In Version Label, enter the version of the template, for example,
v1. Versioning a template enables you to create a new template without modifying the existing one. For more information, go to Versioning.In Text Type you can choose text type as HTML, JSON, YAML or String for content body based on what notification method you are using.

When you select text type as per your need you will be asked to provide the body of notification template.

Click on Save.
Attach a custom notification template to pipeline notifications
Harness supports adding notification rules to pipelines. With this enhancement, you can now attach a custom notification template to a pipeline notification rule to override the default message format and send custom webhook-based notifications.
You can also attach templates in centralized notification for pipeline events
This allows you to replace the default notification message with a tailored structure defined in your template, including any runtime variables or expressions you've configured.
Attach a template
When configuring a pipeline-level notification rule, click Notify in the right panel of the Pipeline Studio. Then, follow the steps for Configure pipeline notifications until you reach the Notification Template step.
Under the Notification Template section:
Select your custom notification template.
If the template includes runtime variables, you'll be prompted to provide values for those inputs.

Each notification method has a different payload format, so you’ll need to create a separate custom notification template for each method.
Here are the notification methods and their sample payload format:
Here is a sample template for Email notification:
Here's how the notification would look like when the above template is used in the notification rule:

Here is a sample template for Datadog notification:
Here's how the notification would look like when the above template is used in the notification rule:

Here is a sample template for Microsoft Teams notification:
Here's how the notification would look like when the above template is used in the notification rule:

Here is a sample template for Slack notification:
Here's how the notification would look like when the above template is used in the notification rule:

Here is a sample template for PagerDuty notification:
Here's how the notification would look like when the above template is used in the notification rule:

Here is a sample template for Webhook notification:
Here's how the notification would look like when the above template is used in the notification rule:

Each notification method has its own payload format. Ensure that your custom template matches the expected format for the notification method you are using. Any mismatch in the payload format will result in the notification sent in the default format.
Once applied, the custom template overrides the default webhook payload sent during pipeline execution.
Notification templates for reference
You can also refer to the ready to use default notification templates in the harness-schema gitHub repository.
These templates will help you to understand the payload format better for each notification method.
Variables in notification template
Notification templates support runtime inputs, which must be provided when configuring a notification rule—whether at the Centralised Notification Service (CNS) level or the pipeline level.
If a runtime variable is declared in the template, you will be prompted to enter values or expressions for it when selecting that template during notification rule configuration.
Use the following expression format to reference these variables in your template body: <+notification.variables.testVar>
You can access the event type that triggered the notification using: <+notification.eventType>
In case of failure, you can use the expression <+notification.errorMessage> to view failure information for the pipeline/stage/step.
Reconcile notification rules
If you update a notification template by adding new runtime variables after it has already been attached to a notification rule, you may need to reconcile the rule to ensure those inputs are provided during execution.
Pipeline-level notifications
When a template used in a pipeline-level notification rule configured through the Custom Notification tab is updated, a warning message will appear when you attempt to run the pipeline:
"Entities referenced in this pipeline have been updated. Please reconcile and save the pipeline to run the latest version."
You can still proceed with the run, but any newly added variables will default to an empty string unless resolved.
To fully reconcile the rule with the latest version of the template, you need to reselect the template and provide values for the new inputs:
Go to the Notify tab in the pipeline.
Edit the notification rule.
Navigate to the Templates tab.
Reselect the same notification template.
A prompt will appear asking you to enter values for the new runtime variables.
This updates the pipeline YAML to reference the latest template version and ensures all required inputs are captured.
Improved reconciliation flow
When the feature flag is enabled, pipeline reconciliation for updated notification templates follows an improved, UI-driven flow.
What’s new:
After a notification template is updated, pipelines referencing it show an inline error:
Some of the entities referenced in this pipeline have been updated.

Click the Reconcile button shown in the pipeline editor.
A diff view opens, allowing you to review the updated template inputs. Confirm and save the pipeline.
A yellow banner appears:
Notification inputs in this pipeline have been updated. Please click the Notify tab to review and update them.

Go to the Notify tab. The affected template will display a red warning:
Notification template inputs have been updated. Please update the notification template inputs.

Click into the affected rule, navigate to the Templates tab, reselect the same notification template, and provide values for the new inputs.
Save the notification rule and then save the pipeline.
Once these steps are completed, the pipeline will be fully reconciled with the latest version of the notification template.
Centralised notifications
In Centralised Notification rules, no warning appears when you update a template. However, if a template has changes or new input variables, you can view all the impacted references in the Referenced By section of the template.
To fully reconcile the rule with the latest version of the template, you’ll still need to reselect the template and provide values for the new inputs.
Steps:
Go to Notification Management under Project/Org/Account Settings.
Edit the existing notification rule.
In the Notification Templates step, reselect the same template.
A prompt will appear for you to enter values for the newly added runtime variables.
This process ensures that all new inputs are captured and the rule remains valid.
By re-selecting the updated template in either case, you ensure your rule is aligned with the latest version and that all runtime inputs are explicitly provided.
CD events schema
To align with the CD Events standard, Harness has contributed several notification templates to the public CD Events schema repository based on our supported events.
You can explore these templates here: CD Events Schema on GitHub
The public repository includes a brief explanation of the schema, structure, and supported event types. If you think anything is missing or requires further clarification, feel free to raise a GitHub issue or contact us.
Last updated
Was this helpful?