# AI & Validation

## Bedrock AI

Invokes an AI model to classify, extract, or summarise data within a workflow.

<figure><img src="/files/2IQ3hWRQ6eGdDFj15ZfP" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/mLUetGnCBHQRwi1hSz50" alt=""><figcaption></figcaption></figure>

| Field             | Description                                                             |
| ----------------- | ----------------------------------------------------------------------- |
| **Model ID**      | The AI model to use (e.g., `anthropic.claude-3-haiku-20240307-v1:0`)    |
| **Prompt**        | Supports `{$.body.field}` placeholders or a JSONPath to a prompt string |
| **System Prompt** | Optional system instructions                                            |
| **Max Tokens**    | Maximum response length (default: 1024)                                 |

The next task receives the model's response in this format:

```json
{
  "statusCode": 200,
  "body": {
    "content": [{ "type": "text", "text": "The model's response..." }]
  }
}
```

Extract the response text in a downstream JSONata task: `$states.input.body.content[0].text`

**Use cases:** classification, data extraction from unstructured text, summarisation, decision support.

## Schema Validator

Validates the step input against a JSON Schema. If validation fails, the step errors — catchable with an Error Boundary.

<figure><img src="/files/LppBMteVdLZtQ60HPgvQ" alt=""><figcaption></figcaption></figure>

| Field           | Description                                  |
| --------------- | -------------------------------------------- |
| **JSON Schema** | Standard JSON Schema definition              |
| **Edit**        | Opens an editor with live validation preview |

If validation passes, the input is passed through unchanged to the next step.


---

# 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://help.tillit.cloud/tillit/knowledge-base/setting-up-tillit/integrations/wire-flow/task-types-and-integrations/ai-and-validation.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.
