# Automation Anywhere

aito.ai works great with several workflow automation platforms, including [Automation Anywhere](https://www.automationanywhere.com/). Read the tips to get things going with Automation Anywhere!

#### Creating schema

We recommend creating the data schema in aito.ai Console or with CLI first, as this way you can ensure everything is set up properly to receive your data.

#### Adding data: REST Web Services

Data can be added to aito.ai by using Automation Anywhere's **REST Web Services POST method** action. **Note!** If you are working with bigger datasets, you should explore batch transfer options.

Check the below screenshots for guidance on how to set up the connection. Here are the steps.

1. To the URI, you should input your aito.ai instance URL and the endpoint you want to use, for data upload it's `/api/v1/data/{your-table-name}`.
2. Add a custom header called `x-api-key`, this header describes the API key of your instance. For extra security you can add the API key to Automation Anywhere's **Credentials** vault.\
   ![cust-header-aa](https://1633683694-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0XkpjEoxAHPaaMvAQgU%2Fuploads%2Fgit-blob-dd0a5dfd222d05359ba216297ab7ad69a36baa5f%2Fcust-header-aa.png?alt=media)
3. For the custom parameters, select **Content type** as JSON and in the **Enter the parameters** section, define the data you want to add to aito.ai. Variables can be accessed with $$ and don't forget to put string variables into quotations marks.
4. Create an output variable for the result, so you can acces the result later in your flow. The result should be the same as you used as input.

![Add\_dat\_AA](https://1633683694-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0XkpjEoxAHPaaMvAQgU%2Fuploads%2Fgit-blob-28c10a71a05cdbf78c7f34e3d7037da0e715d33f%2FAdd_dat_AA.png?alt=media)

#### Making predictions: REST Web Services

Similarly to data upload, aito.ai predictions can also be managed by the **REST Web Services POST method** action.

In the example flow, we download a file from an URL, read the file and iterate through it to predict a suitable category for each of the inputs and store the results in to a file.

![AA-flow](https://1633683694-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0XkpjEoxAHPaaMvAQgU%2Fuploads%2Fgit-blob-571af3bab371ccb7247c9e0a687d51f14952050b%2FAA-flow.png?alt=media)

Let's go over the details how to setup the REST Web Service in order to make predictions using aito.ai.

1. To the URI, you should input your aito.ai instance URL and the endpoint you want to use, for predictions it's `/api/v1/_predict`.
2. Add a custom header called `x-api-key`, this header describes the API key of your instance. For extra security you can add the API key to Automation Anywhere's **Credentials** vault.\
   ![cust-header-aa](https://1633683694-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0XkpjEoxAHPaaMvAQgU%2Fuploads%2Fgit-blob-dd0a5dfd222d05359ba216297ab7ad69a36baa5f%2Fcust-header-aa.png?alt=media)
3. For the custom parameters, select **Content type** as JSON and in the **Enter the parameters** section, define the API query you want to make. Variables can be accessed with $$ and don't forget to put string variables into quotations marks. The data you're using as input should match the schema you have created to your aito.ai instance.
4. Create an output variable for the result, so you can acces the result later in your flow. aito.ai returns JSON responses.

![AA-REST](https://1633683694-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0XkpjEoxAHPaaMvAQgU%2Fuploads%2Fgit-blob-e08e22641b60d68a52c909b3683b6c08e01f855a%2FAA-REST.png?alt=media)

The result JSON can be parsed by using the **String: Extract text** activity or by using a readily made [JSON parser bot](https://botstore.automationanywhere.com/bot/json-parser-bot/)


---

# 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.aito.ai/integrations/automation-anywhere.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.
