Overview
The Simulate Flow endpoint executes your complete flow using the current configuration data, allowing you to test the entire pipeline before deploying. This is essential for validating flow logic and ensuring proper functionality.Response Node Required: Your flow must have a configured Response Node for simulation to work properly. The simulation executes the complete pipeline and returns results from the Response Node.
- Method:
POST
- URL:
https://{flow_name}.flows.graphorlm.com/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 fields:Field | Type | Required | Description |
---|---|---|---|
query | string | Yes | The query to process through the flow simulation |
page | integer | No | Page number for pagination (starts from 1) |
page_size | integer | No | Number of items per page (default: 10, max: 100) |
Example Request
Response Format
Success Response (200 OK)
Response Structure
Field | Type | Description |
---|---|---|
items | array | Array of document results from the flow simulation |
total | integer | Total number of items available across all pages |
page | integer | Current page number (if pagination was used) |
page_size | integer | Number of items per page (if pagination was used) |
total_pages | integer | Total number of pages available |
Document Structure
Each document in theitems
array contains:
Code Examples
JavaScript/Node.js
Python
cURL
Error Responses
Common Error Codes
Status Code | Description | Common Causes |
---|---|---|
400 | Bad Request | Invalid query or malformed request parameters |
401 | Unauthorized | Invalid or missing API token |
404 | Not Found | Flow not found or not accessible |
500 | Internal Server Error | Flow simulation failed, processing error |
Error Response Format
Example Error Responses
Flow Not Found
Invalid Query
Flow Simulation Failed
Missing Response Node
Use Cases
Pre-Deployment Testing
Test your complete flow configuration before deploying to ensure all nodes work together correctly.Query Validation
Validate that your flow produces expected results for different types of queries.Performance Testing
Test flow performance and response quality with current configuration settings.Best Practices
- Configure Response Node: Ensure your flow has a properly configured Response Node to generate responses
- Test Before Deploy: Always simulate flows before deploying to production
- Query Variety: Test with different types of queries to ensure robustness
- Error Handling: Implement proper error handling for simulation failures
- Performance Monitoring: Monitor simulation response times and quality
Troubleshooting
Flow Simulation Failed
Flow Simulation Failed
Solution: If flow simulation fails:
- Verify all nodes in the flow are properly configured
- Ensure you have a Response Node configured in your flow
- Check that dataset nodes have valid file selections
- Ensure node dependencies are correctly set up
Missing Response Node
Missing Response Node
Solution: For “No Response Node found” errors:
- Add a Response Node to your flow
- Configure the Response Node with a valid model and prompt
- Connect the Response Node properly to receive input from other nodes
- The Response Node generates the final answers for your flow
No Results Returned
No Results Returned
Solution: For empty result sets:
- Verify the query is appropriate for your dataset
- Check that chunking and retrieval nodes are configured correctly
- Ensure your dataset contains relevant content
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
Next Steps
After simulating your flow, you can:Analyze Results
Review simulation results to validate flow performance
Update Configuration
Adjust node settings based on simulation feedback
Deploy Flow
Deploy your flow after successful simulation testing
Run Production Flow
Execute your deployed flow with real queries