Retrieve simulation results from specific nodes within your GraphorLM flows. This endpoint provides access to the output data generated during node simulation (not from deployed flow execution) with pagination support.

Overview

Load simulation data from individual flow nodes for debugging, analysis, or testing purposes. Each node type returns different data structures based on their simulated processing function.
  • Method: POST
  • URL: https://{flow_name}.flows.graphorlm.com/nodes/results
  • Authentication: Required (API Token)

Authentication

All requests must include a valid API token in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN
Learn how to generate API tokens in the API Tokens guide.

Request Format

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Content-Typeapplication/jsonYes

Request Body

The request body should be a JSON object with the following fields:
FieldTypeRequiredDescription
node_idstringYesThe unique identifier of the node to load data from
pageintegerNoPage number for pagination (starts from 1)
page_sizeintegerNoNumber of items per page (default: 10, max: 100)

Example Request

{
  "node_id": "chunking-1748287628685",
  "page": 1,
  "page_size": 20
}

Response Format

Success Response (200 OK)

{
  "success": true,
  "message": "Node simulation data loaded successfully for 'chunking-1748287628685'",
  "items": [
    {
      "id": "chunk-001",
      "content": "Machine learning is a subset of artificial intelligence that enables computers to learn and improve from experience without being explicitly programmed.",
      "metadata": {
        "chunk_index": 0,
        "source_file": "ml-basics.pdf",
        "page_number": 1,
        "chunk_size": 150,
        "embedding_model": "text-embedding-3-small"
      },
      "embedding": [0.1234, -0.5678, 0.9101, "..."],
      "score": 0.95
    },
    {
      "id": "chunk-002", 
      "content": "Supervised learning algorithms learn from labeled training data to make predictions on new, unseen data.",
      "metadata": {
        "chunk_index": 1,
        "source_file": "ml-basics.pdf",
        "page_number": 1,
        "chunk_size": 105,
        "embedding_model": "text-embedding-3-small"
      },
      "embedding": [0.2345, -0.6789, 0.1234, "..."],
      "score": 0.89
    }
  ],
  "total": 420,
  "page": 1,
  "page_size": 20,
  "total_pages": 21
}

Response Structure

FieldTypeDescription
successbooleanWhether the simulation data loading operation was successful
messagestringHuman-readable message about the operation result
itemsarrayArray of simulation data objects from the specified node
totalintegerTotal number of items available across all pages
pageintegerCurrent page number (if pagination was used)
page_sizeintegerNumber of items per page (if pagination was used)
total_pagesintegerTotal number of pages available

Node Data Structures by Type

The structure of items varies based on the node type:

Chunking Node Data

{
  "id": "chunk-001",
  "content": "Chunk content...",
  "metadata": {
    "source_file": "document.pdf",
    "chunk_size": 1000,
    "embedding_model": "text-embedding-3-small"
  },
  "embedding": [0.1234, -0.5678, "..."]
}

LLM Node Data

{
  "id": "answer-001",
  "content": "Generated response...",
  "metadata": {
    "question": "What is machine learning?",
    "model": "gpt-4",
    "generation_time": 2.34
  }
}

Code Examples

JavaScript/Node.js

async function loadNodeResults(flowName, nodeId, options = {}, apiToken) {
  const url = `https://${flowName}.flows.graphorlm.com/nodes/results`;
  
  const payload = {
    node_id: nodeId,
    ...(options.page && { page: options.page }),
    ...(options.pageSize && { page_size: options.pageSize })
  };

  const response = await fetch(url, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(payload)
  });

  if (!response.ok) {
    const errorData = await response.json();
    throw new Error(`Failed to load node results: ${errorData.detail}`);
  }

  return await response.json();
}

// Usage - Load simulation results from a node
loadNodeResults('my-rag-pipeline', 'chunking-123', { page: 1, pageSize: 20 }, 'YOUR_API_TOKEN')
  .then(results => {
    console.log(`Total simulation items: ${results.total}`);
    console.log(`Simulation items on this page: ${results.items.length}`);
  })
  .catch(error => console.error('Error:', error));

Python

import requests

def load_node_results(flow_name, node_id, api_token, page=None, page_size=None):
    url = f"https://{flow_name}.flows.graphorlm.com/nodes/results"
    
    payload = {"node_id": node_id}
    if page is not None:
        payload["page"] = page
    if page_size is not None:
        payload["page_size"] = page_size
    
    headers = {
        "Authorization": f"Bearer {api_token}",
        "Content-Type": "application/json"
    }
    
    response = requests.post(url, headers=headers, json=payload)
    response.raise_for_status()
    
    return response.json()

# Usage - Load simulation results from a node
try:
    results = load_node_results("my-rag-pipeline", "chunking-123", "YOUR_API_TOKEN", page=1, page_size=20)
    print(f"Total simulation items: {results['total']}")
    print(f"Simulation items on this page: {len(results['items'])}")
except Exception as e:
    print(f"Error: {e}")

cURL

curl -X POST "https://my-rag-pipeline.flows.graphorlm.com/nodes/results" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "node_id": "chunking-123",
    "page": 1,
    "page_size": 20
  }'

Error Responses

Common Error Codes

Status CodeDescriptionCommon Causes
400Bad RequestInvalid node ID, malformed pagination parameters
401UnauthorizedInvalid or missing API token
404Not FoundFlow not found, node not found in the specified flow
500Internal Server ErrorNode data loading failed, processing error

Error Response Format

{
  "detail": "Error message describing what went wrong"
}

Example Error Responses

Flow Not Found

{
  "detail": "Flow with name 'my-rag-flow' not found"
}

Node Not Found

{
  "detail": "Node with id 'invalid-node-id' not found in flow 'my-rag-flow'"
}

Invalid Pagination

{
  "detail": "page_size must be between 1 and 100"
}

Simulation Data Loading Failed

{
  "detail": "Failed to load node simulation data"
}

Use Cases

Simulation Data Analysis

Examine the simulation output data from different node types to validate processing logic and data structures.

Debug Node Issues

Identify problems in individual nodes by examining their simulation results before deploying the flow.

Testing and Validation

Extract simulation data to test node configurations and validate processing logic before production deployment.

Best Practices

  • Pagination: Use appropriate page sizes (20-100 items) for optimal performance
  • Error Handling: Implement proper error handling for API failures
  • Data Validation: Validate expected data structures from different node types
  • Security: Secure API token storage and rotation

Troubleshooting

Next Steps

After loading node simulation results, you can: The Load Node Results API provides access to simulation data from your flow nodes with pagination support, enabling testing, debugging, and validation of node configurations before deployment.