Overview
The Simulate Node endpoint allows you to execute a specific node in your flow and returns all nodes that were updated as a result. This includes the target node itself and any downstream nodes that were affected by the execution. This endpoint is essential for testing node configurations, debugging pipeline issues, and validating processing logic without running complete flows.- Method:
POST
- URL:
https://{flow_name}.flows.graphorlm.com/nodes/simulate
- 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 |
Request Body
The request body should be a JSON object with the following required field:Field | Type | Required | Description |
---|---|---|---|
node_id | string | Yes | The unique identifier of the node to simulate within the flow |
Example Request
Response Format
Success Response (200 OK)
Response Fields
Field | Type | Description |
---|---|---|
success | boolean | Whether the node simulation was successful |
message | string | Human-readable message about the simulation result |
updated_nodes | array | Array of node objects that were updated during the simulation |
Node Object Structure
Each node object in theupdated_nodes
array contains:
Field | Type | Description |
---|---|---|
id | string | The unique identifier of the node |
type | string | The type of the node (e.g., “dataset”, “chunking”, “retrieval”) |
data | object | The node’s configuration and result data |
Code Examples
JavaScript/Node.js
Python
cURL
Error Responses
Common Error Codes
Status Code | Description | Common Causes |
---|---|---|
400 | Bad Request | Invalid node ID or malformed request |
401 | Unauthorized | Invalid or missing API token |
404 | Not Found | Flow not found or node not found in the specified flow |
500 | Internal Server Error | Node simulation failed, processing error |
Error Response Format
Example Error Responses
Flow Not Found
Node Not Found
Simulation Failed
Invalid Request
Use Cases
The Simulate Node endpoint serves multiple critical purposes in flow development and maintenance:Testing Node Configuration
Use this endpoint to test how configuration changes affect a specific node’s execution without running the entire flow.Debugging Flow Issues
When a flow isn’t producing expected results, simulate individual nodes to identify where issues occur.Development and Iteration
During flow development, test nodes individually as you build and refine your data processing pipeline.Integration Examples
Node Performance Monitor
Best Practices
Performance Considerations
- Resource Usage: Simulating nodes will consume computational resources similar to running the actual flow
- Rate Limiting: Avoid rapid successive simulations to prevent overwhelming the system
- Performance Monitoring: Track simulation performance to optimize node configurations
- Processing Time: Monitor node execution times for performance optimization
Development Guidelines
- Test Early: Simulate nodes as soon as they’re configured
- Incremental Testing: Test nodes in pipeline order to catch dependencies
- Error Handling: Always implement proper error handling for simulation failures
- Performance Tracking: Monitor execution times and resource usage during simulation
- Configuration Validation: Verify node configurations before simulation to avoid errors
Security and Monitoring
- API Token Management: Secure API token storage and rotation
- Access Control: Limit simulation access to development environments when possible
- Activity Logging: Log simulation activities for debugging and performance monitoring
- Resource Management: Monitor simulation frequency and system resource usage
Troubleshooting
Node Simulation Failed
Node Simulation Failed
Solution: If node simulation fails:
- Verify the node ID exists in the specified flow
- Check that node dependencies are properly configured
- Ensure the node configuration is valid
- Review error logs for specific failure reasons
Simulation Taking Too Long
Simulation Taking Too Long
Solution: For slow simulations:
- Check if the node processes large amounts of data
- Verify system resources are available
- Consider optimizing node configuration (e.g., chunk size for chunking nodes)
- Monitor parallel simulation requests
Connection Issues
Connection Issues
Solution: For connectivity problems:
- Verify your internet connection
- Check that the flow URL is accessible
- Ensure your firewall allows HTTPS traffic to *.flows.graphorlm.com
- Try accessing the endpoint from a different network
Authentication Issues
Authentication Issues
Solution: For authentication problems:
- Verify your API token is valid and not expired
- Check that the token has appropriate permissions for the flow
- Ensure the Authorization header is properly formatted
- Try regenerating your API token if issues persist
Next Steps
After simulating nodes in your flow, you can:Update Node Configuration
Modify node settings based on simulation results
Deploy Flow
Deploy your flow once nodes are working correctly
Run Full Flow
Execute the complete flow pipeline
Flow Overview
Learn about complete flow management and all node types