Skip to main content

Http In

Listen for incoming HTTP requests.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.

Output

  • Body - The body of the incoming HTTP request.
  • Headers - The headers of the incoming HTTP request.
  • Cookies - The cookies of the incoming HTTP request.
  • Query Params - The query parameters of the incoming HTTP request.
  • Path Params - The path parameters of the incoming HTTP request.

Options

  • Method - The HTTP method used for the incoming request. Possible values: GET, POST, PUT, DELETE, PATCH.
  • Endpoint - The endpoint that is being listened for incoming requests.
  • IP - The IP address to bind to (default: 127.0.0.1).
  • Port - The port to listen on (default: 9090).

The HTTP In node listens for incoming HTTP requests on the specified endpoint. The output properties provide information about the incoming HTTP request, such as the body, headers, cookies, query parameters, and path parameters. The options properties specify the HTTP method, endpoint, IP address, and port that is being listened on.

How It Works

The HTTP In node creates a web server to receive incoming HTTP requests:

  1. Server Initialization:

    • Creates or reuses an Echo web server instance on the specified IP and port
    • Automatically adds CORS middleware to allow cross-origin requests
    • Supports SSL/TLS if configured in settings
    • Multiple HTTP In nodes can share the same server instance
  2. Route Registration:

    • Registers the endpoint with the specified HTTP method (GET, POST, PUT, DELETE, PATCH)
    • Endpoint automatically gets "/" prefix if not provided
    • Supports path parameters using Echo routing syntax (e.g., /users/:id)
  3. Request Handling:

    • When a request arrives, extracts body, headers, cookies, query params, and path params
    • Attempts to parse body as JSON; falls back to string if parsing fails
    • Generates a unique request ID for correlation with HTTP Out response
    • Emits the request data to the flow
  4. Response Correlation:

    • Waits for corresponding HTTP Out node to provide response
    • Uses request ID to match request with response
    • Returns the response to the HTTP client

Requirements

  • HTTP Method: Must be selected (GET, POST, PUT, DELETE, or PATCH)
  • Endpoint: Valid URL path (automatically prefixed with / if missing)
  • IP Address: Valid IP to bind to (defaults to 127.0.0.1 for localhost)
  • Port: Available port number (defaults to 9090, configurable via settings)
  • HTTP Out Node: Must have a corresponding HTTP Out node to send responses

Error Handling

Error CodeDescriptionSolution
Core.Net.HttpIn.ErrOnCreateConfiguration parsing failed during node creationCheck node configuration including IP, port, and endpoint
Core.Net.HttpIn.ErrNoMethodHTTP method is not selectedSelect a valid HTTP method (GET, POST, PUT, DELETE, PATCH)
Core.Net.HttpIn.OnMessageMessage parsing errorVerify message format is valid JSON

Runtime Errors:

  • Port already in use: Change port number or stop conflicting service
  • Server startup failure: Check IP address validity and network permissions
  • SSL certificate errors: Verify SSL certificate and key file paths if SSL is enabled

Usage Examples

Example 1: Simple REST API Endpoint

// HTTP In configuration:
// Method: POST
// Endpoint: /api/users
// IP: 127.0.0.1
// Port: 9090

// After request is received:
// msg.body contains {"name": "John", "email": "john@example.com"}
// msg.headers contains {"content-type": "application/json", ...}
// msg.queryParams is empty
// msg.pathParams is empty

Example 2: Endpoint with Path Parameters

// HTTP In configuration:
// Method: GET
// Endpoint: /api/users/:userId/posts/:postId
// IP: 127.0.0.1
// Port: 9090

// Request: GET http://localhost:9090/api/users/123/posts/456
// After request is received:
// msg.pathParams contains {"userId": "123", "postId": "456"}
// msg.queryParams is empty
// msg.body is empty (GET request)

Example 3: Webhook with Query Parameters

// HTTP In configuration:
// Method: POST
// Endpoint: /webhook
// IP: 0.0.0.0 // Listen on all interfaces
// Port: 8080

// Request: POST http://server:8080/webhook?token=abc123&source=github
// After request is received:
// msg.queryParams contains {"token": ["abc123"], "source": ["github"]}
// msg.body contains the webhook payload
// msg.headers contains request headers including user-agent

Usage Notes

  • Default Values: IP defaults to 127.0.0.1 (localhost), Port defaults to 9090
  • Server Reuse: Multiple HTTP In nodes on the same IP:Port share the same server instance
  • CORS: Automatically enabled for all origins with common HTTP methods
  • Body Parsing: JSON bodies are automatically parsed; other formats remain as strings
  • Header Normalization: Header names are converted to lowercase
  • Cookie Extraction: Cookie names are converted to lowercase
  • SSL Support: Enable via configuration settings (core.net.httpin.ssl)
  • Path Parameters: Use Echo syntax with colons (e.g., /users/:id)
  • Request ID: Automatically generated unique ID for request/response matching
  • Blocking: Flow waits at HTTP In until HTTP Out sends response

Tips

  • Use 127.0.0.1 for local testing, 0.0.0.0 to accept external connections
  • Always pair HTTP In with HTTP Out to avoid request timeouts
  • Use path parameters for RESTful API designs
  • Check query parameters for optional filters and pagination
  • Validate incoming data before processing
  • Set appropriate timeout values in HTTP clients calling your endpoints
  • Use SSL in production for secure communications
  • Monitor port availability to avoid conflicts
  • Consider using reverse proxy (nginx, Apache) for production deployments
  • Log request details for debugging and monitoring
  • HTTP Out - Required to send responses back to HTTP In requests
  • HTML Template - Generate dynamic HTML responses
  • JSON - Parse and validate incoming JSON data
  • Conditional - Route requests based on path, method, or parameters
  • Try-Catch - Handle request processing errors gracefully