IOLEBA

 IOLEBA N8N Textbook – Table of Contents

Chapter 6: Advanced Node Types and Configurations
Chapter 6

Advanced Node Types and Configurations

Introduction

You've mastered the foundational concepts of n8n. Now it's time to explore advanced node types that unlock more powerful automation capabilities. This chapter covers specialized nodes, advanced configuration options, and techniques for building sophisticated workflows.

Function and Code Nodes

While expressions handle simple data manipulation, Function and Code nodes let you write custom JavaScript for complex logic.

Function Node

The Function node executes custom JavaScript code for each item passing through the workflow.

Basic Function Node Example:
// Access item data
const name = $input.item.json.name;
const price = $input.item.json.price;

// Perform calculation
const discountedPrice = price * 0.9;

// Return modified item
return {
  name: name,
  originalPrice: price,
  discountedPrice: discountedPrice,
  savings: price - discountedPrice
};

Code Node

The Code node provides even more flexibility, allowing you to work with all items at once and use npm packages.

Code Node Features:
  • Process all items together (not one at a time)
  • Use external npm libraries
  • Make HTTP requests
  • Complex data transformations
  • Return custom structures

When to Use Function vs Code

Use Function Node When: Use Code Node When:
Processing items individually Need to aggregate all items
Simple transformations Complex calculations across items
Data validation Need npm packages
Quick calculations Advanced data restructuring

Execute Workflow Node

The Execute Workflow node lets you call other workflows from within a workflow, enabling modular design and reusability.

Benefits of Sub-Workflows:
  • Reusability: Create once, use in multiple workflows
  • Organization: Break complex workflows into logical pieces
  • Maintenance: Update logic in one place
  • Testing: Test components independently

Execute Workflow Configuration

Key Settings:
  • Source: Database (call saved workflow) or Parameter (define inline)
  • Workflow ID: Which workflow to execute
  • Data to Send: What data passes to sub-workflow
  • Wait for Completion: Wait for result or continue immediately

Use Cases

Example 1: Customer Validation Sub-Workflow

Create a reusable workflow that validates customer data:

  • Check email format
  • Verify phone number
  • Validate address
  • Return validation results

Call this from any workflow needing customer validation.

Webhook Node (Advanced)

While you've used webhooks as triggers, the Webhook node can also respond to requests mid-workflow.

Webhook Response Node

Send custom responses back to the webhook caller:

Response Configuration:
  • Response Code: 200 (success), 400 (error), etc.
  • Response Body: JSON, text, or custom data
  • Headers: Custom HTTP headers
  • Response Mode: When to send (immediately or after workflow)

Webhook Security

⚠️ Webhook Security Best Practices:
  • Use authentication headers
  • Validate incoming data
  • Implement rate limiting
  • Use HTTPS only
  • Verify webhook signatures

SSH Node

Execute commands on remote servers via SSH connections.

Common SSH Use Cases

  • Deploy code to servers
  • Run maintenance scripts
  • Backup databases
  • Monitor server health
  • Restart services
SSH Configuration:
  1. Create SSH credentials (host, port, username, password/key)
  2. Add SSH node to workflow
  3. Select credentials
  4. Enter command to execute
  5. Process command output

FTP/SFTP Nodes

Transfer files to and from FTP servers.

Operation Description
Download Get files from server
Upload Send files to server
List View directory contents
Delete Remove files
Rename Change file names

Compression Node

Compress or decompress files in various formats.

Supported Formats:
  • ZIP
  • GZIP
  • TAR
Use Cases:
  • Compress files before transfer
  • Archive multiple files
  • Extract received archives
  • Reduce storage space

Crypto Node

Generate hashes, encrypt/decrypt data, and create signatures.

Crypto Operations

Operation Purpose
Hash Create MD5, SHA256, etc.
Hmac Create message authentication codes
Sign Digital signatures
💡 Security Applications:
  • Verify webhook signatures
  • Create password hashes
  • Generate API tokens
  • Validate data integrity

Read/Write Binary Files

Work with binary data like images, PDFs, and other files.

Read Binary File Node

  • Read files from filesystem
  • Load files into workflow
  • Process file contents

Write Binary File Node

  • Save data to files
  • Create PDFs, images
  • Export reports

Aggregate Node

Combine multiple items into summary data.

Aggregate Operations:
  • Sum: Total numeric values
  • Average: Calculate mean
  • Count: Number of items
  • Min/Max: Find extremes
  • Group By: Organize by category

Use Case Example

Sales Report Aggregation:

From 100 individual sales records, create summary showing:

  • Total revenue
  • Average order value
  • Number of orders
  • Revenue by product category
  • Top selling items

HTML Extract Node

Parse HTML content and extract specific data.

Extraction Methods:
  • CSS Selector: Target specific elements
  • XPath: Navigate HTML structure
  • Regex: Pattern matching
Common Uses:
  • Web scraping
  • Email parsing
  • Data extraction from reports
  • Content monitoring

Advanced Node Configuration

Node Settings

Important Settings:
  • Always Output Data: Return data even on error
  • Continue On Fail: Don't stop workflow on error
  • Retry On Fail: Automatically retry failed operations
  • Timeout: Maximum execution time
  • Notes: Document node purpose

Node Color Coding

Organize workflows visually by assigning colors to nodes:

  • Blue: Data sources
  • Green: Successful operations
  • Orange: Logic/decision points
  • Red: Error handling

Practice Exercises

Exercise 1: Custom Data Processor

Build a Function node that:

  • Calculates shipping cost based on weight
  • Adds handling fee for fragile items
  • Applies regional pricing adjustments
  • Returns detailed cost breakdown
Exercise 2: Sub-Workflow System

Create modular workflows:

  1. Main workflow receives order
  2. Calls "Validate Order" sub-workflow
  3. Calls "Calculate Shipping" sub-workflow
  4. Calls "Update Inventory" sub-workflow
  5. Returns complete order summary

Key Takeaways

  • Function and Code nodes enable custom JavaScript logic
  • Execute Workflow promotes reusability and modularity
  • Webhook nodes provide advanced request/response handling
  • SSH and FTP nodes enable server and file operations
  • Specialized nodes handle compression, encryption, aggregation
  • Advanced configuration options improve reliability and debugging

Looking Forward

In Chapter 7, we'll explore database integrations. You'll learn to connect n8n to SQL and NoSQL databases, perform CRUD operations, and build data-driven workflows that interact with your business data stores.

📥 Download This Chapter

Your browser's print dialog will open - select "Save as PDF" as the destination

n8n Textbook | Chapter 6: Advanced Node Types and Configurations

© 2025 IOLEBA | Dr. Marcus Lee

Originally Published: November 2025