Skip to content

[BENCHMARK] HTTP Request

This workflow is designed for performance testing and benchmarking HTTP request capabilities. It receives webhook triggers and makes parallel HTTP requests to three different mock API endpoints, then consolidates the responses and returns status information back to the caller.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

How It Works

  1. Webhook Trigger: The workflow starts when a POST request is made to the webhook endpoint
  2. Parallel API Calls: Three HTTP requests are made simultaneously to different mock API endpoints:
    • User public received events
    • Repository events
    • Organization events
  3. Response Consolidation: All three API responses are merged together
  4. Status Extraction: The status codes from the responses are extracted and formatted
  5. Response Return: The consolidated status information is sent back to the webhook caller

Workflow Diagram

graph TD
    A[Webhook] --> B[Mock public received events]
    A --> C[Mock repository events]
    A --> D[Mock organization events]
    B --> E[Merge]
    C --> E
    D --> E
    E --> F[Select statusCode]
    F --> G[Respond to Webhook]

Trigger

  • Type: Webhook (POST)
  • Path: benchmark-http-node
  • Method: POST
  • Response Mode: Response Node (uses dedicated response node)

Nodes Used

Node Type Node Name Purpose
Webhook Webhook Receives incoming POST requests to trigger the workflow
HTTP Request Mock public received events Fetches user public received events from mock API
HTTP Request Mock repository events Fetches repository events from mock API
HTTP Request Mock organization events Fetches organization events from mock API
Merge Merge Combines responses from all three HTTP requests
Set Select statusCode Extracts and formats status codes from responses
Respond to Webhook Respond to Webhook Returns processed data back to webhook caller

External Services & Credentials Required

Mock API Service

  • Service: Internal mock API server
  • Host: mockapi:8080
  • Authentication: None required
  • Endpoints Used:
    • /users/clair.bahringer/received_events/public
    • /repos/{long-repo-id}/events
    • /orgs/{org-id}/events

Credentials

No external credentials are required for this workflow as it uses internal mock services.

Environment Variables

No environment variables are explicitly configured in this workflow. The mock API endpoints are hardcoded to use mockapi:8080.

Data Flow

Input

  • Webhook Request: POST request to /webhook-test/benchmark-http-node
  • Expected Format: Any valid HTTP POST request (body content is not processed)

Output

  • Response Format: JSON array containing status code information
  • Sample Output:
    1
    2
    3
    4
    5
    [
      {"statusCode": 200},
      {"statusCode": 200},
      {"statusCode": 200}
    ]
    

Processing

  1. Incoming webhook data triggers three parallel HTTP requests
  2. Each HTTP request returns full response objects (including status codes, headers, and body)
  3. Responses are merged into a single data stream
  4. Status codes are extracted from each response
  5. Formatted status information is returned to the webhook caller

Error Handling

This workflow does not implement explicit error handling mechanisms. If any of the HTTP requests fail: - The workflow may continue with partial data from successful requests - Failed requests could cause the workflow to stop execution - No retry logic is implemented for failed API calls

Known Limitations

  • No error handling for failed HTTP requests
  • Hardcoded mock API endpoints (not configurable)
  • No authentication or rate limiting considerations
  • Mock API dependency means this workflow only works in environments where the mock service is available

No related workflows are documented in the provided context.

Setup Instructions

  1. Import Workflow:

    • Copy the workflow JSON
    • Import into your n8n instance via the workflow import feature
  2. Configure Mock API:

    • Ensure the mock API service is running on mockapi:8080
    • Verify the mock endpoints are accessible from your n8n instance
  3. Test the Webhook:

    • Activate the workflow
    • Note the webhook URL provided by n8n
    • Send a POST request to test: curl -X POST [your-webhook-url]
  4. Verify Responses:

    • Check that all three HTTP requests complete successfully
    • Confirm the response contains status code information
    • Monitor execution logs for any errors
  5. Customize for Your Environment:

    • Update the HTTP request URLs to point to your actual API endpoints
    • Add authentication if required by your APIs
    • Implement error handling as needed for production use