> For the complete documentation index, see [llms.txt](https://docs.a4b.vn/xflow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.a4b.vn/xflow/core-concepts/input-and-output-schema-definition.md). Agents can also search and read this documentation through its [MCP server](https://docs.a4b.vn/xflow/~gitbook/mcp).

# 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.
