# Input and Output schema definition

The `dataInputSchema` parameter in the Serverless Workflow specification is crucial for validating the input data of a workflow against a predefined JSON Schema. This parameter ensures that the workflow receives the correct data format before any states are executed.

Here is how you can define a `dataInputSchema`:

Data Input Schema Definition

```json
"dataInputSchema": {
   "schema": "URL_to_json_schema",
   "failOnValidationErrors": false
}
```

In the configuration above, the schema property specifies a URI that provides the location of the JSON schema used for validation. This URI could be a classpath URI, a file, or an HTTP URL. For classpath URIs, the JSON schema file should be placed in the project's resources section or any directory that is part of the classpath.

The `failOnValidationErrors` property is an optional flag that controls the workflow's behavior when validation fails. If this flag is not specified or is set to `true`, an exception will be thrown, and the workflow execution will stop. If set to `false`, the workflow will proceed, but a warning log will be generated, detailing the validation errors.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.a4b.vn/xflow/core-concepts/input-and-output-schema-definition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
