> 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/developer-guide/architecture.md).

# Architecture

The xFlow system is a versatile workflow engine designed to be deployed in any cloud environment or on-premises infrastructure. It incorporates a distributed architecture model capable of handling complex, asynchronous workflows with efficiency and resilience. Below is the technical documentation detailing the architecture of the xFlow system.

<figure><img src="/files/9nFpwXgcPzyhsB5OV5gM" alt=""><figcaption><p>xFlow Architecture</p></figcaption></figure>

Diagram illustrating the detailed components of the xFlow solution and the roles, relationships of these components.&#x20;

(1) All client requests to xFlow are routed through the xFlow Gateway, which then routes requests to corresponding systems such as xPlatform, LowCoder, and xFlow Services. (1a) Requests related to process management and initialization are routed to the xflow-engine service.&#x20;

(2) Requests related to xPlatform services (services with prefix "xp" or authentication, user information) are routed through the xFlow Gateway to the xPlatform Gateway, which further routes them to the respective services. (2a) Upload/download file requests are routed to the xpdms service. (2b) User Task-related requests are routed to the xptask service.&#x20;

(3) Requests related to LowCoder such as form management, query, and datasource handling are routed to the LowCoder system via an Nginx Proxy. (3a) The LowCoder API Service handles the main logic of LowCoder, while the Node Service is utilized when executing queries against datasources not supported by the API Service.

(4) The microservices connect to Kafka for publishing/subscribing messages, with TriggerMesh responsible for routing messages between the xFlow and xPlatform systems.&#x20;

(5) The xflow-engine utilizes Temporal as its core engine to implement the Serverless Workflow Spec.&#x20;

(6) In addition to providing REST APIs related to user task management business, the xptask service also serves as a Plugin Worker of the xflow-engine to execute task initialization based on the logic of User Task State Spec.&#x20;

(7) The LowCoder API Service also functions as a Plugin Worker of the xflow-engine, executing actions corresponding to queries defined within LowCoder.&#x20;

(8) The LowCoder Node Service provides the capability to execute queries related to datasources not supported by the LowCoder API Service.&#x20;

(9) Microservices belonging to xFlow and xPlatform utilize PostgresDB for storing data.&#x20;

(10) The LowCoder API Service utilizes MongoDB to store data such as Forms, Data Sources, Queries, etc.&#x20;

(11) The LowCoder API Service employs Redis as a cache layer.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.a4b.vn/xflow/developer-guide/architecture.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.
