Overview
The Update Dataset endpoint allows you to modify the configuration of dataset nodes within your flows. Dataset nodes are components that connect document sources to your flow pipeline, and updating them is essential for managing data inputs and keeping your RAG pipelines current.- Method: 
PATCH - URL: 
https://{flow_name}.flows.graphorlm.com/datasets/{node_id} - Authentication: Required (API Token)
 
Authentication
All requests must include a valid API token in the Authorization header:Learn how to generate API tokens in the API Tokens guide.
Request Format
Headers
| Header | Value | Required | 
|---|---|---|
Authorization | Bearer YOUR_API_TOKEN | Yes | 
Content-Type | application/json | Yes | 
URL Parameters
| Parameter | Type | Required | Description | 
|---|---|---|---|
flow_name | string | Yes | The name of the flow containing the dataset node | 
node_id | string | Yes | The unique identifier of the dataset node to update | 
Request Body
The request body should be a JSON object with the following structure:| Field | Type | Required | Description | 
|---|---|---|---|
config | object | Yes | The new configuration for the dataset node | 
config.files | array | No | List of file names to include in the dataset node | 
Example Request
Response Format
Success Response (200 OK)
The response contains confirmation of the successful update:Response Fields
| Field | Type | Description | 
|---|---|---|
success | boolean | Whether the update operation was successful | 
message | string | Descriptive message about the operation result | 
node_id | string | The ID of the updated dataset node | 
Code Examples
JavaScript/Node.js
Python
cURL
PHP
Error Responses
Common Error Codes
| Status Code | Description | Example Response | 
|---|---|---|
| 400 | Bad Request - Invalid configuration or files not found | {"detail": "The following files do not exist as sources in the dataset: missing_file.pdf"} | 
| 401 | Unauthorized - Invalid or missing API token | {"detail": "Invalid authentication credentials"} | 
| 404 | Not Found - Flow or dataset node not found | {"detail": "Dataset node with id 'invalid-node' not found in flow 'my-flow'"} | 
| 500 | Internal Server Error - Server error | {"detail": "Failed to update dataset node"} | 
Error Response Format
Example Error Responses
Files Not Found in Dataset
Dataset Node Not Found
Flow Not Found
Invalid API Token
Update Behavior
Node Status Changes
When you update a dataset node:- Configuration Updated: The node’s file list is replaced with the new configuration
 - Status Reset: The node is marked as 
"updated": falseto indicate it needs reprocessing - Successor Nodes: All downstream nodes in the flow are also marked as needing updates
 - Flow State: The flow maintains its deployed status but requires redeployment to apply changes
 
File Validation
The endpoint validates that:- All specified files exist as sources in the project
 - At least one file is specified (empty lists are not allowed)
 - File names exactly match uploaded source files (case-sensitive)
 
Integration Examples
Dataset Configuration Manager
Batch Configuration Tool
Best Practices
Configuration Management
- Validate Files First: Use the List Sources endpoint to verify file availability before updating
 - Backup Configurations: Save current configurations before making changes
 - Incremental Updates: Make small, incremental changes rather than large configuration replacements
 - Document Changes: Keep track of configuration changes for rollback purposes
 
File Organization
- Consistent Naming: Use clear, consistent file naming conventions
 - Logical Grouping: Group related files in the same dataset nodes
 - Version Control: Include version information in file names when appropriate
 - Size Considerations: Balance the number of files per node for optimal performance
 
Error Handling
- Validate Before Update: Check that files exist before attempting updates
 - Handle Partial Failures: In batch operations, handle individual failures gracefully
 - Retry Logic: Implement retry mechanisms for transient failures
 - Detailed Logging: Log all configuration changes for audit trails
 
Troubleshooting
Files Not Found Error
Files Not Found Error
Solution: Verify that all files in your configuration exist as sources:
- Use the List Sources endpoint to check available files
 - Ensure file names match exactly (case-sensitive)
 - Upload missing files using the Upload Source endpoint
 - Check for typos in file names
 
Dataset Node Not Found
Dataset Node Not Found
Solution: Verify the node ID is correct:
- Use the List Dataset Nodes endpoint to get valid node IDs
 - Ensure the node exists in the specified flow
 - Check that the node type is actually “dataset”
 - Verify you’re using the correct flow name
 
Empty Files Configuration
Empty Files Configuration
Solution: At least one file must be specified:
- Include at least one valid file in the 
filesarray - Remove the node from the flow if no files are needed
 - Consider using a different node type if files aren’t required
 
Update Not Reflected
Update Not Reflected
Solution: After updating configuration:
- The node is marked as 
"updated": falseand needs reprocessing - Deploy the flow again to apply configuration changes
 - Check the node status using the List Dataset Nodes endpoint
 - Allow time for the system to process the changes
 
Network Connection Issues
Network Connection Issues
Solution: For connectivity problems:
- Check your internet connection
 - Verify the flow URL is accessible
 - Ensure your firewall allows HTTPS traffic
 - Try the request from a different network
 

