﻿# Data validation in business processes for scripts and API methods

> [HTML Version](validation-in-processes.html)

To ensure the accuracy of information saved during business process execution, system data validation applies in the following cases:

- When running scripts in business processes:

	- In the [Script](360027203731.md) activity.

	- In a [gateway](360012495911.md#service-variable-tab), if transition routing uses a system variable calculated by a script.

	- In a [custom script process activity](script-activity.md).

- When calling [API methods](https://api.brix365.com/en/public-api/reference/bpm/) used to:

	- Start a business process.

	- Change process instance context.

	- Complete a task.

## How validation errors are handled

If an invalid value is passed to a script or API method:

1. In system versions 2026.4 through 2026.7, data is saved, and the error is logged in the **processor** service log.

2. Starting with version 2026.8:

- For scripts, process instance execution terminates, and the error appears in [Error monitor](error_monitor.md).

- For API methods, the action is not executed, and an error response is returned.

## Data validation example

Suppose a customer order from an external system triggers a business process in BRIX via API. When processing the request, input data for the method call is validated. For example, if non-existent subtypes are specified for **Phone number**, **Email**, or **Account** fields:

- In system versions 2026.4 through 2026.7, the process starts, and a validation error is recorded in the **processor** service log.

- In version 2026.8 and later, the process does not start to prevent saving invalid data.

## Troubleshooting validation errors

If data validation errors occur:

1. Identify where invalid data is passed from for script execution or API method calls.

2. Check that required fields are completed.

3. Make sure all values use the correct format.