### Install development dependencies Source: https://github.com/mikasa1013/n8n-skills/blob/main/README.md Command to install project dependencies. ```bash npm install ``` -------------------------------- ### Node Configuration Output Example Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Example output format for detailed node configuration, including version, position, and parameters. ```markdown ## Node Configuration ### Example Chat (chatTrigger) - Version: 1.1 - Position: (-176, -64) - Parameters: public chat interface ### AI Agent (agent) - Version: 2.2 - Position: (192, -64) - Parameters: system message, tools ``` -------------------------------- ### Connection Relationships Output Example Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Example output format for describing connection relationships between workflow nodes. ```markdown ## Connection Relationships Example Chat → AI Agent (main) Get Weather → AI Agent (ai_tool) Get News → AI Agent (ai_tool) ``` -------------------------------- ### Initialize Development Environment Source: https://github.com/mikasa1013/n8n-skills/blob/main/CONTRIBUTING.en.md Commands to clone the repository, install dependencies, and perform an initial build and test run. ```bash # Clone your fork git clone https://github.com/YOUR_USERNAME/n8n-skill.git cd n8n-skill # Install dependencies npm install # Build project npm run build # Run tests npm test ``` -------------------------------- ### Example Workflow JSON Data Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md An example of the JSON response for a complete workflow definition, illustrating node configurations, positions, and connections for the 'Build Your First AI Agent' template. ```json { "id": 6270, "name": "Build Your First AI Agent", "workflow": { "meta": { "instanceId": "e409ea34548a2afe2dffba31130cd1cf2e98ebe2afaeed2a63caf2a0582d1da0", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "95421925-c5ad-48bd-9638-c84ff5b5e3c6", "name": "Example Chat", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [-176, -64], "parameters": { "public": true, "options": { "title": "Your first AI Agent 🚀", "subtitle": "This is for demo purposes. Try me out !" } }, "typeVersion": 1.1 }, { "id": "332af12a-45ab-4e5d-8dab-da21ba2111f9", "name": "Your First AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [192, -64], "parameters": { "options": { "systemMessage": "You are an AI assistant..." } }, "typeVersion": 2.2 } ], "connections": { "Example Chat": { "main": [ [ { "node": "Your First AI Agent", "type": "main", "index": 0 } ] ] }, "Get Weather": { "ai_tool": [ [ { "node": "Your First AI Agent", "type": "ai_tool", "index": 0 } ] ] } } } } ``` -------------------------------- ### Query n8n-skills for workflow patterns Source: https://github.com/mikasa1013/n8n-skills/blob/main/README.md Example queries for exploring common workflow design patterns. ```text "How to create a scheduled workflow?" "What are the common node combinations for data transformation?" "How to handle API errors and retries?" ``` -------------------------------- ### Mermaid Flowchart Example Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Example of a Mermaid flowchart generated from workflow connections, showing node names and connection types. ```mermaid graph LR N0[Example Chat] --> N1[AI Agent] N2[Get Weather] -->|ai_tool| N1 N3[Get News] -->|ai_tool| N1 ``` -------------------------------- ### n8n Workflow JSON Structure Example Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md Example of the JSON response from the /workflows/templates/{id} endpoint, showing nodes, connections, and parameters. ```json { "id": 6270, "name": "Build Your First AI Agent", "workflow": { "meta": { "instanceId": "...", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "uuid", "name": "Example Chat", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [-176, -64], "parameters": { "public": true, "options": { ... } }, "typeVersion": 1.1 } ], "connections": { "Example Chat": { "main": [[ { "node": "AI Agent", "type": "main", "index": 0 } ]] } }, "pinData": {} } } ``` -------------------------------- ### External Workflow Link Example Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md Markdown snippet demonstrating how to provide external links to n8n workflow definitions, useful for a hybrid implementation approach. ```markdown ## Workflow Definition Complete workflow definition available from: - [View on n8n.io](https://n8n.io/workflows/6270) - [Download JSON](https://api.n8n.io/api/workflows/templates/6270) ``` -------------------------------- ### Query n8n-skills for node functionality Source: https://github.com/mikasa1013/n8n-skills/blob/main/README.md Example queries for searching available nodes based on specific requirements. ```text "Which nodes can connect to Google Sheets?" "What AI-related nodes are available?" "What trigger nodes are available?" ``` -------------------------------- ### Test n8n Workflow API Endpoint with curl and jq Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md Examples demonstrating how to use curl to fetch workflow data and jq to parse specific fields like the workflow name, node count, and connection keys. ```bash # Test 1: Get workflow name $ curl -s "https://api.n8n.io/api/workflows/templates/6270" | jq '.name' "Build Your First AI Agent" ``` ```bash # Test 2: Count nodes $ curl -s "https://api.n8n.io/api/workflows/templates/6270" | jq '.workflow.nodes | length' 13 ``` ```bash # Test 3: View connection relationships $ curl -s "https://api.n8n.io/api/workflows/templates/6270" | jq '.workflow.connections | keys' [ "Connect Gemini", "Conversation Memory", "Example Chat", "Get News", "Get Weather" ] ``` -------------------------------- ### Query n8n-skills for node information Source: https://github.com/mikasa1013/n8n-skills/blob/main/README.md Example queries for retrieving specific node details from the AI assistant. ```text "What are the main features of the HTTP Request node?" "How to send email using the Gmail node?" "What programming languages does the Code node support?" ``` -------------------------------- ### Generate Node Configuration Details Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md Generates markdown detailing each node's configuration, including its type, version, position, notes, and parameters. This is useful for understanding individual node setups within a workflow. ```typescript /** * Generate node detail information */ private generateNodeDetails(workflow: WorkflowDefinition): string { const lines: string[] = []; workflow.workflow.nodes.forEach((node) => { lines.push(`### ${node.name}`); lines.push(''); lines.push(`- Type: lexible${node.type} lexible`); lines.push(`- Version: ${node.typeVersion}`); lines.push(`- Position: (${node.position[0]}, ${node.position[1]})`); if (node.notes) { lines.push(`- Notes: ${node.notes}`); } if (Object.keys(node.parameters).length > 0) { lines.push('- Parameter Configuration:'); lines.push('```json'); lines.push(JSON.stringify(node.parameters, null, 2)); lines.push('```'); } lines.push(''); }); return lines.join('\n'); } ``` -------------------------------- ### Create n8n Skills Directory for Claude Code Source: https://github.com/mikasa1013/n8n-skills/blob/main/README.md This command creates the necessary directory structure for installing n8n Skills locally with Claude Code CLI. Ensure you are in your project's root directory before execution. ```bash mkdir -p .claude/skills/n8n-skills ``` -------------------------------- ### GET /api/templates/search Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md Searches for n8n templates to retrieve basic information such as IDs, names, and descriptions. ```APIDOC ## GET /api/templates/search ### Description Searches for available n8n templates. Returns basic template information including ID, name, description, and a simplified list of nodes used. ### Method GET ### Endpoint https://api.n8n.io/api/templates/search ### Parameters #### Query Parameters - **page** (integer) - Optional - Page number - **rows** (integer) - Optional - Items per page (max 100) - **category** (string) - Optional - Category filter - **search** (string) - Optional - Keywords for searching templates ### Response #### Success Response (200) - **id** (integer) - Template ID - **name** (string) - Template name - **description** (string) - Template description - **views** (integer) - Number of views ``` -------------------------------- ### Generate Main SKILL.md File with SkillGenerator Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Use SkillGenerator to create the primary SKILL.md file, including skill metadata, overview, workflow patterns, and table of contents. It also generates guide files for resources. ```typescript import { SkillGenerator, generateSkillMarkdown, generateSkillFile } from 'n8n-skills'; // Create generator with configuration const generator = new SkillGenerator({ name: 'n8n-skills', version: '2.0.0', description: 'n8n workflow automation knowledge base', author: 'Frank Chen', license: 'MIT', maxLines: 5000, // Limit output size topNodesCount: 50 // Number of top nodes to highlight }); // Prepare input data const input = { nodes: enrichedNodes, // EnrichedNodeInfo[] nodeUsageStats: usageStats, // NodeUsageStats resourceFiles: resourceFiles, // ResourceFile[] config: skillConfig, // SkillConfig templateCount: 20 // Number of templates }; // Generate SKILL.md content const skillContent = generator.generate(input); // Generate guide files (for resources/guides/ directory) const howToFindContent = generator.generateHowToFindNodesFile( enrichedNodes, usageStats ); const usageGuideContent = generator.generateUsageGuideFile(resourceFiles); // Write files await fs.writeFile('output/SKILL.md', skillContent); await fs.writeFile('output/resources/guides/how-to-find-nodes.md', howToFindContent); await fs.writeFile('output/resources/guides/usage-guide.md', usageGuideContent); // Convenience functions const markdown = generateSkillMarkdown(input); await generateSkillFile(input, 'output/SKILL.md'); ``` -------------------------------- ### GET /api/workflows/templates/{id} Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md Retrieves the complete workflow definition for a specific template, including nodes, parameters, and connection data. ```APIDOC ## GET /api/workflows/templates/{id} ### Description Fetches the full workflow definition for a given template ID. This includes the complete node array, node parameters, node positions, and connection relationships, making it directly importable into n8n. ### Method GET ### Endpoint https://api.n8n.io/api/workflows/templates/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the template ### Response #### Success Response (200) - **id** (integer) - Template ID - **name** (string) - Template name - **workflow** (object) - Complete workflow definition containing nodes, connections, and metadata #### Response Example { "id": 6270, "name": "Build Your First AI Agent", "workflow": { "nodes": [...], "connections": {...} } } ``` -------------------------------- ### Get Complete Workflow Template API Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md This endpoint retrieves the complete workflow definition for a specific template ID, including all node details, parameters, and connection relationships. ```APIDOC ## GET /api/workflows/templates/{id} ### Description Retrieves the full JSON definition of a specific workflow template, including detailed node configurations, connection relationships, and parameter settings. ### Method GET ### Endpoint https://api.n8n.io/api/workflows/templates/{id} ### Path Parameters - **id** (integer) - Required - The unique identifier of the workflow template. ### Request Example ```bash curl https://api.n8n.io/api/workflows/templates/6270 ``` ### Response #### Success Response (200) - **id** (number) - The template ID. - **name** (string) - The template name. - **workflow** (object) - Contains the complete workflow definition. - **meta** (object) - Metadata about the workflow instance. - **instanceId** (string) - The instance ID of the workflow. - **templateCredsSetupCompleted** (boolean) - Indicates if template credential setup is completed. - **nodes** (array) - An array of complete node definitions. - **id** (string) - The unique UUID of the node. - **name** (string) - The name of the node. - **type** (string) - The type of the node (e.g., "n8n-nodes-base.httpRequest"). - **position** (array) - The position of the node on the canvas [x, y]. - **parameters** (object) - The parameter configuration for the node. - **typeVersion** (number) - The version of the node type. - **credentials** (object) - Optional - Credentials configuration for the node. - **notes** (string) - Optional - Notes associated with the node. - **cid** (string) - Optional - Creator ID. - **creator** (string) - Optional - Creator name. - **connections** (object) - Defines the connection relationships between nodes. - **[sourceNodeName]** (object) - An object where keys are source node names. - **[outputType]** (array) - An array of connection arrays. - **node** (string) - The target node name. - **type** (string) - The type of connection. - **index** (number) - The output index. - **pinData** (object) - Pinned data for the workflow. #### Response Example { "id": 6270, "name": "Build Your First AI Agent", "workflow": { "meta": { "instanceId": "e409ea34548a2afe2dffba31130cd1cf2e98ebe2afaeed2a63caf2a0582d1da0", "templateCredsSetupCompleted": true }, "nodes": [ { "id": "95421925-c5ad-48bd-9638-c84ff5b5e3c6", "name": "Example Chat", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "position": [-176, -64], "parameters": { "public": true, "options": { "title": "Your first AI Agent 🚀", "subtitle": "This is for demo purposes. Try me out !" } }, "typeVersion": 1.1 }, { "id": "332af12a-45ab-4e5d-8dab-da21ba2111f9", "name": "Your First AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [192, -64], "parameters": { "options": { "systemMessage": "You are an AI assistant..." } }, "typeVersion": 2.2 } ], "connections": { "Example Chat": { "main": [ [ { "node": "Your First AI Agent", "type": "main", "index": 0 } ] ] }, "Get Weather": { "ai_tool": [ [ { "node": "Your First AI Agent", "type": "ai_tool", "index": 0 } ] ] } } } } ``` -------------------------------- ### Run development commands Source: https://github.com/mikasa1013/n8n-skills/blob/main/README.md Commands for building, developing, and testing the project. ```bash # Build project npm run build # Development mode npm run dev # Run tests npm test ``` -------------------------------- ### Development Workflow Commands Source: https://github.com/mikasa1013/n8n-skills/blob/main/CONTRIBUTING.en.md Standard commands for development, linting, building, and validation. ```bash # Development mode (watch mode) npm run dev # Type checking npm run typecheck # Lint checking npm run lint # Run full build npm run build:full # Validate output npm run validate ``` -------------------------------- ### Build System Commands Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Execute various build, update, validation, and cleanup tasks using npm scripts. Use 'build:full' for a complete process or 'clean'/'rebuild' for managing output directories. ```bash # Build commands npm run build # Compile TypeScript to dist/ npm run build:full # Full build: collect, parse, organize, generate npm start # Alias for build:full # Update commands npm run update # Update n8n node data npm run update:check # Dry-run update check npm run update:community # Update community packages npm run update:community:check # Dry-run community check npm run update:website # Update website statistics # Validation npm run validate # Validate output files npm test # Run Jest tests npm run lint # ESLint check npm run typecheck # TypeScript type check # Cleanup npm run clean # Remove dist/, output/, cache (preserves community cache) npm run rebuild # Clean and rebuild ``` -------------------------------- ### View Complete API Response Structure Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md This command fetches the full JSON response for a workflow template and displays the first 100 lines, useful for understanding the complete data structure. ```bash curl -s "https://api.n8n.io/api/workflows/templates/6270" | jq '.' | head -100 ``` -------------------------------- ### Define Output Directory Structure Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Recommended file system structure for organizing template markdown files and their corresponding JSON workflow definitions. ```text output/ └── templates/ ├── ai-chatbots/ │ ├── README.md │ ├── 6270-build-your-first-ai-agent.md (includes visualization and summary) │ └── workflows/ │ └── 6270.json (complete workflow definition) └── ... ``` -------------------------------- ### Test Workflow API with cURL Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-summary.en.md Commands to fetch and inspect workflow data using cURL and jq. ```bash # Test fetching workflow definition curl https://api.n8n.io/api/workflows/templates/6270 | jq '.' # Check node count curl -s https://api.n8n.io/api/workflows/templates/6270 | jq '.workflow.nodes | length' # View connection relationships curl -s https://api.n8n.io/api/workflows/templates/6270 | jq '.workflow.connections' ``` -------------------------------- ### Project Directory Structure Source: https://github.com/mikasa1013/n8n-skills/blob/main/CONTRIBUTING.en.md Overview of the source code organization. ```text src/ ├── collectors/ # Data collectors ├── parsers/ # Data parsers ├── organizers/ # Data organizers ├── generators/ # File generators ├── validators/ # Validators └── utils/ # Utility functions ``` -------------------------------- ### Programmatic Build Process Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Initiate the complete skill pack generation process programmatically using the SkillBuilder class. This orchestrates multiple build steps and caches intermediate data. ```typescript // Programmatic build using the SkillBuilder class import { SkillBuilder } from './scripts/build'; const builder = new SkillBuilder('config/skill-config.json'); await builder.build(); // Build steps executed: // 1. Collect nodes from NPM packages // 2. Collect detailed node properties // 3. Collect usage statistics from n8n.io API // 4. Organize and rank nodes by priority // 5. Build node compatibility matrix // 6. Generate resource files (tiered merge strategy) // 7. Generate compatibility matrix document // 8. Generate workflow templates // 9. Generate community node documentation // 10. Generate main SKILL.md and guide files // Cache files stored in data/cache/: // - nodes.json # Node information // - properties.json # Node properties // - usage-stats.json # Usage statistics // - templates.json # Template metadata // - node-io-config.json # I/O configurations // - compatibility-matrix.json # Compatibility data // - community-nodes.json # Community node details (preserved on clean) ``` -------------------------------- ### Implement Workflow Definition Fetching Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Placeholder function for fetching and caching workflow definitions during the build process. ```typescript // Step 3.5: Fetch workflow definitions async function fetchWorkflowDefinitions( templates: Template[] ): Promise> { // 1. Select top 50 most popular templates // 2. Check cache // 3. Batch fetch uncached ones // 4. Save cache // 5. Return results } ``` -------------------------------- ### Generate Community Package Documentation Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Use CommunityGenerator to create documentation for community packages. Specify output, config, and cache paths. The generateCommunityDocs function offers a convenient alternative. ```typescript import { CommunityGenerator, generateCommunityDocs } from 'n8n-skills'; // Create generator const generator = new CommunityGenerator({ outputDir: './output/resources/community', configPath: './config/community-packages.json', // Package list cachePath: './data/cache/community-nodes.json' // Detailed node info }); // Generate all community documentation await generator.generate(); // Output structure: // community/ // ↗️ README.md # Main index with all packages // ↗️ ai-tools.md # Category summary // ↗️ communication.md // ↗️ n8n-nodes-evolution-api.md # Individual package docs // ↗️ n8n-nodes-elevenlabs.md // Convenience function await generateCommunityDocs({ outputDir: './output/resources/community', configPath: './config/community-packages.json', cachePath: './data/cache/community-nodes.json' }); ``` -------------------------------- ### Generate Node Documentation Files with ResourceGenerator Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Utilize ResourceGenerator to create detailed markdown documentation for each node. It employs a tiered strategy, generating individual files for high-priority nodes and merging lower-priority nodes into category files. ```typescript import { ResourceGenerator, createResourceGenerator } from 'n8n-skills'; // Create generator with output configuration const generator = new ResourceGenerator({ outputDir: './output/resources', overwrite: true }); // Generate using tiered merge strategy const resourceFiles = await generator.generateTiered( highPriorityNodes, // EnrichedNodeInfo[] - get individual files lowPriorityNodes, // EnrichedNodeInfo[] - get merged into category files compatibilityMatrix, // Optional: for connection guides nodeConnectionInfoList // Optional: for connection guides ); // Returns ResourceFile[]: // [ // { name: "Gmail", path: "resources/output/nodes-base.gmail.md", // description: "Send emails", category: "output" }, // { name: "transform - Node Collection", path: "resources/transform/transform-merged-1.md", // description: "Contains 100 nodes", category: "transform" } // ] console.log(`Generated ${resourceFiles.length} resource files`); console.log(`Processed ${generator.getProcessedCount()} nodes`); console.log(`Output directory: ${generator.getOutputDir()}`); // Alternative: Generate all nodes as individual files (no merging) const allFiles = await generator.generateAll(allNodes, compatibilityMatrix, nodeConnectionInfoList); // Clean generated files await generator.cleanAll(); // Convenience function const gen = createResourceGenerator({ outputDir: './output/resources' }); ``` -------------------------------- ### Download Complete Workflow JSON Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md This command downloads the entire JSON definition of a workflow template and saves it to a local file named 'workflow-6270.json'. ```bash curl -s "https://api.n8n.io/api/workflows/templates/6270" > workflow-6270.json ``` -------------------------------- ### Acknowledge n8n-mcp usage Source: https://github.com/mikasa1013/n8n-skills/blob/main/ATTRIBUTIONS.en.md Recommended text to include in projects that utilize the n8n-mcp integration. ```text Built with n8n-mcp (https://github.com/czlonkowski/n8n-mcp) Created by Romuald Czlonkowski @ www.aiadvisors.pl/en ``` -------------------------------- ### Parse Node I/O Configuration Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Parses node input and output configurations to determine connection types and compatibility. ```typescript import { InputOutputParser } from 'n8n-skills'; const parser = new InputOutputParser(); // Parse I/O configuration from a node class const ioInfo = parser.parseNodeInputOutput(loadedNode.NodeClass); // Returns NodeInputOutputInfo: // { // nodeType: "nodes-base.aiAgent", // version: "1", // inputs: ["main", "ai_languageModel", "ai_tool"], // outputs: ["main"], // inputTypes: ["main", "ai_languageModel", "ai_tool"], // outputTypes: ["main"], // isMultiInput: true, // isMultiOutput: false, // requiresSpecialInputs: true, // Requires AI inputs // hasErrorOutput: false, // outputCount: 1, // outputNames: ["Output"], // isDynamicOutput: false // } console.log(`Node: ${ioInfo.nodeType}`); console.log(`Input types: ${ioInfo.inputTypes.join(', ')}`); console.log(`Output types: ${ioInfo.outputTypes.join(', ')}`); console.log(`Multi-input: ${ioInfo.isMultiInput}`); console.log(`Requires AI inputs: ${ioInfo.requiresSpecialInputs}`); ``` -------------------------------- ### Test API Availability with cURL Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md Use this command to quickly check if the n8n API is accessible and retrieve the name of a specific workflow template. ```bash curl -s "https://api.n8n.io/api/workflows/templates/6270" | jq '.name' ``` -------------------------------- ### View Workflow Connection Relationships Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md This command retrieves and displays the connection details between nodes in an n8n workflow template. ```bash curl -s "https://api.n8n.io/api/workflows/templates/6270" | jq '.workflow.connections' ``` -------------------------------- ### Commit Message Format Source: https://github.com/mikasa1013/n8n-skills/blob/main/CONTRIBUTING.en.md Recommended structure for commit messages to ensure clarity and traceability. ```text type: Brief description (under 50 characters) More detailed explanation (if needed) - Explain the reason for changes - Explain the impact scope - Related Issue numbers Closes #123 ``` -------------------------------- ### List Unique Node Types in a Workflow Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md This command fetches all node types present in a workflow template and lists the unique types, sorted alphabetically. ```bash curl -s "https://api.n8n.io/api/workflows/templates/6270" | jq '.workflow.nodes[].type' | sort -u ``` -------------------------------- ### Simplified API for Node Collection and Generation Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Utilize high-level functions like collectAllNodes, collectNodeUsage, and generateSkill for common operations. These functions simplify data collection and markdown generation without requiring class instantiation. ```typescript import { collectAllNodes, collectNodeUsage, generateSkill, VERSION, NAME } from 'n8n-skills'; // Collect all nodes in one call const nodes = await collectAllNodes(); console.log(`Collected ${nodes.length} nodes`); // Collect usage statistics const stats = await collectNodeUsage(100); console.log(`HTTP Request usage: ${stats['nodes-base.httpRequest']?.count}`); // Generate skill markdown content const enrichedNodes = nodes.map(node => ({ ...node, usageCount: stats[node.nodeType]?.count || 0, usagePercentage: stats[node.nodeType]?.percentage || 0 })); const skillContent = await generateSkill(enrichedNodes, { name: 'My n8n Skill', version: '1.0.0', description: 'Custom n8n knowledge base', topNodesCount: 50 }); // Package information console.log(`Package: ${NAME} v${VERSION}`); ``` -------------------------------- ### Organize Nodes by Category Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Categorizes nodes into functional groups based on configuration definitions. ```typescript import { CategoryOrganizer } from 'n8n-skills'; // Create organizer with category configuration const organizer = new CategoryOrganizer('./config/categories.json'); // Prepare node info const nodeInfoList = nodes.map(node => ({ nodeType: node.nodeType, displayName: node.displayName, description: node.description, category: node.category, isTrigger: node.isTrigger, isWebhook: node.isWebhook, isAITool: node.isAITool })); // Organize nodes (select top 50 for main skill file) const result = organizer.organize(nodeInfoList, 50); console.log(`Top nodes: ${result.topNodes.length}`); console.log(`Remaining: ${result.remainingNodes.length}`); console.log(`Uncategorized: ${result.uncategorizedNodes.length}`); // Group by category const grouped = organizer.groupByCategory([...result.topNodes, ...result.remainingNodes]); grouped.forEach((nodes, category) => { console.log(`${category}: ${nodes.length} nodes`); }); // Get category information const transformInfo = organizer.getCategoryInfo('transform'); console.log(`Transform: ${transformInfo.description}`); // Get categories sorted by priority const categories = organizer.getCategoriesByPriority(); categories.forEach(({ key, definition }) => { console.log(`${key} (priority ${definition.priority}): ${definition.description}`); }); // Generate statistics const stats = organizer.generateStatistics(result); console.log(stats); ``` -------------------------------- ### List and Search Templates API Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md This endpoint allows for searching and listing available workflow templates with basic information. It has limitations regarding detailed node configurations and connections. ```APIDOC ## GET /api/templates/search ### Description Retrieves a list of workflow templates with basic information. Supports pagination and filtering by category or search keywords. ### Method GET ### Endpoint https://api.n8n.io/api/templates/search ### Query Parameters - **page** (integer) - Required - The page number for pagination. - **rows** (integer) - Required - The number of items per page. - **category** (string) - Optional - Filters templates by a specific category. - **search** (string) - Optional - Keywords to search within template names and descriptions. ### Response #### Success Response (200) - **totalWorkflows** (number) - The total number of workflows found. - **workflows** (array) - An array of workflow template objects. - **id** (number) - The unique identifier of the template. - **name** (string) - The name of the template. - **description** (string) - A brief description of the template. - **totalViews** (number) - The total number of views for the template. - **createdAt** (string) - The date and time the template was created. - **user** (object) - Information about the user who created the template. - **nodes** (array) - A simplified list of nodes in the workflow (contains basic info like id, name, displayName, icon). #### Response Example { "totalWorkflows": 10, "workflows": [ { "id": 1, "name": "Example Workflow", "description": "A sample workflow.", "totalViews": 100, "createdAt": "2023-01-01T10:00:00Z", "user": { "id": 1, "name": "John Doe" }, "nodes": [ { "id": "node-1", "name": "Start", "displayName": "Start Node", "icon": "icon-url" } ] } ] } ``` -------------------------------- ### Fetch Workflow Definitions for Templates Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md Fetches workflow definitions for a given list of templates, prioritizing the most popular ones. It limits the number of requests to avoid excessive API calls and returns a map of template IDs to their workflow definitions. ```typescript // Step 3.5: Fetch complete workflow definitions async function fetchWorkflowDefinitions( templates: Template[] ): Promise> { const collector = new ApiCollector(); const definitions = new Map(); // Select top N most popular templates const topTemplates = templates .sort((a, b) => b.totalViews - a.totalViews) .slice(0, 50); // Limit quantity to avoid excessive API requests const templateIds = topTemplates.map(t => t.id); const workflows = await collector.fetchMultipleWorkflows(templateIds); workflows.forEach(workflow => { definitions.set(workflow.id, workflow); }); return definitions; } ``` -------------------------------- ### Copy n8n Skills to Local Directory Source: https://github.com/mikasa1013/n8n-skills/blob/main/README.md Copies the extracted n8n Skills files (SKILL.md and resources directory) into the designated local directory for Claude Code. This step is crucial for the CLI tool to access the skill pack. ```bash cp -r n8n-skills/* .claude/skills/n8n-skills/ ``` -------------------------------- ### Fetch Complete Workflow Definition from n8n API Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md This endpoint retrieves the full workflow JSON, including node configurations, connections, and parameters. It requires a specific template ID for each request. ```bash GET https://api.n8n.io/api/workflows/templates/{id} # Example curl https://api.n8n.io/api/workflows/templates/6270 ``` -------------------------------- ### Generate Workflow Template Documentation with TemplateGenerator Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Employ TemplateGenerator to document workflow templates from n8n.io, organizing them by category. This generator enhances templates with workflow definitions and generates a structured output directory. ```typescript import { TemplateGenerator, generateTemplates, TemplateCategory, CATEGORY_INFO } from 'n8n-skills'; // Create generator const generator = new TemplateGenerator({ outputDir: './output/resources/templates', maxTemplatesPerCategory: 20 }); // Enhance templates with workflow definitions const enhancedTemplates = templates.map(template => { const workflow = workflows.find(w => w.id === template.id); return workflow ? generator.enhanceTemplate(template, workflow) : template; }); // Generate all template documentation await generator.generate(enhancedTemplates); // Output structure: // templates/ // ├── README.md # Main index // ├── ai-chatbots/ // │ ├── README.md // │ └── template-1234.md // ├── social-media/ // │ └── ... // ├── data-processing/ // │ └── ... // └── communication/ // └── ... // Available categories Object.values(TemplateCategory).forEach(cat => { const info = CATEGORY_INFO[cat]; console.log(`${cat}: ${info.name} - ${info.description}`); }); // Convenience function await generateTemplates(enhancedTemplates, { outputDir: './output/templates' }); ``` -------------------------------- ### Generate Connection Relationship Details Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md Generates a markdown list detailing the connections between nodes in a workflow. It specifies the source node, the output type, and the target node with its index. ```typescript /** * Generate connection relationship details */ private generateConnectionDetails(workflow: WorkflowDefinition): string { const lines: string[] = []; Object.entries(workflow.workflow.connections).forEach(([source, outputs]) => { lines.push(`**${source}**`); Object.entries(outputs).forEach(([outputType, targets]) => { targets.flat().forEach(target => { lines.push(` - ${outputType} → ${target.node} (index: ${target.index})`); }); }); lines.push(''); }); return lines.join('\n'); } ``` -------------------------------- ### Batch Fetch Workflow Definitions Method Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Extend ApiCollector with this method for batch fetching multiple workflow definitions. Implement concurrency control (recommended 5 per batch) and retry mechanisms. ```typescript public async fetchMultipleWorkflows( templateIds: number[], concurrency?: number ): Promise ``` -------------------------------- ### Generate Workflow Diagram (Mermaid) Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md Generates a Mermaid graph definition for visualizing the workflow architecture. It creates nodes for each workflow step and edges representing connections between them. ```typescript /** * Generate workflow diagram */ private generateWorkflowDiagram(workflow: WorkflowDefinition): string { const lines = ['```mermaid', 'graph LR']; // Generate nodes workflow.workflow.nodes.forEach((node, index) => { const nodeId = `N${index}`; const label = node.name.replace(/"/g, '\\"'); lines.push(` ${nodeId}["${label}
${node.type}"]`); }); // Generate connections const nodeNameToId = new Map(); workflow.workflow.nodes.forEach((node, index) => { nodeNameToId.set(node.name, `N${index}`); }); Object.entries(workflow.workflow.connections).forEach(([source, outputs]) => { const sourceId = nodeNameToId.get(source); Object.entries(outputs).forEach(([outputType, targets]) => { targets.flat().forEach(target => { const targetId = nodeNameToId.get(target.node); if (sourceId && targetId) { lines.push(` ${sourceId} -->|${outputType}| ${targetId}`); } }); }); }); lines.push('```'); return lines.join('\n'); } ``` -------------------------------- ### Collect Community Packages with CommunityCollector Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Configures and uses the CommunityCollector to fetch, classify, and process n8n packages from npm. Includes methods for saving configurations and performing detailed node parsing. ```typescript import { CommunityCollector, fetchCommunityPackages } from 'n8n-skills'; // Create collector with configuration const collector = new CommunityCollector({ limit: 30, // Max packages to fetch maxRetries: 3, retryDelay: 1000, timeout: 30000 }); // Fetch popular community packages (sorted by npm popularity) const result = await collector.fetchPopularPackages(); console.log(`Found ${result.packages.length} packages`); // Each package contains: // { // name: "n8n-nodes-evolution-api", // description: "WhatsApp automation nodes", // category: "communication", // npmUrl: "https://www.npmjs.com/package/n8n-nodes-evolution-api", // version: "1.2.3", // maintainer: "username", // repository: "https://github.com/..." // } // Auto-classified categories: communication, ai-tools, web-scraping, // document, data-processing, utilities // Print statistics by category collector.printStats(result); // Save to config file for build process await collector.saveToConfig(result, './config/community-packages.json'); // Load existing config const existingConfig = await collector.loadFromConfig(); // Check for changes if (collector.hasChanges(existingConfig, result)) { console.log('Community packages have changed!'); } // For detailed node parsing: install → parse → uninstall workflow const details = await collector.processPackageForDetails(result.packages[0]); console.log(`Package ${details.packageName} has ${details.nodes.length} nodes`); // Convenience function const packages = await fetchCommunityPackages(30); ``` -------------------------------- ### Generate Node Detailed Configuration Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Add this method to TemplateGenerator to output detailed configuration information for each node in the workflow. ```typescript private generateNodeDetails(workflow: WorkflowDefinition): string ``` -------------------------------- ### Fetch Workflow Definition Endpoint Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-summary.en.md The primary endpoint for retrieving complete workflow definitions by template ID. ```text GET https://api.n8n.io/api/workflows/templates/{id} ``` -------------------------------- ### Parse Node Properties with PropertyParser Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Extracts configuration properties, operations, and resource definitions from n8n node classes. ```typescript import { PropertyParser } from 'n8n-skills'; const parser = new PropertyParser(); // Parse node properties from a node class const properties = parser.parse(loadedNode.NodeClass); // Returns ParsedProperties: // { // coreProperties: [ // { name: "url", displayName: "URL", type: "string", required: true, // description: "The URL to make the request to", default: "" }, // { name: "method", displayName: "Method", type: "options", // options: [{name: "GET", value: "GET"}, {name: "POST", value: "POST"}] } // ], // operations: [ // { name: "Send Message", value: "send", description: "Send a message", // resource: "message" } // ], // hasCredentials: true, // totalPropertyCount: 25 // } console.log(`Total properties: ${properties.totalPropertyCount}`); console.log(`Requires credentials: ${properties.hasCredentials}`); // List available operations properties.operations.forEach(op => { console.log(`Operation: ${op.name} (${op.value})`); if (op.resource) console.log(` Resource: ${op.resource}`); }); // List core properties with options properties.coreProperties.filter(p => p.options).forEach(prop => { console.log(`${prop.displayName}:`); prop.options.forEach(opt => console.log(` - ${opt.name}: ${opt.value}`)); }); ``` -------------------------------- ### Extend ApiCollector Class with Workflow Fetching Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md Methods for fetching individual workflow definitions with retry logic and batch fetching with concurrency control. ```typescript /** * Fetch complete workflow definition */ public async fetchWorkflowDefinition(templateId: number): Promise { try { console.log(`Fetching complete workflow definition for Template ID ${templateId}...`); const response = await this.withRetry(async () => { return await this.client.get( `/workflows/templates/${templateId}` ); }); console.log(`Successfully fetched workflow: ${response.data.name}`); console.log(`- Node count: ${response.data.workflow.nodes.length}`); console.log(`- Connection count: ${Object.keys(response.data.workflow.connections).length}`); return response.data; } catch (error) { if (error instanceof Error) { throw new Error(`Failed to fetch workflow definition: ${error.message}`); } throw new Error('Unknown error occurred while fetching workflow definition'); } } /** * Batch fetch multiple workflow definitions */ public async fetchMultipleWorkflows( templateIds: number[], concurrency: number = 5 ): Promise { const results: WorkflowDefinition[] = []; // Use concurrency control to avoid too many requests for (let i = 0; i < templateIds.length; i += concurrency) { const batch = templateIds.slice(i, i + concurrency); const batchResults = await Promise.all( batch.map(id => this.fetchWorkflowDefinition(id)) ); results.push(...batchResults); // Add delay between batches if (i + concurrency < templateIds.length) { await this.delay(1000); } } return results; } ``` -------------------------------- ### Generate Markdown with Workflow Details Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/workflow-api-research.en.md Generates a markdown string containing a complete workflow definition, including architecture, node configuration, and connection relationships. This function is part of the TemplateGenerator class. ```typescript /** * Generate markdown with complete workflow definition */ generateTemplateMarkdownWithWorkflow( template: Template, workflow: WorkflowDefinition, category: TemplateCategory ): string { const sections = [ // ... original basic info ... '## Workflow Architecture', '', this.generateWorkflowDiagram(workflow), '', '## Node Configuration Details', '', this.generateNodeDetails(workflow), '', '## Connection Relationships', '', this.generateConnectionDetails(workflow), '', '## Complete Workflow JSON', '', '```json', JSON.stringify(workflow.workflow, null, 2), '```', '' ]; return sections.join('\n'); } ``` -------------------------------- ### Generate Mermaid Workflow Diagram Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Implement this private method in TemplateGenerator to create a Mermaid flowchart visualization of the workflow structure. ```typescript private generateWorkflowDiagram(workflow: WorkflowDefinition): string ``` -------------------------------- ### Generate Connection Relationship Description Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/IMPLEMENTATION_PLAN.en.md Implement this method in TemplateGenerator to describe the connection relationships between nodes in the workflow. ```typescript private generateConnectionDetails(workflow: WorkflowDefinition): string ``` -------------------------------- ### Collect Node Information with NpmCollector Source: https://context7.com/mikasa1013/n8n-skills/llms.txt Use NpmCollector to gather simplified node metadata from n8n NPM packages. This includes details like display names, descriptions, categories, and credential requirements. For more in-depth information, use collectAllWithDetails to load complete node classes. ```typescript import { NpmCollector } from 'n8n-skills'; // Create collector instance const collector = new NpmCollector(); // Collect simplified information for all nodes const nodes = await collector.collectAll(); console.log(`Collected ${nodes.length} nodes`); // Each node contains: // { // nodeType: "nodes-base.Gmail", // displayName: "Gmail", // description: "Send and receive emails using Gmail", // category: "output", // packageName: "n8n-nodes-base", // version: "2", // isVersioned: true, // isTrigger: false, // isWebhook: false, // isAITool: false, // hasCredentials: true, // hasOperations: true // } // Collect complete node classes for detailed parsing const loadedNodes = await collector.collectAllWithDetails(); loadedNodes.forEach(node => { console.log(`${node.packageName}/${node.nodeName}: ${node.NodeClass.description?.displayName}`); }); ``` -------------------------------- ### n8n API Endpoint for Template Search Source: https://github.com/mikasa1013/n8n-skills/blob/main/docs/API_RESEARCH_RESULTS.en.md Use this endpoint to retrieve basic template information, including simplified node lists. It supports pagination and filtering by category or keywords. ```typescript GET https://api.n8n.io/api/templates/search Parameters: - page: Page number - rows: Items per page (max 100) - category: Category (optional) - search: Keywords (optional) ```