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

# Export and Import Flows

> Hướng dẫn xuất Flow ChatbotX thành file, nhập Flow vào workspace và theo dõi kết quả trong Import history.

Tính năng **Export** và **Import Flow** giúp bạn sao lưu một Flow, chuyển Flow sang workspace khác hoặc tái sử dụng một kịch bản đã có mà không cần tạo lại từ đầu.

<CardGroup cols={3}>
  <Card title="Export">
    Tải Flow hiện tại xuống dưới dạng file `.chatbotx-flow.json`.
  </Card>

  <Card title="Import Flow">
    Nhập file Flow vào danh sách Flows của workspace.
  </Card>

  <Card title="Import history">
    Theo dõi trạng thái và kết quả của từng lần nhập.
  </Card>
</CardGroup>

## Xuất một Flow

<Steps>
  <Step title="Mở Flow cần xuất">
    Vào **Flows**, sau đó mở Flow bạn muốn sao lưu hoặc chuyển sang workspace khác.
  </Step>

  <Step title="Mở menu của Flow">
    Trong Flow Builder, nhấn biểu tượng **ba chấm** ở góc trên bên phải.
  </Step>

  <Step title="Chọn Export">
    Chọn **Export** để tải Flow xuống thiết bị. Tên file xuất có phần mở rộng `.chatbotx-flow.json`.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/chatbotx/NBKD8ybvpSashSZq/images/flow_export_menu.png?fit=max&auto=format&n=NBKD8ybvpSashSZq&q=85&s=45d307587ba34f0f7f7275e19d36ba3d" alt="Flow Export Menu" width="3192" height="1825" data-path="images/flow_export_menu.png" />
</Frame>

## Nhập một Flow

<Steps>
  <Step title="Mở danh sách Flows">
    Vào **Flows** trong workspace nhận Flow.
  </Step>

  <Step title="Chọn Import Flow">
    Nhấn **Import Flow**, sau đó chọn file `.chatbotx-flow.json` đã xuất từ ChatbotX.
  </Step>

  <Step title="Theo dõi quá trình nhập">
    ChatbotX xử lý file và thêm Flow vào workspace. Nhấn **Import history** để kiểm tra kết quả.
  </Step>

  <Step title="Kiểm tra Flow đã nhập">
    Mở Flow mới, kiểm tra nội dung và kết nối giữa các block, sau đó nhấn **Publish** khi Flow đã sẵn sàng sử dụng.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/chatbotx/aI5-2QvJBJUU7JpJ/images/flow_import_button.png?fit=max&auto=format&n=aI5-2QvJBJUU7JpJ&q=85&s=94f926ffe08931124566f19cda28f9df" alt="Flow Import Button" width="2595" height="1664" data-path="images/flow_import_button.png" />
</Frame>

## Xem Import history

Trang **Import history** hiển thị kết quả của từng file đã nhập:

* **Name**: Tên file Flow.
* **Status**: Trạng thái xử lý hiện tại.
* **Progress**: Số Flow đã xử lý trên tổng số Flow trong lần nhập.
* **Success**: Số Flow được nhập thành công.
* **Failed**: Số Flow nhập không thành công.
* **Created At**: Thời điểm bắt đầu nhập.
* **Completed at**: Thời điểm hoàn tất.

Ví dụ, **Status** là **Completed**, **Success** là `1` và **Failed** là `0` nghĩa là một Flow đã được nhập thành công.

<Frame>
  <img src="https://mintcdn.com/chatbotx/aI5-2QvJBJUU7JpJ/images/flow_import_history.png?fit=max&auto=format&n=aI5-2QvJBJUU7JpJ&q=85&s=92f2f7c85081eb173a10f1a7bf3de83e" alt="Flow Import History" width="3187" height="672" data-path="images/flow_import_history.png" />
</Frame>

## Ví dụ sử dụng

Bạn đã tạo một Flow thu thập thông tin khách hàng trong workspace chính và muốn dùng lại trong workspace mới:

1. Mở Flow gốc và chọn **Export**.
2. Chuyển sang workspace mới, vào **Flows** và chọn **Import Flow**.
3. Mở **Import history** để xác nhận file đã được xử lý thành công.
4. Mở Flow vừa nhập, điều chỉnh nội dung cho workspace mới và nhấn **Publish**.

<Note>
  Hãy giữ lại file `.chatbotx-flow.json` nếu bạn muốn dùng làm bản sao lưu hoặc nhập lại Flow vào một workspace khác.
</Note>
