> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/database-devops/3.0/use-db-devops/understanding-state-of-database/access-applied-changesets.md).

# Accessing Applied ChangeSets in Database DevOps Pipelines

Harness Database DevOps enables users to retrieve the list of change sets applied during a pipeline execution. This is especially useful for audit trails, conditional logic, or notifications post deployment.

This guide outlines how to reference the applied change sets using built-in Harness pipeline expressions.

### Use case <a href="#use-case" id="use-case"></a>

In many organizations, when it comes to database use cases, teams want to:

* Programmatically reference the applied Liquibase change sets after a schema apply step.
* Expose applied changes to downstream steps for notifications or logging.
* Integrate this output into audit/compliance workflows.

Harness supports this via the [`execution` pipeline context](/harness-ai/use-harness-platform/variables-and-expressions/harness-variables.md#hyphens-and-spaces-require-escaping), which can also be auto-completed in the pipeline studio expression input.

### Expression format <a href="#expression-format" id="expression-format"></a>

You can access the list of applied change sets using the following syntax:

```bash
<+execution.steps.<stepGroupName>.steps.<stepName>.output.ChangeSets>
```

This expression retrieves the applied change sets from a specific DBSchemaApply step in your pipeline. Where:

* `<stepGroupName>`: Name of the step group containing the database schema apply step.
* `<stepName>`: Name of the `DBSchemaApply` step.

#### Example usage <a href="#example-usage" id="example-usage"></a>

If the step group is named `test1` and the "DBSchemaApply" step is named `DBSchemaApply_1`, then the expression would be:

```bash
<+execution.steps.test1.steps.DBSchemaApply_1.output.changeSets>
```

Follow the below steps to use this expression in your pipeline:

![Apply ChangeSets Expression](/files/6WHvvPOje6PQk5d4LrPV)

1. Open your pipeline in Harness.
2. After your `Apply Schema` step has been added and configured, click **“Add Step”** and select the **Run** step.
3. Set the step name (e.g. default is, `Run_1`).
4. Under **Container Registry**, select your custom Docker Artifactory connector.
5. Set the **Image** to: `alpine:latest`.
6. In the **Shell** field, enter `sh`.
7. In the **Command** field, enter the following command to print the applied change sets: For example, if your DBSchemaApply step is named `DBSchemaApply_1` and is part of a step group named `test1`, you would use:

```bash
echo <+execution.steps.test1.steps.DBSchemaApply_1.output.ChangeSets>
```

8. Save and run your pipeline.

### How it works <a href="#how-it-works" id="how-it-works"></a>

Harness captures the change sets applied by the "Apply Schema" step and exposes them under that step’s output context. This allows downstream steps in the same stage or pipeline to access this data for validation, notification, or reporting, similar to how pre-start tags or runtime variables work in other Harness modules.

### Practical applications <a href="#practical-applications" id="practical-applications"></a>

You can use this expression to:

* Send Slack or email notifications with the list of applied change sets.
* Store the applied change sets in an external audit system via script steps.
* Gate promotion pipelines by validating that expected changes were deployed.

### Example: notification step <a href="#example-notification-step" id="example-notification-step"></a>

Here’s how you might use this in a custom shell script step to echo the applied changes:

```sh
echo "The following change sets were applied:"
echo <+execution.steps.test1.steps.DBSchemaApply_1.output.ChangeSets>
```

### Next steps <a href="#next-steps" id="next-steps"></a>

* Go to [Apply a DB schema step](/database-devops/3.0/use-db-devops/deployment-pipeline-configuration/step-types/apply-dbschema-step.md) to configure the DBSchemaApply step that exposes this output.
* Go to [Harness variables and expressions](/harness-ai/use-harness-platform/variables-and-expressions/harness-variables.md) to explore additional pipeline expression options.
