API Input and Output nodes define the interface for your deployed flow API. They specify what data the API accepts and what it returns.

API Input Node

The API Input node defines the parameters your API endpoint will accept when called.

Configuration

Define input fields with names and types:

Field Configuration:
  - name: The parameter name (e.g., "text", "url", "productId")
  - type: Data type (string, number, boolean, object, array)
  - required: Whether the field is mandatory
  - description: Help text for API documentation

Example Configuration

Input Fields:
[
  {
    "name": "websiteUrl",
    "type": "string",
    "required": true,
    "description": "The website URL to analyze"
  },
  {
    "name": "maxPages",
    "type": "number",
    "required": false,
    "description": "Maximum pages to crawl (default: 10)"
  }
]

Output Structure

API Input exposes each field as an output variable:

Outputs:
  out.websiteUrl → Can be mapped to downstream nodes
  out.maxPages   → Can be used in node configurations
  out            → Full input object

API Output Node

The API Output node defines what data is returned in the API response.

Configuration

Map data from your flow to output fields:

Output Mapping:
  - Map flow results to named response fields
  - Transform data before returning
  - Include metadata like execution time, status
  - Format as JSON response

Example Mapping

Output Fields:
{
  "summary": <- Prompt.out.summary
  "pageCount": <- WebsiteMapper.out.totalPages
  "processedAt": <- System.timestamp
  "success": true
}
Tip
API Input/Output nodes are only needed when deploying flows as APIs. For internal flow execution, use Dataset Source/Sink instead.

Complete API Flow Example

API Input (define parameters)
  ↓
Website Mapper (use input.websiteUrl)
  ↓
Array Splitter (split URLs)
  ↓
Page Scraper (scrape each page)
  ↓
Prompt (analyze content)
  ↓
Array Flatten (collect results)
  ↓
API Output (return formatted response)

API Request/Response

Request Example

curl -X POST https://api.evaligo.com/flows/your-flow-id/execute \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "websiteUrl": "https://example.com",
    "maxPages": 5
  }'

Response Example

{
  "summary": "Analyzed 5 pages. Main topics: Product features, Pricing, Documentation",
  "pageCount": 5,
  "processedAt": "2024-01-15T10:30:00Z",
  "success": true,
  "executionTime": "12.3s"
}

Best Practices

Input Validation

  • Mark required fields appropriately
  • Provide clear descriptions for each parameter
  • Use appropriate data types
  • Set reasonable defaults for optional fields

Output Structure

  • Return consistent JSON structure
  • Include success/error status
  • Add helpful metadata (timestamp, execution time)
  • Document the response schema

Error Handling

// Success Response
{
  "success": true,
  "data": { ... }
}

// Error Response
{
  "success": false,
  "error": "Invalid URL provided",
  "code": "INVALID_INPUT"
}
Warning
Always validate inputs in your flow logic. API Input node defines the interface but doesn't enforce validation rules.

Advanced Patterns

Nested Input Objects

Input:
{
  "config": {
    "url": "https://example.com",
    "options": {
      "maxDepth": 2,
      "timeout": 30
    }
  }
}

Access: input.config.url, input.config.options.maxDepth

Array Inputs

Input:
{
  "urls": [
    "https://example1.com",
    "https://example2.com"
  ]
}

Use with Array Splitter to process each URL

Conditional Processing

API Input (accepts "mode" parameter)
  → Branch based on mode value
  → Different processing paths
  → API Output (return mode-specific results)

Webhook Integration

Use API nodes to create webhook endpoints:

External System → Webhook (API Input)
  → Process data in flow
  → API Output (acknowledge receipt)
  → Continue processing asynchronously

Testing Your API

Using cURL

# Test with minimal input
curl -X POST https://api.evaligo.com/flows/flow-id/execute \
  -H "Authorization: Bearer KEY" \
  -d '{"url": "https://example.com"}'

# Test with all parameters
curl -X POST https://api.evaligo.com/flows/flow-id/execute \
  -H "Authorization: Bearer KEY" \
  -d '{
    "url": "https://example.com",
    "maxPages": 10,
    "includeImages": true
  }'

Using Postman

  1. Import API documentation from Evaligo
  2. Set Authorization header with your API key
  3. Configure request body with test inputs
  4. Send request and verify response

Automated Testing

import requests

def test_api():
    response = requests.post(
        "https://api.evaligo.com/flows/flow-id/execute",
        headers={"Authorization": f"Bearer {api_key}"},
        json={"url": "https://example.com"}
    )
    assert response.status_code == 200
    assert response.json()["success"] == True

API Documentation Generation

Evaligo automatically generates OpenAPI/Swagger documentation from your API Input/Output nodes:

  • Request schema from API Input configuration
  • Response schema from API Output structure
  • Interactive docs at /flows/flow-id/docs
  • Code examples in multiple languages
Tip
Use clear, descriptive field names in API Input. They become the parameter names in your API documentation and client code.

Related Documentation

Deploying as APIs
Learn how to deploy flows
API Authentication
Secure your API endpoints
API Documentation
Auto-generated API docs