# Event-driven Architectures

\
AI Network works as event-driven application backend. The lifecycle of application request is as follows.

1. Client (dApp) sends transactions to blockchain
2. Block state of blockchain node is updated by the transaction.
3. Block state listener listens to the path and triggers event to the worker.
4. AIN workers executes functions for the path and may generate another transactions. If it generates another transaction it goes to (2) and updates block state.
5. Dapp registers listener to the blockchain data and gets result through the modified blockchain state.

In traditional server-based computing, users need to prepare the server, install OS and necessary drivers and software. Then, users need to manage servers and take care of hardware and software upgrades. To maintain highly-available and scalable servers, users also need to configure load-balancers. The idea behind serverless computing is for developers to focus on writing application code.

![](/files/-LsP9Hvd8kw7OEH41q0r)

Figure1. AIN Triggers listen for value changes of specific paths in the blockchain state. When a trigger is invoked, AIN workers generate additional transactions as a result. These additional transactions may subsequently trigger other workers if necessary.<br>


---

# 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.ainetwork.ai/ain-blockchain/ai-network-design/event-driven.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.
