Skip to content

Set Node Expressions Benchmark

This workflow serves as a performance testing and demonstration tool for n8n's Set node expression capabilities. It accepts HTTP POST requests and processes various types of data transformations using different expression patterns to evaluate performance characteristics and showcase expression functionality.

Purpose

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

How It Works

  1. Receive Request: A webhook listens for incoming HTTP POST requests at the /set-expressions-benchmark endpoint
  2. Process Data: The Edit Fields node transforms the incoming webhook data using six different types of expressions:
    • Simple field copying from request headers
    • Dynamic key generation using expressions
    • String concatenation with multiple variables
    • Static value assignment
    • Object passthrough
    • Array creation from object values
  3. Return Response: All processed data is returned to the caller via the webhook response

Workflow Diagram

graph TD
    A[Webhook] --> B[Edit Fields]
    B --> C[Respond to Webhook]

Trigger

  • Type: Webhook (HTTP POST)
  • Path: /set-expressions-benchmark
  • Method: POST
  • Response Mode: Uses response node for controlled output

Nodes Used

Node Type Purpose
Webhook Receives incoming HTTP POST requests and provides request data
Edit Fields (Set) Transforms data using various expression types for benchmarking
Respond to Webhook Returns all processed items back to the caller

External Services & Credentials Required

None - this workflow is self-contained and doesn't require external API connections or credentials.

Environment Variables

No environment variables are required for this workflow.

Data Flow

Input: HTTP POST request with headers and standard webhook payload including: - Request headers (host, user-agent, etc.) - Execution mode information - Webhook URL

Output: JSON object containing: - oneToOneCopy: Host header value - [dynamic key from user-agent]: Static string "Set key with expression" - Multiple variables: Concatenated execution mode and webhook URL - Static value: Number 42 - Object: Complete headers object - Array: Array of all header values

Error Handling

This workflow uses basic n8n error handling. If expressions fail to evaluate or the webhook receives malformed data, n8n's default error responses will be returned. No custom error handling is implemented.

Known Limitations

No specific limitations documented in the business context.

No related workflows specified in the business context.

Setup Instructions

  1. Import Workflow:

    • Copy the workflow JSON
    • In n8n, go to Workflows → Import from JSON
    • Paste the JSON and save
  2. Activate Workflow:

    • Open the imported workflow
    • Click the "Active" toggle to enable the webhook
  3. Test the Workflow:

    • Note the webhook URL from the Webhook node
    • Send a POST request to [your-n8n-instance]/webhook/set-expressions-benchmark
    • Include any headers you want to test with
    • Verify the response contains the transformed data
  4. Customize for Benchmarking:

    • Modify the expressions in the Edit Fields node to test different scenarios
    • Add timing measurements if needed for performance analysis
    • Adjust the response format as required for your testing needs

The workflow is ready to use immediately after activation with no additional configuration required.