--- title: "Update a RAG Collection from a Process" slug: "update-a-rag-collection-from-a-process" updated: 2025-06-09T14:14:05Z published: 2025-06-09T14:14:05Z canonical: "docs.processmaker.com/update-a-rag-collection-from-a-process" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.processmaker.com/llms.txt > Use this file to discover all available pages before exploring further. # Update a RAG Collection from a Process ## Add Files to a RAG Collection from a Process Follow these steps to add files to a RAG collection from a process. ### **Prepare Process Variables** From your process, ensure you have the following variables: - **File ID** – The variable name of the uploaded document (e.g., `file_id`). - **File Name** – The name to assign to the file when saved in the collection (e.g., `file_name`). ### **Create a REST Data Connector** 1. After [creating a REST Data Connector](/v1/docs/create-a-new-data-connector), [set up a REST Data Connector](/v1/docs/edit-a-rest-type-data-connector#edit-configuration-for-a-data-connectors-rest-data-source) using the **Bearer Token** authentication method. 2. Provide a valid **Bearer Token** to authenticate the connection with your ProcessMaker instance. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(346).png) 3. [Create a Resource in the Data Connector](/v1/docs/edit-a-rest-type-data-connectorhttps://docs.processmaker.com/docs/edit-a-rest-type-data-connector#view-or-edit-a-resource-in-a-data-connector) that uses the following API endpoint for collections: ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/Endpoint for Articles.png) ```plaintext https://{server_name}/api/1.0/collections/{collection_id}/records ``` > Replace `{collection_id}` with the ID of your target **RAG Collection**. 1. In the **Body** of the Resource, use the following JSON structure: ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/Articles Body(1).png) ```json {  "data": {    "file": "{{file_id}}",    "name": "{{file_name}}",    "uploads": [      {        "id": "{{file_id}}",        "name": "{{file_name}}"      }    ],    "source_type": "file"  } } ``` --- ### **Add a Data Connector Task** [Insert a Data Connector Task in your process](/v1/docs/data-connector#add-a-data-connector-to-the-process-model), ensuring it comes after the file is uploaded and the file-related variables are populated. ### **Configure Outbound Parameters** Map the process variables to the connector resource in the task's [**Outbound Configuration**](/v1/docs/data-connector#data-connector-panel-settings): - `file_id` → `{{file_id}}` - `file_name` → `{{file_name}}` ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/Article - Outbound.png) ### **Result** Each time a case runs, the Data Connector will automatically insert the uploaded file as a new record in the RAG Collection, triggering the appropriate analysis. > [!NOTE] > To send the `file_name` field to the Data Connector, make sure to enter the full file name including the file extension (e.g., `document.pdf`, `invoice.docx`). ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/Articles - Case.png)