> ## Documentation Index
> Fetch the complete documentation index at: https://explore.airia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Airia Agent Trigger

# Airia Agent Trigger

The Airia Agent trigger lets you automatically run an Agent on each file after its ingestion into a data source completes. Use it for downstream automation — for example, sending notifications, tagging or enriching records in external systems, or kicking off follow-up workflows whenever new content lands in your knowledge base.

## What It Does

When an Agent trigger is configured on a data source, the platform executes the selected Agent **once per file**, immediately after that file finishes ingesting. This applies both to newly added files and to updated files that are re-ingested during a sync.

Each execution passes two input variables to the Agent:

| Variable   | Description                                           |
| ---------- | ----------------------------------------------------- |
| `store_id` | The ID of the data source the file was ingested into. |
| `file_id`  | The ID of the ingested file.                          |

The Agent run is **asynchronous**: ingestion does not wait for the Agent to finish, and the outcome of the Agent run has no effect on the ingestion itself. The file's content is not passed to the Agent directly — use the `file_id` and `store_id` variables within your Agent to look up the file's details or content via Airia tools or the API.

## How to Set It Up

### 1. Prepare the Agent

The trigger works with any Agent in your tenant. To receive the trigger context, define two input variables on the Agent's **Input** step, named exactly `store_id` and `file_id`. Variables with other names are not populated.

> 💡 Note: The Agent runs with no user input text — design it to work from the `store_id` and `file_id` variables alone.

### 2. Select the Agent During Data Source Creation

1. In your project, go to **Data Sources** and click **Add data source**.
2. Select a connector and fill in its configuration details.
3. In the **Airia Agent trigger** section (marked *Optional*, above **Ingestion settings**), open the selector and search for the Agent you want to run. Agents are listed as *Agent name - Project name*.
4. To disable the trigger, leave the selection as **None**.
5. Complete the remaining steps and click **Done** to create the data source.

> 💡 Note: The Agent list is scoped to the projects selected for the data source. If you change the project selection and the chosen Agent is no longer in scope, the selection is cleared.

### 3. View the Configuration

After creation, open the data source and expand **Ingestion settings**. The **Airia Agent trigger** summary shows the configured Agent and its project.

## Limitations

* **Configured at creation only.** The Agent trigger can only be set when the data source is created. It cannot currently be added, changed, or removed on an existing data source.
* **Successful ingestions only.** The Agent fires only after a file ingests successfully. Files that fail ingestion or are unsupported do not trigger the Agent.
* **Updates re-trigger; unchanged files do not.** When a sync re-ingests a modified file, the Agent runs again for that file. Files skipped by sync as unchanged do not re-trigger.
* **Fire-and-forget execution.** A failed or misconfigured Agent run never blocks or fails ingestion, and failures are not surfaced on the data source. Monitor the Agent's own execution history to verify runs.
* **No retries.** Each file triggers a single Agent execution attempt.
* **Concurrent executions.** A sync that ingests many files starts an independent Agent run for each file, with no ordering guarantee. Consider this when the Agent calls rate-limited external systems.
* **SQL indexing is excluded.** Files processed through SQL indexing (structured CSV/Excel data) do not fire the trigger for that processing path.
* **Agent deletion.** If the configured Agent is later deleted, ingestion continues normally and the trigger silently does nothing.
