### Get AI Agent Configuration with Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SEARCH_GUIDE.md Retrieve configuration details for an AI agent node, including examples. Set `includeExamples: true` to see practical usage scenarios. ```javascript get_node({ nodeType: "nodes-langchain.agent", includeExamples: true }) ``` -------------------------------- ### Advanced Usage - Ask for Real Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md To get practical examples of how to implement certain workflows, ask for real template examples. This example specifically requests templates for webhook workflows. ```text "Show me real template examples of webhook workflows" ``` -------------------------------- ### Configure GET Request with Query Parameters Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/http_api_integration.md Example configuration for an HTTP Request node to perform a GET request. It includes setting the URL and defining query parameters for filtering and pagination. ```javascript { method: "GET", url: "https://api.example.com/users", sendQuery: true, queryParameters: { "page": "1", "limit": "100", "filter": "active" } } ``` -------------------------------- ### Changelog Entry Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/DEVELOPMENT.md An example of how to format an entry in the CHANGELOG.md file, detailing additions, changes, and fixes for a specific version. ```markdown ## [1.1.0] - 2025-10-20 ### Added - New skill: n8n Expression Syntax - 3 evaluations for expression syntax ### Changed - Improved MCP Tools Expert validation guidance ### Fixed - Corrected nodeType format in examples ``` -------------------------------- ### Node Discovery: Search and Get Details Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SKILL.md Demonstrates the common workflow of searching for nodes and then retrieving their details, including examples. ```javascript // Step 1: Search (fast!) const results = await search_nodes({ query: "slack", mode: "OR", // Default: any word matches limit: 20 }); // → Returns: nodes-base.slack, nodes-base.slackTrigger // Step 2: Get details (~18s later, user reviewing results) const details = await get_node({ nodeType: "nodes-base.slack", includeExamples: true // Get real template configs }); // → Returns: operations, properties, metadata ``` -------------------------------- ### Get Standard Node Information with Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SEARCH_GUIDE.md Retrieve standard details for a node, including available operations, essential properties, metadata, and real template examples. This is the recommended mode for most use cases. ```javascript get_node({ nodeType: "nodes-base.slack", // Required: SHORT prefix format includeExamples: true // Optional: get real template configs }) // detail="standard" is the default ``` -------------------------------- ### Weather to Slack Template Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/SKILL.md An example workflow from the n8n template library for fetching weather data and sending it to Slack. ```text Schedule → HTTP Request (weather API) → Set → Slack ``` -------------------------------- ### Include Examples in Node Info Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SEARCH_GUIDE.md Adds approximately 200-400 tokens per example when retrieving node information. Only works with `mode: "info"` and `detail: "standard"`. ```javascript get_node({ nodeType: "nodes-base.slack", includeExamples: true // Adds ~200-400 tokens per example }) ``` -------------------------------- ### Python Code Snippet for Quick Reference Table Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-python/DATA_ACCESS.md Demonstrates various data access patterns using n8n input objects. Includes summing amounts, getting API responses, processing each item, combining nodes, filtering lists, transforming objects, and handling webhook data. ```python # Sum all amounts # items = _input.all() # sum(i["json"].get("amount", 0) for i in items) # Get API response # _input.first()["json"].get("data") # Process each independently # _input.item["json"] (Each Item mode) # Combine two nodes # _node["Name"]["json"] # Filter list # [i for i in items if i["json"].get("active")] # Transform single object # {**_input.first()["json"], "new": True} # Webhook data # _input.first()["json"]["body"] ``` -------------------------------- ### Get Slack Node Info (Standard Detail) Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/SKILL.md Example of calling get_node for the Slack node with default 'standard' detail level. This is the recommended starting point for configuration as it returns required fields and common options. ```javascript get_node({ nodeType: "nodes-base.slack" }); // detail="standard" is the default ``` -------------------------------- ### Common Discovery Pattern: Search Nodes then Get Node Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/README.md Illustrates the most common workflow for discovering node details, starting with a general search and then retrieving specific node information. This pattern is efficient for most configuration tasks. ```text search_nodes → get_node (18s average) ``` -------------------------------- ### Full Webhook Processing Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/DATA_ACCESS.md A comprehensive example showing how to retrieve webhook output, access its body and headers, and then process this data to create a new output object. ```javascript // Get webhook data from previous node const webhookOutput = $input.first().json; // Access the actual payload const payload = webhookOutput.body; // Access headers if needed const contentType = webhookOutput.headers['content-type']; // Access query parameters if needed const apiKey = webhookOutput.query.api_key; // Process the actual data return [{ json: { // Data from webhook body userName: payload.name, userEmail: payload.email, message: payload.message, // Metadata receivedAt: new Date().toISOString(), contentType: contentType, authenticated: !!apiKey } }]; ``` -------------------------------- ### Unstructured Mode Tool Description Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-tool/SKILL.md For unstructured mode, the tool description should include an example of the JSON string the LLM should send. ```text Deterministiskt beräknar månadskostnad för billån. Anropa med EN JSON-sträng: {"price":439900,"down_payment":87980,"interest_rate":6.95,"months":36,"residual_percent":50} Fält: price (SEK), down_payment (SEK), interest_rate (% per år), months, residual_percent (0-99). ``` -------------------------------- ### Complete Validation Workflow Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/VALIDATION_GUIDE.md This example outlines a step-by-step process for validating n8n nodes and workflows, from initial requirement checks to applying auto-fixes. ```javascript // Step 1: Get node requirements (quick check) validate_node({ nodeType: "nodes-base.slack", config: {}, mode: "minimal" }); // → Know what's required // Step 2: Configure node const config = { resource: "message", operation: "post", channel: "#general", text: "Hello!" }; // Step 3: Validate configuration (full validation) const result = validate_node({ nodeType: "nodes-base.slack", config, profile: "runtime" }); // Step 4: Check result if (result.valid) { console.log("Configuration valid!"); } else { console.log("Errors:", result.errors); // Fix and validate again } // Step 5: Validate in workflow context validate_workflow({ workflow: { nodes: [{...config as node...}], connections: {...} } }); // Step 6: Apply auto-fixes if needed n8n_autofix_workflow({ id: "workflow-id", applyFixes: true }); ``` -------------------------------- ### Get Node with Standard Detail Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/SKILL.md Start node configuration retrieval with `get_node` using the default `detail` level. This provides a comprehensive overview suitable for most configuration tasks. ```javascript get_node({ nodeType: "nodes-base.slack" }); ``` -------------------------------- ### Common Workflow: Search, Get Node Info, and Validate Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SEARCH_GUIDE.md A typical workflow involves searching for a node by keyword, retrieving its configuration details (including examples), and then validating the configuration. ```javascript search_nodes({query: "slack"}) ``` ```javascript get_node({ nodeType: "nodes-base.slack", includeExamples: true }) ``` ```javascript validate_node({ nodeType: "nodes-base.slack", config: {resource: "channel", operation: "create"}, profile: "runtime" }) ``` -------------------------------- ### Start and End of Period with DateTime Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/BUILTIN_FUNCTIONS.md Shows how to get the start and end points of various time periods (day, week, month, year) using the DateTime library. ```javascript const now = DateTime.now(); return [{ json: { startOfDay: now.startOf('day').toISO(), endOfDay: now.endOf('day').toISO(), startOfWeek: now.startOf('week').toISO(), endOfWeek: now.endOf('week').toISO(), startOfMonth: now.startOf('month').toISO(), endOfMonth: now.endOf('month').toISO(), startOfYear: now.startOf('year').toISO(), endOfYear: now.endOf('year').toISO() } }]; ``` -------------------------------- ### Install n8n-mcp Server Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/INSTALLATION.md Install the n8n-mcp server globally using npm. This is a prerequisite for using n8n-skills. ```bash npm install -g n8n-mcp ``` -------------------------------- ### Search and Get Node Information Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SKILL.md Use `search_nodes` to find nodes by keyword, then `get_node` to retrieve details or documentation. The standard detail includes operations, properties, and examples. ```javascript // Step 1: Search search_nodes({query: "slack"}) // Returns: nodes-base.slack // Step 2: Get details get_node({nodeType: "nodes-base.slack"}) // Returns: operations, properties, examples (standard detail) // Step 3: Get readable documentation get_node({nodeType: "nodes-base.slack", mode: "docs"}) // Returns: markdown documentation ``` -------------------------------- ### Install n8n Skills Plugin Source: https://github.com/czlonkowski/n8n-skills/blob/main/README.md Use this command to install the n8n skills directly as a Claude Code plugin. This is the recommended installation method. ```bash # Install directly as a Claude Code plugin /plugin install czlonkowski/n8n-skills ``` -------------------------------- ### Reference Real Templates Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md Shows how to use n8n skills to reference and understand specific workflow templates by their ID. ```text "Show me template #2947 and explain how it works" → Uses n8n-mcp tools to fetch and analyze real templates ``` -------------------------------- ### Customer Support System Prompt Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/ai_agent_workflow.md An example system prompt for a customer support agent, detailing its role, capabilities, and interaction guidelines. ```plaintext You are a customer support assistant for Acme Corp. You can: - Search the knowledge base for answers - Look up customer orders and shipping status - Create support tickets for complex issues Guidelines: - Be friendly and professional - If you don't know something, say so and offer to create a ticket - Always verify customer identity before sharing order details Format: - Keep responses concise - Use bullet points for multiple items - Include relevant links when available ``` -------------------------------- ### Weather to Slack Template Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/scheduled_tasks.md Example of a scheduled workflow that fetches weather data, formats it, and posts it to Slack. This demonstrates a common use case for scheduled tasks. ```text Schedule (daily 8 AM) → HTTP Request (weather API) → Set (format message) → Slack (post to #general) ``` -------------------------------- ### Log Execution Start and Insert Log Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/scheduled_tasks.md Conceptual steps for logging the start of a scheduled task and inserting its details into a database upon completion. ```text Schedule → Set (record start) → [Workflow logic] → Postgres (INSERT execution log) ``` -------------------------------- ### Cron Expression Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/scheduled_tasks.md Provides examples of common cron expressions for various scheduling needs, including hourly, specific times, daily, and bi-monthly intervals. ```text 0 */6 * * * Every 6 hours 0 9,17 * * * At 9 AM and 5 PM daily 0 0 * * 0 Every Sunday at midnight */30 * * * * Every 30 minutes 0 0 1,15 * * 1st and 15th of each month ``` -------------------------------- ### Example Workflow Structure Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/README.md Illustrates a typical sequence of nodes for a scheduled task that fetches data and sends it to Slack. ```text Schedule (daily 8 AM) → HTTP Request (weather) → Set → Slack ``` -------------------------------- ### Acceptable Hardcoded Credentials - Demo/Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-validation-expert/FALSE_POSITIVES.md Using hardcoded demo tokens in example workflows clearly marked as such, where security is not a concern. ```javascript // Example workflow in documentation { "url": "https://example.com/api", "headers": { "Authorization": "Bearer DEMO_TOKEN" } // Clearly marked as example } ``` -------------------------------- ### HTTP Request: GET with Query Parameters Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/OPERATION_PATTERNS.md Configuration for a GET request including query parameters, with dynamic values using expressions. ```javascript { "method": "GET", "url": "https://api.example.com/users", "authentication": "none", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "limit", "value": "100" }, { "name": "offset", "value": "={{$json.offset}}" } ] } } ``` -------------------------------- ### Schedule Daily at Specific Time (Gotcha) Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/OPERATION_PATTERNS.md Illustrates the correct and incorrect ways to set a daily schedule. The bad example uses the server's timezone, while the good example explicitly sets the timezone. ```javascript // ❌ Bad - uses server timezone { "rule": { "interval": [...] } } // ✅ Good - explicit timezone { "rule": { "interval": [...], "timezone": "America/New_York" } } ``` -------------------------------- ### Skill Activation Verification Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/dist/README.md These are example queries to verify that specific n8n skills are activating correctly within Claude. They cover expression syntax, tool usage, workflow patterns, and code node functionalities. ```text "How do I write n8n expressions?" -> Should activate: n8n Expression Syntax "Find me a Slack node" -> Should activate: n8n MCP Tools Expert "Build a webhook workflow" -> Should activate: n8n Workflow Patterns "How do I access webhook data in a Code node?" -> Should activate: n8n Code JavaScript "Can I use pandas in Python Code node?" -> Should activate: n8n Code Python ``` -------------------------------- ### Webhook to Slack Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-expression-syntax/SKILL.md This example shows how to reference data received by a webhook and display it in a Slack node. Webhook data is typically nested under the 'body' property. ```json { "body": { "name": "John Doe", "email": "john@example.com", "message": "Hello!" } } ``` ```javascript New form submission! Name: {{$json.body.name}} Email: {{$json.body.email}} Message: {{$json.body.message}} ``` -------------------------------- ### Install Specific N8N Skills Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/INSTALLATION.md Install only selected N8N skills by copying their respective directories to the Claude Code skills directory. ```bash # Only expression syntax and MCP tools expert cp -r skills/n8n-expression-syntax ~/.claude/skills/ cp -r skills/n8n-mcp-tools-expert ~/.claude/skills/ ``` -------------------------------- ### OpenAI Chat Model Configuration Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/ai_agent_workflow.md Example configuration for an OpenAI Chat Model, specifying the model, temperature, and maximum tokens. ```javascript { model: "gpt-4", temperature: 0.7, maxTokens: 1000 } ``` -------------------------------- ### Clone n8n-skills Repository Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/INSTALLATION.md Clone the n8n-skills repository to your local machine. This is the first step for manual installations. ```bash git clone https://github.com/czlonkowski/n8n-skills.git cd n8n-skills ``` -------------------------------- ### Code Tool with JSON Schema Example (fromJson) Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-tool/INPUT_SCHEMA.md Configure the Code Tool to infer a JSON schema from a provided example. This method is recommended for its simplicity. The LLM will receive a typed object based on the inferred schema. ```json { "parameters": { "name": "calculate_car_loan", "description": "Computes monthly car-loan payment using an annuity formula with optional balloon.", "language": "javaScript", "specifyInputSchema": true, "schemaType": "fromJson", "jsonSchemaExample": "{ \"price\": 439900, \"down_payment\": 87980, \"interest_rate\": 6.95, \"months\": 36, \"residual_percent\": 50, \"setup_fee\": 695, \"monthly_admin_fee\": 59 }", "jsCode": "// query is now a validated OBJECT, not a string const { price, down_payment, interest_rate, months, residual_percent, setup_fee = 0, monthly_admin_fee = 0 } = query; const principal = price - down_payment; const residual = price * (residual_percent / 100); const r = interest_rate / 100 / 12; const growth = Math.pow(1 + r, months); const base = r === 0 ? (principal - residual) / months : (principal - residual / growth) * r / (1 - 1 / growth); const monthly_payment = base + monthly_admin_fee; return JSON.stringify({ monthly_payment_sek: Math.round(monthly_payment), loan_amount: Math.round(principal) });" }, "type": "@n8n/n8n-nodes-langchain.toolCode", "typeVersion": 1.3, "name": "calculate_car_loan" } ``` -------------------------------- ### Node Type Format Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SEARCH_GUIDE.md Examples of node type formats used for search/validate tools (short prefix) and workflow tools (full prefix). ```javascript "nodes-base.slack" ``` ```javascript "nodes-base.httpRequest" ``` ```javascript "nodes-langchain.agent" ``` ```javascript "n8n-nodes-base.slack" ``` ```javascript "n8n-nodes-base.httpRequest" ``` ```javascript "@n8n/n8n-nodes-langchain.agent" ``` -------------------------------- ### JavaScript Code Node Conversion Examples Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/ERROR_PATTERNS.md Provides quick conversion examples for common n8n expression syntax found in other nodes to the correct JavaScript syntax required for Code nodes. ```javascript // WRONG → RIGHT conversions // ❌ "{{ $json.field }}" // ✅ $json.field // ❌ "{{ $now }}" // ✅ new Date().toISOString() // ❌ "{{ $node['HTTP Request'].json.data }}" // ✅ $node["HTTP Request"].json.data // ❌ `{{ $json.firstName }} {{ $json.lastName }}` // ✅ `${$json.firstName} ${$json.lastName}` ``` -------------------------------- ### Manual n8n Skills Installation Source: https://github.com/czlonkowski/n8n-skills/blob/main/README.md Manually install n8n skills by cloning the repository and copying the skills to your Claude Code skills directory. Reload Claude Code for skills to activate. ```bash # 1. Clone this repository git clone https://github.com/czlonkowski/n8n-skills.git # 2. Copy skills to your Claude Code skills directory cp -r n8n-skills/skills/* ~/.claude/skills/ # 3. Reload Claude Code # Skills will activate automatically ``` -------------------------------- ### Get Readable Node Documentation Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SEARCH_GUIDE.md Retrieve human-readable documentation for a node, including usage examples, authentication guides, and best practices. This mode is better for learning than raw schema. ```javascript get_node({ nodeType: "nodes-base.slack", mode: "docs" }) ``` -------------------------------- ### Typical Workflow: Set Up Credentials Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/WORKFLOW_GUIDE.md This workflow demonstrates the steps to set up credentials: first, get the schema to understand required fields, then create the credential, and finally list all credentials to verify. ```javascript // 1. Discover what fields are needed n8n_manage_credentials({ action: "getSchema", type: "slackApi" }) // 2. Create the credential n8n_manage_credentials({ action: "create", name: "Production Slack", type: "slackApi", data: {accessToken: "xoxb-..."} }) // 3. Verify it was created n8n_manage_credentials({action: "list"}) ``` -------------------------------- ### JavaScript Code Tool Example: Car Loan Calculator Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-tool/SKILL.md This example demonstrates a production-ready calculator tool using JavaScript. It expects input as a JSON string and returns a JSON string with calculated loan details. Ensure all required parameters are provided and correctly formatted. ```json { "parameters": { "name": "calculate_car_loan", "description": "Computes monthly car-loan payment using an annuity formula with residual/balloon. Call with a single JSON string. Example: {\"price\":439900,\"down_payment\":87980,\"interest_rate\":6.95,\"months\":36,\"residual_percent\":50,\"setup_fee\":695,\"monthly_admin_fee\":59}. Required: price, down_payment, interest_rate, months, residual_percent. Optional: setup_fee, monthly_admin_fee (default 0).", "language": "javaScript", "jsCode": "let params;\ntry {\n params = typeof query === 'string' ? JSON.parse(query) : query;\n} catch (e) {\n throw new Error('Invalid JSON: ' + e.message);\n}\n\nconst price = Number(params.price);\nconst down_payment = Number(params.down_payment);\nconst interest_rate = Number(params.interest_rate);\nconst months = Number(params.months);\nconst residual_percent= Number(params.residual_percent);\nconst setup_fee = Number(params.setup_fee ?? 0) || 0;\nconst monthly_admin_fee = Number(params.monthly_admin_fee ?? 0) || 0;\n\nif (!isFinite(price) || price <= 0) throw new Error('price must be > 0');\nif (down_payment < 0 || down_payment >= price) throw new Error('down_payment must be in [0, price)');\n\nconst principal = price - down_payment;\nconst residual = price * (residual_percent / 100);\nconst r = interest_rate / 100 / 12;\nconst growth = Math.pow(1 + r, months);\nconst base = r === 0\n ? (principal - residual) / months\n : (principal - residual / growth) * r / (1 - 1 / growth);\nconst monthly_payment = base + monthly_admin_fee;\n\nreturn JSON.stringify({\n monthly_payment_sek: Math.round(monthly_payment),\n loan_amount: Math.round(principal),\n residual_value_sek: Math.round(residual),\n total_cost_of_credit: Math.round(monthly_payment * months + residual + setup_fee - principal)\n});" }, "type": "@n8n/n8n-nodes-langchain.toolCode", "typeVersion": 1.3, "name": "calculate_car_loan" } ``` -------------------------------- ### MCP Tool Testing - Templates Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/DEVELOPMENT.md JavaScript examples for searching and retrieving templates using MCP tools. ```javascript // Templates search_templates({query: "webhook"}) get_template({templateId: 2947, mode: "structure"}) ``` -------------------------------- ### Build AI Workflow Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md Demonstrates building an AI Agent workflow using the 'n8n Workflow Patterns' and 'n8n Node Configuration' skills, showing the required connections. ```text You: "Create an AI Agent workflow with HTTP Request tool" [n8n Workflow Patterns + Node Configuration activate] Claude: AI Agent Workflow Pattern: 1. Connect language model: sourceOutput="ai_languageModel" 2. Connect tool: sourceOutput="ai_tool" 3. Connect memory: sourceOutput="ai_memory" [Provides complete configuration] ``` -------------------------------- ### Python (Beta) Example with Built-in Helpers Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-python/SKILL.md Illustrates using the recommended Python (Beta) mode, which provides access to n8n helper functions like `_now` and standard input access via `_input.all()`. ```python # Python (Beta) example items = _input.all() now = _now # Built-in datetime object return [{ "json": { "count": len(items), "timestamp": now.isoformat() } }] ``` -------------------------------- ### Cross-Reference Formatting Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/DEVELOPMENT.md Markdown examples for linking to related skills, reference files, and templates. ```markdown See [n8n MCP Tools Expert](../n8n-mcp-tools-expert/SKILL.md) See [COMMON_MISTAKES.md](COMMON_MISTAKES.md) See template #2947 for example ``` -------------------------------- ### Over-configuring Upfront vs. Minimal Configuration Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/SKILL.md Avoid adding all possible optional fields initially. Start with essential fields and add others only when necessary. ```javascript // Adding every possible field { "method": "GET", "url": "...", "sendQuery": false, "sendHeaders": false, "sendBody": false, "timeout": 10000, "ignoreResponseCode": false, // ... 20 more optional fields } ``` ```javascript // Start minimal { "method": "GET", "url": "...", "authentication": "none" } // Add fields only when needed ``` -------------------------------- ### Best Practice: Check Dependencies Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/DEPENDENCIES.md When encountering configuration issues, use `get_node` with `search_properties` to understand field dependencies. ```javascript get_node({nodeType: "...", mode: "search_properties", propertyQuery: "..."}); ``` -------------------------------- ### Get Tool Documentation Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SKILL.md Retrieves documentation for n8n tools. Use 'topic' to specify the tool or guide, and 'depth' for the level of detail. ```javascript // Overview of all tools tools_documentation() // Specific tool details tools_documentation({ topic: "search_nodes", depth: "full" }) // Code node guides tools_documentation({topic: "javascript_code_node_guide", depth: "full"}) tools_documentation({topic: "python_code_node_guide", depth: "full"}) // Comprehensive AI workflow guide tools_documentation({topic: "ai_agents_guide", depth: "full"}) ``` -------------------------------- ### Basic $helpers.httpRequest() Usage Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/BUILTIN_FUNCTIONS.md Make HTTP requests directly from Code nodes. This example demonstrates a simple GET request and returns the response data. ```javascript const response = await $helpers.httpRequest({ method: 'GET', url: 'https://api.example.com/users' }); return [{json: {data: response}}]; ``` -------------------------------- ### Acceptable No Retry Logic for Idempotent Operations Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-validation-expert/FALSE_POSITIVES.md Example of a read-only GET request where retrying is safe and has no side effects, making explicit retry logic less critical. ```javascript // GET request - safe to retry manually if needed { "method": "GET", "url": "https://api.example.com/status" // Read-only, no side effects } ``` -------------------------------- ### Quick Node Search Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md Demonstrates a user query for finding specific nodes and the 'n8n MCP Tools Expert' skill's response using search_nodes. ```text You: "Find email nodes" [n8n MCP Tools Expert activates] Claude: Uses search_nodes({query: "email"}) Returns: Gmail, Email Send, IMAP Email, etc. ``` -------------------------------- ### Advanced Usage - Request Step-by-Step Guidance Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md For complex tasks, request a step-by-step approach. This ensures you receive guidance at each stage of the process, including validation. This example outlines building a webhook to database workflow. ```text "Step by step: build a webhook to database workflow with validation at each step" ``` -------------------------------- ### n8n Workflow Build - Step 3: Node Configuration Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md Details the 'n8n Node Configuration' skill's role in guiding the setup of Webhook and Slack nodes during a workflow build. ```text → Guides: Webhook node setup (path, httpMethod) → Guides: Slack node setup (resource, operation, channel) ``` -------------------------------- ### n8n Node Configuration Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md Demonstrates the cascading dependencies in n8n node configuration, specifically for the HTTP Request node, showing how setting one property reveals others. ```text [Skill activates] HTTP Request node property dependencies: 1. Set sendBody = true ↓ Reveals: contentType 2. Set contentType = "json" ↓ Reveals: specifyBody 3. Set specifyBody = "json" ↓ Reveals: jsonBody This cascade of 32 dependencies ensures you see only relevant properties! For AI workflows, 8 connection types: - ai_languageModel (OpenAI, Anthropic) - ai_tool (HTTP Request Tool, Code Tool) - ai_memory (Window Buffer Memory) - ai_outputParser, ai_embedding, ai_vectorStore... ``` -------------------------------- ### Get Node Info for HTTP Request Node Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/SKILL.md Example of using the get_node function to retrieve information about the HTTP Request node, which includes details on required and optional fields like method, url, sendBody, body, and authentication. ```javascript const info = get_node({ nodeType: "nodes-base.httpRequest" }); // Returns: method, url, sendBody, body, authentication required/optional ``` -------------------------------- ### HTTP POST Request with JSON Body Configuration Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/DEPENDENCIES.md Demonstrates the step-by-step configuration of an HTTP POST request, including enabling and defining a JSON body. Each step shows how setting a field reveals subsequent configuration options. ```javascript { "method": "POST" // → sendBody becomes visible } ``` ```javascript { "method": "POST", "sendBody": true // → body field becomes visible AND required } ``` ```javascript { "method": "POST", "sendBody": true, "body": { "contentType": "json" // → content field becomes visible AND required } } ``` ```javascript { "method": "POST", "sendBody": true, "body": { "contentType": "json", "content": { "name": "John", "email": "john@example.com" } } } // ✅ Valid! ``` -------------------------------- ### Daily Reports Workflow Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/scheduled_tasks.md Illustrates a typical daily report workflow, including scheduling, data fetching from a database, processing, and delivery via email and Slack. ```text 1. Schedule (daily at 9 AM) 2. Postgres (query yesterday's sales) SELECT date, SUM(amount) as total, COUNT(*) as orders FROM orders WHERE date = CURRENT_DATE - INTERVAL '1 day' GROUP BY date 3. Code (calculate metrics) - Total revenue - Order count - Average order value - Comparison to previous day 4. Set (format email body) Subject: Daily Sales Report - {{$json.date}} Body: Formatted HTML with metrics 5. Email (send to team@company.com) 6. Slack (post summary to #sales) ``` -------------------------------- ### Install Claude Code Plugin Source: https://github.com/czlonkowski/n8n-skills/blob/main/dist/README.md Use this command to install the n8n-mcp skills as a Claude Code plugin from a remote repository. Alternatively, you can install from a local zip file. ```bash # Claude Code plugin installation /plugin install czlonkowski/n8n-skills # Or install from local file /plugin install /path/to/n8n-mcp-skills-v1.11.1.zip ``` -------------------------------- ### New Way: Smart Parameters for Connections Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SKILL.md Illustrates using semantic branch names and case numbers for clearer and more readable node connections. ```javascript // IF node - semantic branch names { type: "addConnection", source: "IF", target: "True Handler", branch: "true" // Clear and readable! } { type: "addConnection", source: "IF", target: "False Handler", branch: "false" } // Switch node - semantic case numbers { type: "addConnection", source: "Switch", target: "Handler A", case: 0 } ``` -------------------------------- ### Check n8n-mcp Installation Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/INSTALLATION.md Verify if the n8n-mcp package is globally installed using npm. ```bash npm list -g n8n-mcp ``` -------------------------------- ### HTTP Request: Minimal GET Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/OPERATION_PATTERNS.md Basic configuration for a GET request to an API endpoint. ```javascript { "method": "GET", "url": "https://api.example.com/users", "authentication": "none" } ``` -------------------------------- ### Example Git Commits Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/DEVELOPMENT.md Examples of Git commit messages following the specified format and types. ```gitcommit feat(expression-syntax): add webhook data structure guide fix(mcp-tools): correct nodeType format examples docs(usage): add cross-skill composition examples test(validation): add auto-sanitization evaluation ``` -------------------------------- ### New Skill Creation: Step 4 - SKILL.md Recommended Structure Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/DEVELOPMENT.md Recommended structure for a SKILL.md file, including sections for Quick Reference, Core Concepts, Common Patterns, Common Mistakes, Advanced Topics, and Related Skills. ```markdown # Skill Name ## Quick Reference [Table or list of most common patterns] ## Core Concepts [Essential knowledge] ## Common Patterns [Real examples with code] ## Common Mistakes [Errors and fixes] ## Advanced Topics [Link to reference files] ## Related Skills [Cross-references] ``` -------------------------------- ### HTTP Request: GET with Authentication Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/OPERATION_PATTERNS.md Configuration for a GET request using predefined credential types for authentication. ```javascript { "method": "GET", "url": "https://api.example.com/users", "authentication": "predefinedCredentialType", "nodeCredentialType": "httpHeaderAuth" } ``` -------------------------------- ### Daily Backup Template Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/scheduled_tasks.md A scheduled workflow pattern for performing daily backups. It exports data from Postgres, uploads it to Google Drive, and sends an email confirmation. ```text Schedule (nightly 2 AM) → Postgres (export data) → Google Drive (upload) → Email (confirmation) ``` -------------------------------- ### Data Synchronization Workflow Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/scheduled_tasks.md Demonstrates a data synchronization process, fetching data from an external API based on a last sync timestamp and updating a data warehouse. ```text 1. Schedule (every hour) 2. Set (store last sync time) SELECT MAX(synced_at) FROM sync_log 3. HTTP Request (fetch new CRM contacts since last sync) GET /api/contacts?updated_since={{$json.last_sync}} 4. IF (check if new records exist) 5. Set (transform CRM schema to warehouse schema) 6. Postgres (warehouse - INSERT new contacts) 7. Postgres (UPDATE sync_log SET synced_at = NOW()) 8. IF (error occurred) └─ Slack (alert #data-team) ``` -------------------------------- ### Verify SKILL.md Frontmatter Format Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/INSTALLATION.md Ensure your skill's SKILL.md file includes the correct frontmatter format with name and description. ```markdown --- name: n8n Expression Syntax description: Validate n8n expression syntax... --- ``` -------------------------------- ### Old Way: Manual Source Index for Connections Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SKILL.md Demonstrates the manual method of specifying the source index for node connections, which can be hard to remember. ```javascript // IF node connection { type: "addConnection", source: "IF", target: "Handler", sourceIndex: 0 // Which output? Hard to remember! } ``` -------------------------------- ### Data Analyst System Prompt Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/ai_agent_workflow.md An example system prompt for a data analyst agent, specifying its access to the database and operational guidelines. ```plaintext You are a data analyst assistant with access to the company database. You can: - Query sales, customer, and product data - Perform data analysis and calculations - Generate summary statistics Guidelines: - Write efficient SQL queries (always use LIMIT) - Explain your analysis methodology - Highlight important trends or anomalies - Use read-only queries (SELECT only) Format: - Provide numerical answers with context - Include query used (for transparency) - Suggest follow-up analyses when relevant ``` -------------------------------- ### IF Node Metadata Warning Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-validation-expert/FALSE_POSITIVES.md Example of a 'metadata_incomplete' warning for the IF node, indicating it's a false positive for versions 2.2+ due to auto-sanitization. ```json { "type": "metadata_incomplete", "message": "IF node missing conditions.options metadata", "node": "IF" } ``` -------------------------------- ### $helpers.httpRequest() Complete Options Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/BUILTIN_FUNCTIONS.md Utilize the full range of options for `$helpers.httpRequest()` to configure method, URL, headers, body, query parameters, timeouts, and response handling. ```javascript const response = await $helpers.httpRequest({ method: 'POST', // GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS url: 'https://api.example.com/users', headers: { 'Authorization': 'Bearer token123', 'Content-Type': 'application/json', 'User-Agent': 'n8n-workflow' }, body: { name: 'John Doe', email: 'john@example.com' }, qs: { // Query string parameters page: 1, limit: 10 }, timeout: 10000, // Milliseconds (default: no timeout) json: true, // Auto-parse JSON response (default: true) simple: false, // Don't throw on HTTP errors (default: true) resolveWithFullResponse: false // Return only body (default: false) }); ``` -------------------------------- ### Add n8n Skills Marketplace Source: https://github.com/czlonkowski/n8n-skills/blob/main/README.md Add the n8n skills as a marketplace to browse and install plugins. After adding, you can list and install available plugins. ```bash # Add as marketplace, then browse and install /plugin marketplace add czlonkowski/n8n-skills # Then browse available plugins /plugin install # Select "n8n-mcp-skills" from the list ``` -------------------------------- ### Example JSON for Best Practice Warning Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-validation-expert/SKILL.md Shows a 'best_practice' warning, suggesting an improvement for workflow robustness. The 'suggestion' property offers a concrete way to enhance the configuration. ```json { "type": "best_practice", "property": "errorHandling", "message": "Slack API can have rate limits", "suggestion": "Add onError: 'continueRegularOutput' with retryOnFail" } ``` -------------------------------- ### $helpers.httpRequest() GET Request with Query Parameters Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/BUILTIN_FUNCTIONS.md Perform a GET request with query parameters using `$helpers.httpRequest()`. This is useful for filtering or paginating results from an API. ```javascript // GET with query parameters const results = await $helpers.httpRequest({ method: 'GET', url: 'https://api.example.com/search', qs: { q: 'javascript', page: 1, per_page: 50 } }); return [{json: results}]; ``` -------------------------------- ### Switch Node Branch Count Warning Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-validation-expert/FALSE_POSITIVES.md Example of a 'configuration_mismatch' warning for the Switch node, indicating it's a false positive when using the 'fallback' mode. ```json { "type": "configuration_mismatch", "message": "Switch has 3 rules but 4 output connections", "node": "Switch" } ``` -------------------------------- ### Monitoring and Health Checks Workflow Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/scheduled_tasks.md Outlines a workflow for monitoring website health, including scheduling, making HTTP requests, checking response times, and implementing alert cooldowns before notifying via Slack, PagerDuty, and email. ```text 1. Schedule (every 5 minutes) 2. HTTP Request (GET https://example.com/health) - timeout: 10 seconds - continueOnFail: true 3. IF (status !== 200 OR response_time > 2000ms) 4. Redis (check alert cooldown - don't spam) - Key: alert:website_down - TTL: 30 minutes 5. IF (no recent alert sent) 6. [Alert Actions] ├─ Slack (notify #ops-team) ├─ PagerDuty (create incident) ├─ Email (alert@company.com) └─ Redis (set alert cooldown) 7. Postgres (log uptime check result) ``` -------------------------------- ### Get AI Agent Documentation Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-mcp-tools-expert/SEARCH_GUIDE.md Retrieve documentation for a specific AI agent node. Use `mode: "docs"` to get detailed usage information. ```javascript get_node({nodeType: "nodes-langchain.agent", mode: "docs"}) ``` -------------------------------- ### HTTP Request to Email Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-expression-syntax/SKILL.md This example demonstrates referencing data returned from an HTTP Request node within an Email node. Ensure the node name in the expression matches exactly. ```json { "data": { "items": [ {"name": "Product 1", "price": 29.99} ] } } ``` ```javascript Product: {{$node["HTTP Request"].json.data.items[0].name}} Price: ${{$node["HTTP Request"].json.data.items[0].price}} ``` -------------------------------- ### Minimal JavaScript Code Tool Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-tool/README.md A basic JavaScript example for the Code Tool. It demonstrates how to return a simple string response based on the input query. ```javascript return `You asked: ${query}`; ``` -------------------------------- ### Use Credentials System (Correct) Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/http_api_integration.md Highlights the secure and recommended way to handle authentication in n8n by utilizing the built-in credentials system, abstracting sensitive information from the workflow. ```javascript authentication: "predefinedCredentialType", nodeCredentialType: "httpHeaderAuth" ``` -------------------------------- ### Compare Data Across Nodes Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/DATA_ACCESS.md Compares data from 'Get Old Data' and 'Get New Data' nodes to identify added, removed, and modified records based on an 'id' field. ```javascript const oldData = $node["Get Old Data"].json; const newData = $node["Get New Data"].json; // Compare const changes = { added: newData.filter(n => !oldData.find(o => o.id === n.id)), removed: oldData.filter(o => !newData.find(n => n.id === o.id)), modified: newData.filter(n => { const old = oldData.find(o => o.id === n.id); return old && JSON.stringify(old) !== JSON.stringify(n); }) }; return [{ json: { changes, summary: { added: changes.added.length, removed: changes.removed.length, modified: changes.modified.length } } }]; ``` -------------------------------- ### Postgres SELECT Query Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-workflow-patterns/database_operations.md Configuration for executing a SELECT query in a Postgres database node. It demonstrates how to use parameters for filtering and limiting results. ```javascript { operation: "executeQuery", query: "SELECT id, name, email FROM users WHERE created_at > $1 LIMIT $2", parameters: [ "={{$json.since_date}}", "100" ] } ``` -------------------------------- ### HTTP Request Node: GET Request Configuration Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/SKILL.md Configuration for making a GET request. Includes URL, authentication details, and optional query parameters. Set 'sendQuery' to true to enable 'queryParameters'. ```javascript { "method": "GET", "url": "https://api.example.com/users", "authentication": "predefinedCredentialType", "nodeCredentialType": "httpHeaderAuth", "sendQuery": true, // Optional "queryParameters": { // Shows when sendQuery=true "parameters": [ { "name": "limit", "value": "100" } ] } } ``` -------------------------------- ### Correct Node Reference Syntax in Code Node Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-javascript/SKILL.md Access data from other nodes using the correct syntax. Use `.first()` to get a single item or `.all()` to get all items from a referenced node. ```javascript // ❌ WRONG - .json directly on node reference const data = $('HTTP Request').json; ``` ```javascript // ✅ CORRECT - call .first() then access .json const data = $('HTTP Request').first().json; ``` ```javascript // ✅ Also correct - get all items const allData = $('HTTP Request').all(); ``` -------------------------------- ### Operation Switch Dependency Pattern Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/SKILL.md Demonstrates how different operations within a resource can lead to different fields being shown. This example uses the Slack 'message' resource with 'post' and 'update' operations. ```javascript // Different operations → different fields { "resource": "message", "operation": "post" // → Shows: channel, text, attachments, etc. } { "resource": "message", "operation": "update" // → Shows: messageId, text (different fields!) } ``` -------------------------------- ### Advanced Usage - Request Specific Tool Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md To request the usage of a specific tool for a particular task, clearly state the tool and the desired action. This example shows how to ask for the configuration of the Slack node using the `get_node` tool. ```text "Use get_node to show me Slack node configuration" ``` -------------------------------- ### Using Standard Library for HTTP GET Request Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-python/ERROR_PATTERNS.md This Python snippet shows how to make a simple HTTP GET request using the standard library's 'urllib.request' module, avoiding external dependencies. ```python # ✅ Use urllib from standard library (limited functionality) from urllib.request import urlopen from urllib.parse import urlencode import json # Simple GET request (no headers, no auth) url = "https://api.example.com/data" with urlopen(url) as response: data = json.loads(response.read()) return [{"json": data}] ``` -------------------------------- ### Cross-Skill Composition Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/USAGE.md Illustrates how multiple n8n skills (Patterns, Validation, Expression Syntax) can be activated simultaneously for complex tasks like building, validating, and explaining workflows. ```text "Build, validate, and explain the expressions in this workflow" → Activates: Patterns + Validation + Expression Syntax ``` -------------------------------- ### New Skill Creation: Step 7 - Skill Metadata README.md Source: https://github.com/czlonkowski/n8n-skills/blob/main/docs/DEVELOPMENT.md Format for the README.md file within a skill's directory, detailing the skill's purpose, activation keywords, file count, dependencies, coverage, and evaluation status. ```markdown # Skill Name **Purpose**: One-sentence description **Activates on**: keyword1, keyword2, keyword3 **File Count**: X files, ~Y lines **Dependencies**: - n8n-mcp tools: tool1, tool2 - Other skills: skill1, skill2 **Coverage**: - Topic 1 - Topic 2 - Topic 3 **Evaluations**: X scenarios (X% pass rate) **Last Updated**: YYYY-MM-DD ``` -------------------------------- ### HttpRequest Node Configuration with GET Method Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-node-configuration/DEPENDENCIES.md When using the GET method in an HttpRequest node, the `body` field is automatically hidden and stripped, even if `sendBody` is true. Configure the method correctly to avoid data loss. ```javascript // Configure { "method": "GET", "sendBody": true, // ❌ GET doesn't support body "body": {...} // This will be stripped } // After save { "method": "GET" // body removed because method=GET hides it } ``` ```javascript // Correct approach - check property dependencies get_node({ nodeType: "nodes-base.httpRequest", mode: "search_properties", propertyQuery: "body" }); // See that body only shows for POST/PUT/PATCH/DELETE // Use correct method { "method": "POST", "sendBody": true, "body": {...} } ``` -------------------------------- ### Structured Mode Tool Description Example Source: https://github.com/czlonkowski/n8n-skills/blob/main/skills/n8n-code-tool/SKILL.md For structured mode, the description should focus on the tool's purpose and when to use it, as the schema defines the input. ```text Deterministically computes the monthly car-loan payment given price, down payment, annual interest rate, term, and residual percent. Use whenever the user asks for monthly cost, total credit cost, or loan breakdown. ```