Workflow Engine

n8n Automation

Modular workflows combining webhooks, JSON validation, Code nodes, conditional routing and integrations with connected services.

n8n Webhooks Code Node JSON Conditional Routing

Developer-oriented workflow design

n8n combines visual orchestration with code and direct access to structured data, making each transformation and routing decision visible.

01

Webhook processing

Receive JSON requests, inspect incoming fields and return a controlled response to the calling system.

02

Code-based transformation

Use JavaScript inside Code nodes to validate, normalise and enrich data before later workflow steps use it.

03

Routing and integration

Select a route from the normalised data and connect the result to storage, notifications, APIs or other business services.

n8n examples and patterns

The lead-routing starter is included as an importable workflow. Additional cards describe patterns that can be added after credentials and connected services are configured.

01 Starter included

Lead Intake & Smart Routing

Receives a lead through a webhook, validates the JSON payload, normalises the values and selects a processing queue.

Webhook Code Node JSON Routing
Receive → Validate → Route
02 Workflow pattern

API Orchestration

A reusable pattern for combining multiple HTTP requests, transforming each response and producing one normalised result.

HTTP Request API Merge Code
Request → Transform → Merge
03 Workflow pattern

Error & Recovery Branch

A workflow pattern for separating failed items, recording diagnostic information and notifying the responsible queue without losing context.

Error Route Logging Notification
Error → Log → Notify

Lead Intake & Smart Routing

The starter workflow deliberately stops at a JSON response. Storage and email nodes should only be added after the relevant n8n credentials are configured.

Validate, normalise and route webhook data

The workflow receives an enquiry, checks the required fields, converts values to a consistent form and selects a queue based on the requested service.

Trigger Webhook request
→
Code Validate and normalise
→
Logic Select processing route
→
Response Return structured result

Test the routing rules

The same validation and routing behaviour is reproduced locally, so the workflow can be inspected without exposing an n8n webhook publicly.

Incoming webhook JSON

Change the service or enter an invalid email to see how the validator responds.

Webhook payload received
JSON parsed
Required fields validated
Values normalised
Route selected

Routing result

Successful input produces a normalised object and the name of the selected processing route.

{
    "status": "Run the validator to inspect the result"
}

Importable n8n starter

Import the JSON into n8n, inspect every node and test both valid and invalid webhook requests before marking the workflow as completed.

n8n-lead-routing-starter.json

Webhook → JavaScript validation and routing → Respond to Webhook. The file contains no connected account credentials.

Download workflow
n8n

Workflow canvas

Add a screenshot after importing and successfully running the starter workflow.

assets/automations/n8n-lead-routing-workflow.png
✓

Execution evidence

Capture one valid route and one rejected request after testing the actual n8n workflow.

assets/automations/n8n-lead-routing-execution.png