Skip to content

[BENCHMARK] Credential HTTP Request

This workflow serves as a benchmarking tool that tests HTTP request performance with authenticated API calls. It makes three simultaneous requests to mock API endpoints (user events, repository events, and organization events), then aggregates the responses to return status codes for performance analysis.

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 Aggregation: All three responses are merged together
  4. Data Processing: Status codes are extracted from each response
  5. Response Return: The processed data is sent back to the original 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-credential-http-node
  • Activation: Manual POST requests to the webhook URL

Nodes Used

Node Type Node Name Purpose
Webhook Webhook Receives incoming POST requests to start the workflow
HTTP Request Mock public received events Fetches user public 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 status codes from the merged responses
Respond to Webhook Respond to Webhook Returns processed data to the webhook caller

External Services & Credentials Required

Mock API Service

  • Base URL: http://mockapi:8080
  • Endpoints:
    • /users/{username}/received_events/public
    • /repos/{owner}/{repo}/events
    • /orgs/{org}/events

Credentials

  • HTTP Bearer Auth: [BENCHMARK] Dummy HTTP credential
    • Used for authenticating all API requests
    • Credential ID: llLQG3HB5SHW6Tag

Environment Variables

No environment variables are explicitly configured in this workflow. All endpoints use hardcoded mock API URLs.

Data Flow

Input

  • Webhook Request: Any POST request to the webhook endpoint
  • Headers: Standard HTTP headers (host, user-agent, accept)
  • Body: Empty object {}

Output

  • Status Codes: Array of status codes from the three API calls
  • Response Format: JSON containing extracted status codes from each endpoint

Processing

  1. Incoming webhook data triggers three parallel HTTP requests
  2. Each request returns a full HTTP response object
  3. Responses are merged into a single data stream
  4. Status codes are extracted using the expression {{ $json.statusCode }}
  5. Final output contains the status codes for benchmarking analysis

Error Handling

This workflow does not implement explicit error handling. If any of the HTTP requests fail: - The workflow may continue with partial data - Failed requests could cause the merge operation to have missing inputs - No retry logic or fallback mechanisms are configured

Known Limitations

  • No error handling for failed API requests
  • Hardcoded mock API endpoints limit flexibility
  • No timeout configuration for HTTP requests
  • No validation of response data before processing

No related workflows specified in the current context.

Setup Instructions

1. Import the Workflow

  1. Copy the workflow JSON
  2. In n8n, go to Workflows → Import from JSON
  3. Paste the JSON and save

2. Configure Credentials

  1. Create an HTTP Bearer Auth credential named [BENCHMARK] Dummy HTTP credential
  2. Set the bearer token for your mock API service
  3. Assign the credential ID llLQG3HB5SHW6Tag or update the workflow nodes

3. Set Up Mock API Service

  1. Ensure the mock API service is running at http://mockapi:8080
  2. Verify the following endpoints are available:
    • /users/clair.bahringer/received_events/public
    • /repos/udke6pujoywnagxkcvab2riw23khzn2tibo2vincws32qexb50ey7h97d42vnzyol0rxypgsg4pomsf7sgnmdaihstljw8edcijrwmy7mfi76yif19c4/47i31dh737el215j62ts2f2782nw3ss26rul3s8jw13u3vu0xm349a5hyay5asmwnlnf7nx8p9h4g62so6s1cis7xv9puj5j98t4m980sbe2455fn1obccjl/events
    • /orgs/g02pp066qoyithcjevhd6m1wfii3c4x51k39n9apybljhx69/events

4. Test the Workflow

  1. Activate the workflow
  2. Make a POST request to the webhook URL: http://your-n8n-instance/webhook/benchmark-credential-http-node
  3. Verify that status codes are returned in the response

5. Customize for Your Environment

  • Update the mock API URLs to point to your actual test endpoints
  • Modify the credential configuration for your authentication method
  • Adjust the data extraction logic in the "Select statusCode" node as needed