N8n

From rawveg/skillsforge-marketplace · View interactive version

N8n is an AI agent skill from the GitHub repository rawveg/skillsforge-marketplace. N8N Documentation - Workflow automation platform with AI capabilities

How to use this skill

Skill file

N8N Skill

Comprehensive assistance with n8n development, generated from official documentation. n8n is a fair-code licensed workflow automation tool that combines AI capabilities with business process automation.

When to Use This Skill

This skill should be triggered when:

Key Concepts

Core Components

Data Structure

AI Capabilities

Quick Reference

Example 1: Basic Expression to Access Data

// Access data from the current item
{{ $json.name }}

// Access data from a specific node
{{ $node["HTTP Request"].json.response }}

// Access all items from a node
{{ $("HTTP Request").all() }}

Example 2: HTTP Request with Authentication

When working with the HTTP Request node, handle errors and rate limits:

// In HTTP Request node settings:
// - Enable "Retry on Fail"
// - Set Max Tries to 3
// - Set Wait Between Tries (ms) to 1000

// For rate limiting, use Batching:
// - Items per Batch: 10
// - Batch Interval (ms): 1000

Example 3: Code Node - Transform Data (JavaScript)

// Access input data
const items = $input.all();

// Transform each item
return items.map(item => {
  return {
    json: {
      fullName: `${item.json.firstName} ${item.json.lastName}`,
      email: item.json.email.toLowerCase(),
      timestamp: new Date().toISOString()
    }
  };
});

Example 4: Code Node - Filter Data (Python)

# Filter items based on a condition
output = []

for item in items:
    if item['json']['status'] == 'active':
        output.append({
            'json': {
                'id': item['json']['id'],
                'name': item['json']['name']
            }
        })

return output

Example 5: Expression - Date Handling with Luxon

// Current date
{{ $now }}

// Format date
{{ $now.toFormat('yyyy-MM-dd') }}

// Add 7 days
{{ $now.plus({ days: 7 }) }}

// Parse and format custom date
{{ DateTime.fromISO($json.dateString).toFormat('LLL dd, yyyy') }}

Example 6: JWT Authentication Credential

For APIs requiring JWT authentication:

// Use JWT credential with:
// - Key Type: Passphrase (for HMAC) or PEM Key (for RSA/ECDSA)
// - Secret: Your secret key
// - Algorithm: HS256, RS256, ES256, etc.

// The JWT credential automatically generates tokens
// Use it in HTTP Request node > Authentication > JWT

Example 7: Handle Errors in Workflow

// In Code node, use try-catch:
try {
  const result = $json.data.someField.toUpperCase();
  return [{ json: { result } }];
} catch (error) {
  // Return error information
  return [{
    json: {
      error: error.message,
      originalData: $json
    }
  }];
}

// Or set up Error Workflow in Workflow Settings
// to catch all failures and send notifications

Example 8: Pagination in HTTP Request

// Use pagination to fetch all pages
// In HTTP Request node > Pagination:

// Type: Generic Pagination
// Request URL: {{ $url }}&page={{ $pageNumber }}
// Complete When: {{ $response.body.hasMore === false }}
// Next Page URL: Automatic

Example 9: AI Agent with Tools

// In AI Agent node:
// 1. Connect a Chat Model (OpenAI, etc.)
// 2. Add tools (Calculator, HTTP Request, etc.)
// 3. Configure memory if needed

// The agent can:
// - Analyze user input
// - Decide which tools to use
// - Execute tools and process results
// - Return final answer

Example 10: Environment Variables and Static Data

// Access environment variables
{{ $env.MY_API_KEY }}

// Store workflow static data (persists across executions)
const staticData = getWorkflowStaticData('global');
staticData.lastRun = new Date().toISOString();
staticData.counter = (staticData.counter || 0) + 1;

// Retrieve static data
{{ $workflow.staticData.counter }}

Reference Files

This skill includes comprehensive documentation in references/:

Use view to read specific reference files when detailed information is needed.

Working with This Skill

For Beginners

  1. Start with basic workflow creation:
  1. Understand data structure:
  1. Common patterns:

For Intermediate Users

  1. Master the Code node:
  1. Work with expressions:
  1. Error handling:
  1. Data operations:

For Advanced Users

  1. AI and LangChain:
  1. Scaling and performance:
  1. Custom development:
  1. Advanced patterns:

Common Issues and Solutions

HTTP Request Errors

Expression Errors

Data Type Issues

Migration to v1.0

Environment Configuration

Docker Setup

# Basic n8n with Docker
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

# With environment variables
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -e N8N_BASIC_AUTH_ACTIVE=true \
  -e N8N_BASIC_AUTH_USER=admin \
  -e N8N_BASIC_AUTH_PASSWORD=password \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

Key Environment Variables

Resources

Official Resources

Learning Paths

API and Development

Notes

Updating

To refresh this skill with updated documentation:

  1. Re-run the scraper with the same configuration
  2. The skill will be rebuilt with the latest information
  3. Review Quick Reference section for new examples
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.