n8n-skills

repository·main·Indexed 18 days ago

https://github.com/haunchen/n8n-skills

An automation skill pack version 2.18.0 designed to provide AI assistants, specifically Claude, with deep knowledge of n8n workflows. It enables AI to understand 545+ nodes, 20+ templates, and community packages to assist in designing, querying, and validating automations. The project includes tools like DocsCollector for extracting node documentation and ApiCollector for gathering template statistics and usage data from the n8n.io API.

Tokens
34.9K
Snippets
99
Records
147
Agent score
63%

What's inside n8n-skills

  1. Implement static multilingual SEO generation

    main

    This plan outlines the transition from client-side i18n to build-time static HTML generation. The goal is to improve SEO by using hreflang, JSON-LD, and og:image tags, and to serve localized content via URL paths (e.g., / for English and /zh-TW/ for Traditional Chinese).

    Core Architecture:

    • Template: A website/template.html file uses {{key.path}} placeholders for all localized text and metadata.
    • Build Script: scripts/update-website.ts reads the template and locale JSONs to generate static index.html and zh-TW/index.html files.
    • Language Switching: website/i18n.js is refactored into a lightweight URL-based redirector that detects the current language from the path and provides the alternative language URL.
  2. Determine when to use the n8n-skills skill pack

    main

    The n8n-skills skill pack is designed for automation tasks within n8n. Use this skill when:

    • Building or designing n8n workflows.
    • Searching for nodes that match specific functionality.
    • Troubleshooting node configurations or connections.
    • Understanding node input/output compatibility.
    • Exploring community packages for extended functionality.

    Do NOT use this skill for:

    • Learning general automation concepts (refer to official n8n documentation instead).
    • Deploying or hosting n8n (infrastructure/DevOps questions).
    • Pricing or licensing questions (contact n8n directly).
  3. How the multilingual static generation mechanism works

    main

    The project uses a build-time static generation approach to solve SEO issues caused by client-side i18n. Instead of using data-i18n attributes to swap text in the browser, the build script reads a template.html and a locale JSON file (e.g., locales/en.json) to produce fully rendered, static HTML files for each language.

    The Generation Process:

    1. Read template.html.
    2. Read locales/{lang}.json.
    3. Calculate special variables (see Placeholder Variables).
    4. Recursively replace all {{key.path}} placeholders with values from the JSON structure.
    5. Inject community package cards and statistics.
    6. Write the final HTML to the target path (e.g., / for English, /zh-TW/ for Chinese).

    Key Rule: All data-i18n and data-i18n-aria attributes must be removed from the template. Text is hardcoded into the HTML during generation.

    <!-- Example of the template approach -->
    <h1>n8n Skills — {{hero.subtitle}}</h1>
    <link rel="stylesheet" href="{{__base_path__}}styles.css">
  4. Sanitize workflows to prevent sensitive data leakage

    main

    When generating documentation or exporting workflows, you must sanitize the data to ensure credentials and secrets are not exposed.

    Sanitization Requirements:

    • Remove Credentials: Explicitly strip the credentials field from the workflow object.
    • Keyword Filtering: Scan parameters for sensitive keys such as apiKey, password, token, or secret.
    • Marking: If sensitive information is detected, mark the node or provide a warning in the output.

    Recommended Output Pattern: To keep documentation files lightweight and secure, store the complete (but sanitized) JSON definition in a separate file and only embed a structured summary and Mermaid diagram in the main README.md.

    output/
    └── templates/
        └── [category]/
            ├── README.md (Summary + Visualization)
            └── workflows/
                └── [id].json (Complete sanitized definition)
  5. Compare n8n.io template search and workflow APIs

    main

    When building tools to interact with n8n templates, you should use a two-step approach combining the search API and the specific workflow API:

    1. Use /templates/search to browse and find templates. This API supports batch queries (up to 100 results), pagination (page, rows), and filtering (category, search). However, it only returns basic info and a simplified node list, lacking full configurations and connections.
    2. Use /workflows/templates/{id} to retrieve the actual executable workflow JSON for a specific template found in the search step.
    Feature/templates/search/workflows/templates/{id}
    Batch Query✅ (up to 100)❌ (single query)
    Basic Info
    Full Node Params
    Node Positions
    Connections
    Importable JSON
  6. Subscribe to security update notifications

    main

    To stay informed about security updates for this project, configure your GitHub notifications as follows:

    1. Go to the project repository on GitHub.
    2. Click the Watch button.
    3. Select Custom.
    4. Check the Security alerts box.
    5. Additionally, subscribe to Release notifications.
  7. Integrate Organizers for documentation generation

    main

    You can combine CategoryOrganizer and NodeGrouper to create a pipeline for generating structured documentation (e.g., Markdown files).

    Workflow Pattern:

    1. Categorize: Use CategoryOrganizer to define the high-level structure and identify the most important (top) nodes.
    2. Group: Pass the top nodes into NodeGrouper to apply functional and frequency-based logic.
    3. Extract: Use the grouper's methods to pull out ESSENTIAL nodes to ensure they appear prominently in your output.
    import { CategoryOrganizer } from './organizers/category-organizer';
    import { NodeGrouper, UsageFrequency } from './organizers/node-grouper';
    
    // 1. Organize by category to find top nodes
    const categoryOrganizer = new CategoryOrganizer('./config/categories.json');
    const categoryResult = categoryOrganizer.organize(allNodes, 50);
    
    // 2. Perform logical grouping on the top nodes
    const nodeGrouper = new NodeGrouper();
    const topNodesData = categoryResult.topNodes.map(node =>
      allNodes.find(n => n.nodeType === node.nodeType)
    );
    const groupingResult = nodeGrouper.group(topNodesData);
    
    // 3. Extract essential nodes for documentation
    const essentialNodes = nodeGrouper.getNodesByFrequency(
      groupingResult,
      UsageFrequency.ESSENTIAL
    );
    
    // Use essentialNodes and categoryResult.topNodes to generate documentation
    // generateSkillMd(essentialNodes, categoryResult.topNodes);
  8. Avoid common mistakes in n8n workflow development

    main

    When working with n8n nodes and workflows, avoid these common pitfalls:

    ErrorSolution
    Reading the entire merged file (thousands of lines)Use INDEX.md to find the specific line number, then use offset/limit to read precisely.
    Confusing Trigger and Action nodesRemember: Trigger nodes can only be placed at the start of a workflow; Action nodes can be placed anywhere.
    Ignoring node compatibilityAlways check compatibility-matrix.md to confirm if nodes can be connected.
    Using incorrect node naming formatsThe file format is nodes-base.{nodeType}.md, where nodeType is typically camelCase.
  9. Sanitize workflows to prevent sensitive data leaks

    main

    When generating documentation or exporting workflows, implement sanitization to protect credentials and secrets.

    Sanitization Rules:

    • Remove Credentials: Strip all credentials fields from the WorkflowDefinition.
    • Keyword Detection: Scan parameters for sensitive keys such as apiKey, password, token, or secret.
    • Marking: Flag nodes that contain sensitive information.

    Recommended Output Structure: To balance detail and file size, store full JSON definitions in a separate directory and only include summaries in the Markdown files:

    output/
    └── templates/
        ├── ai-chatbots/
        │   ├── README.md (contains visualization and summary)
        │   ├── 6270-build-your-first-ai-agent.md
        │   └── workflows/
        │       └── 6270.json (full workflow definition)
  10. Create template.html with i18n placeholders

    main

    To enable static generation, transform website/index.html into website/template.html. Replace all data-i18n attributes with {{key.path}} placeholders.

    Key Placeholder Patterns:

    • Meta Tags: Use {{meta.title}}, {{meta.description}}, {{meta.keywords}}, and {{__canonical__}}.
    • Hreflang: Hardcode the alternate links for en, zh-TW, and x-default pointing to the production domain.
    • Special Variables:
      • {{__lang__}}: The current language code.
      • {{__base_path__}}: The relative path for assets (e.g., ./ or ../).
      • {{__canonical__}}: The full canonical URL.
      • {{__og_locale__}}: The Open Graph locale (e.g., en_US or zh_TW).
      • {{__alt_lang_url__}}: The URL for the alternative language.
      • {{__alt_lang_label__}}: The label for the alternative language (e.g., 'English').

    Verification: Ensure no data-i18n attributes remain in the template:

    grep -c 'data-i18n' website/template.html
    # Expected: 0
    <!-- Example placeholder usage in template.html -->
    <html lang="{{__lang__}}">
    <title>{{meta.title}}</title>
    <button id="lang-toggle" onclick="window.location.href='{{__alt_lang_url__}}'">
        <span class="lang-text">{{__alt_lang_label__}}</span>
    </button>
  11. Run TypeScript API examples

    main

    To run the provided TypeScript examples, install the project dependencies and use ts-node to execute the scripts.

    # Install dependencies
    npm install
    
    # Run the basic API test script
    npx ts-node examples/api-test.ts
    
    # Run the full workflow API example (if implemented)
    npx ts-node examples/workflow-api-example.ts