### Explore AI Nodes Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SEARCH_GUIDE.md This example shows how to search for all AI-related nodes, retrieve detailed documentation for an AI Agent node, and get its configuration details along with examples. ```javascript // Find all AI-related nodes search_nodes({query: "ai agent", source: "all"}) ``` ```javascript // Get AI Agent documentation get_node({nodeType: "nodes-langchain.agent", mode: "docs"}) ``` ```javascript // Get configuration details with examples get_node({ nodeType: "nodes-langchain.agent", includeExamples: true }) ``` -------------------------------- ### HTTP Request Node Examples Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/SKILL.md Examples for performing GET and POST requests using the HTTP Request node. ```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" } ] } } ``` ```javascript { "method": "POST", "url": "https://api.example.com/users", "authentication": "none", "sendBody": true, // Required for POST "body": { // Required when sendBody=true "contentType": "json", "content": { "name": "John Doe", "email": "john@example.com" } } } ``` -------------------------------- ### Get Node Documentation (Docs Mode) Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SEARCH_GUIDE.md Use `get_node` with `mode="docs"` to retrieve human-readable documentation for a node, including usage examples, authentication guides, and best practices. This is ideal for learning how to use a node. ```javascript get_node({ nodeType: "nodes-base.slack", mode: "docs" }) ``` -------------------------------- ### Include Examples in Node Info Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SEARCH_GUIDE.md Use `includeExamples: true` when calling `get_node` to retrieve real-world configuration examples. This option adds significant token count and is only effective with `mode: "info"` and `detail: "standard"`. ```javascript get_node({ nodeType: "nodes-base.slack", includeExamples: true // Adds ~200-400 tokens per example }) ``` -------------------------------- ### Retrieve Node Details with Examples Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Use `get_node` with `includeExamples: true` to fetch detailed configurations and examples for a specific node type. This is typically done after searching for nodes. ```javascript // 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 ``` -------------------------------- ### Deploy n8n Template and Get Result Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/WORKFLOW_GUIDE.md Example of deploying a template and capturing the result, which includes the new workflow ID, required credentials, and any fixes applied. ```javascript // Deploy a webhook to Slack template const result = n8n_deploy_template({ templateId: 2947, name: "Production Slack Notifier" }); // Result includes: // - id: "new-workflow-id" // - requiredCredentials: ["slack"] // - fixesApplied: ["typeVersion upgraded", "expression format fixed"] ``` -------------------------------- ### Configuration Anti-Patterns Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/SKILL.md Examples of over-configuring nodes versus starting with minimal configurations. ```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 ``` -------------------------------- ### AI Agent Guide Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Retrieve a comprehensive guide for AI-based workflows. ```javascript // Comprehensive AI workflow guide ai_agents_guide() // Returns: Architecture, connections, tools, validation, best practices ``` -------------------------------- ### Weather to Slack Workflow Example Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/README.md This is a template example demonstrating a common workflow pattern. It involves scheduling a task, making an HTTP request to fetch weather data, transforming the data using a 'Set' node, and finally sending the information to Slack. ```plaintext Schedule (daily 8 AM) → HTTP Request (weather) → Set → Slack ``` -------------------------------- ### Start with Manual Trigger Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Workflow pattern for testing agents with mock data. ```text Manual Trigger → Set (mock user input) → AI Agent → Code (log output) ``` -------------------------------- ### Get Tool Documentation Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Access documentation for specific tools or general guides for code nodes. ```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"}) ``` -------------------------------- ### Configure GET Request Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/http_api_integration.md Standard configuration for a GET request with query parameters. ```javascript { method: "GET", url: "https://api.example.com/users", sendQuery: true, queryParameters: { "page": "1", "limit": "100", "filter": "active" } } ``` -------------------------------- ### Deploy Template for Quick Starts Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Utilize `n8n_deploy_template` for quickly setting up new projects or workflows based on predefined templates. ```bash n8n_deploy_template ``` -------------------------------- ### Install Skills for a Workspace Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/README.md Creates a local .agent/skills directory and clones the repository to enable skills for a specific project. ```bash mkdir -p .agent/skills git clone https://github.com/WilkoMarketing/antigravity-n8n-skills.git .agent/skills ``` -------------------------------- ### Example Multiple Start Nodes Warning Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/SKILL.md This JSON structure represents a warning about 'Multiple trigger nodes found', implying only one will execute. ```json { "warning": "Multiple trigger nodes found - only one will execute" } ``` -------------------------------- ### Select AI Model Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Performance-based model selection guide. ```text Fast & cheap: GPT-3.5-turbo, Claude 3 Haiku Balanced: GPT-4, Claude 3 Sonnet Powerful: GPT-4-turbo, Claude 3 Opus ``` -------------------------------- ### Check Version Compatibility Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SEARCH_GUIDE.md These examples demonstrate how to retrieve all available versions for a node and check for breaking changes between specific versions. ```javascript // See all versions get_node({nodeType: "nodes-base.executeWorkflow", mode: "versions"}) ``` ```javascript // Check breaking changes from v1 to v2 get_node({ nodeType: "nodes-base.executeWorkflow", mode: "breaking", fromVersion: "1.0" }) ``` -------------------------------- ### Use IncludeExamples for Real Configurations Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Set `includeExamples: true` when working with configurations to ensure that real-world examples are included for better understanding and testing. ```javascript includeExamples: true ``` -------------------------------- ### Get Slack Node Info (Standard Detail) Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/SKILL.md Retrieves information for the Slack node using the default 'standard' detail level. This is the recommended way to start node configuration. ```javascript get_node({ nodeType: "nodes-base.slack" }); // detail="standard" is the default ``` -------------------------------- ### Install Skills Globally Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/README.md Clones the skills repository into the global Antigravity skills directory for use across all workspaces. ```bash cd ~/.gemini/antigravity/skills git clone https://github.com/WilkoMarketing/antigravity-n8n-skills.git . ``` -------------------------------- ### Common Webhook Scenarios Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-javascript/DATA_ACCESS.md Examples for handling form submissions, JSON APIs, query parameters, and specific headers. ```javascript // Scenario 1: Form submission const formData = $json.body; const name = formData.name; const email = formData.email; // Scenario 2: JSON API webhook const apiPayload = $json.body; const eventType = apiPayload.event; const data = apiPayload.data; // Scenario 3: Query parameters const apiKey = $json.query.api_key; const userId = $json.query.user_id; // Scenario 4: Headers const authorization = $json.headers['authorization']; const signature = $json.headers['x-signature']; ``` -------------------------------- ### IF Node Condition Examples Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/SKILL.md Demonstrates binary string comparison and unary empty checks for the IF node. ```javascript { "conditions": { "string": [ { "value1": "={{$json.status}}", "operation": "equals", "value2": "active" // Binary: needs value2 } ] } } ``` ```javascript { "conditions": { "string": [ { "value1": "={{$json.email}}", "operation": "isEmpty", // No value2 - unary operator "singleValue": true // Auto-added by sanitization } ] } } ``` -------------------------------- ### POST /get_node Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SEARCH_GUIDE.md Retrieves detailed information, documentation, or configuration examples for a specific node. ```APIDOC ## POST /get_node ### Description Fetches metadata, documentation, or configuration details for a specific nodeType. Supports various modes like standard, docs, versions, and search_properties. ### Method POST ### Endpoint /get_node ### Parameters #### Request Body - **nodeType** (string) - Required - The identifier of the node. - **mode** (string) - Optional - The operation mode (e.g., "standard", "docs", "versions", "search_properties"). - **includeExamples** (boolean) - Optional - Whether to include real-world configuration examples. - **propertyQuery** (string) - Optional - Used with search_properties mode to find specific fields. - **fromVersion** (string) - Optional - Used with breaking mode to check version changes. ### Request Example { "nodeType": "nodes-base.slack", "includeExamples": true } ### Response #### Success Response (200) - **data** (object) - Returns node operations, documentation, or configuration examples based on the requested mode. ``` -------------------------------- ### Operation Context Management Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/SKILL.md Examples showing how changing operations requires updating node configuration fields. ```javascript // Same config for all Slack operations { "resource": "message", "operation": "post", "channel": "#general", "text": "..." } // Then switching operation without updating config { "resource": "message", "operation": "update", // Changed "channel": "#general", // Wrong field for update! "text": "..." } ``` ```javascript // Check requirements when changing operation get_node({ nodeType: "nodes-base.slack" }); // See what update operation needs (messageId, not channel) ``` -------------------------------- ### Define Tool Descriptions Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Example of why clear tool descriptions are necessary. ```text description: "Get data" // AI won't know when to use this ``` -------------------------------- ### Complete validation workflow example Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/VALIDATION_GUIDE.md A multi-step process for validating node requirements, configuring nodes, and 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 }); ``` -------------------------------- ### OpenAI Chat Model Configuration Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Example configuration for an OpenAI chat model, specifying the model name, temperature, and maximum tokens. ```javascript { model: "gpt-4", temperature: 0.7, maxTokens: 1000 } ``` -------------------------------- ### Simple Chatbot Workflow Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md A basic chatbot setup using a webhook, an AI agent with memory, and a webhook response. ```text Webhook → AI Agent (GPT-4 + Memory) → Webhook Response ``` -------------------------------- ### Conditional Fields Missing Error Example Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/ERROR_CATALOG.md Shows how to handle required fields that depend on other configuration settings. ```json { "type": "missing_required", "property": "body", "message": "Request body is required when sendBody is true", "node": "HTTP Request", "path": "parameters.body" } ``` ```javascript { "method": "POST", "url": "https://api.example.com/create", "sendBody": true // Missing: body (required when sendBody=true) } ``` ```javascript { "method": "POST", "url": "https://api.example.com/create", "sendBody": true, "body": { "contentType": "json", "content": { "name": "John", "email": "john@example.com" } } // ✅ Added conditional required field } ``` -------------------------------- ### Invalid Channel Format Error Example Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/ERROR_CATALOG.md Illustrates the fix for an invalid channel format error. ```json { "type": "invalid_value", "property": "channel", "message": "Channel name must start with # and be lowercase (e.g., #general)", "current": "General" } ``` ```javascript { "resource": "message", "operation": "post", "channel": "General" // ❌ Wrong format } ``` ```javascript { "resource": "message", "operation": "post", "channel": "#general" // ✅ Correct format } ``` -------------------------------- ### Iterative validation loop example Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/VALIDATION_GUIDE.md Demonstrates the cycle of configuring a node, validating, and fixing errors until the configuration is valid. ```javascript // Iteration 1 let config = { resource: "channel", operation: "create" }; const result1 = validate_node({ nodeType: "nodes-base.slack", config, profile: "runtime" }); // → Error: Missing "name" // Iteration 2 (~58s later) config.name = "general"; const result2 = validate_node({ nodeType: "nodes-base.slack", config, profile: "runtime" }); // → Valid! ``` -------------------------------- ### SQL for Read-Only Database User Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Example SQL commands to create a read-only user for AI tools accessing a database. Grant only SELECT privileges. ```sql CREATE USER ai_readonly WITH PASSWORD 'secure_password'; GRANT SELECT ON customers, orders TO ai_readonly; -- NO INSERT, UPDATE, DELETE access ``` -------------------------------- ### Cron Expression Examples Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/scheduled_tasks.md Illustrative cron expressions for various scheduling scenarios, including intervals, specific times, and ranges. ```text 0 */6 * * * Every 6 hours ``` ```text 0 9,17 * * * At 9 AM and 5 PM daily ``` ```text 0 0 * * 0 Every Sunday at midnight ``` ```text */30 * * * * Every 30 minutes ``` ```text 0 0 1,15 * * 1st and 15th of each month ``` -------------------------------- ### HTTP Request Node Method-Dependent Fields Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/SKILL.md Illustrates how fields in the HTTP Request node change based on the HTTP method. For example, 'sendBody' and 'body' are relevant for POST requests but not GET. ```javascript // When method='GET' { "method": "GET", "url": "https://api.example.com" // sendBody not shown (GET doesn't have body) } // When method='POST' { "method": "POST", "url": "https://api.example.com", "sendBody": true, // Now visible! "body": { // Required when sendBody=true "contentType": "json", "content": {...} } } ``` -------------------------------- ### Common Workflow: Search, Get Node, Validate Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SEARCH_GUIDE.md The most common pattern for using n8n nodes involves searching for a node by keyword, retrieving its configuration details (including examples), and then validating the configuration before incorporating it into a workflow. This sequence ensures that the node is discoverable, well-understood, and correctly configured. ```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" }) ``` -------------------------------- ### Best Practice: Check Dependencies Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/DEPENDENCIES.md When encountering configuration issues, use `get_node` with `mode: 'search_properties'` to inspect field dependencies and visibility rules. ```javascript get_node({nodeType: "...", mode: "search_properties", propertyQuery: "..."}); ``` -------------------------------- ### GET /n8n_executions (Get Details) Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/WORKFLOW_GUIDE.md Retrieves detailed information or a summary of a specific workflow execution. ```APIDOC ## GET /n8n_executions ### Description Retrieves details for a specific execution ID. ### Parameters #### Request Body - **action** (string) - Required - Must be "get" - **id** (string) - Required - The execution ID - **mode** (string) - Optional - The detail level: preview, summary, filtered, full, or error - **includeStackTrace** (boolean) - Optional - Include stack trace if mode is error ### Request Example { "action": "get", "id": "execution-id", "mode": "summary" } ``` -------------------------------- ### Configure HTTP GET Request Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/OPERATION_PATTERNS.md Patterns for performing GET requests, including basic usage, query parameters, and authentication. ```json { "method": "GET", "url": "https://api.example.com/users", "authentication": "none" } ``` ```json { "method": "GET", "url": "https://api.example.com/users", "authentication": "none", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "limit", "value": "100" }, { "name": "offset", "value": "={{$json.offset}}" } ] } } ``` ```json { "method": "GET", "url": "https://api.example.com/users", "authentication": "predefinedCredentialType", "nodeCredentialType": "httpHeaderAuth" } ``` -------------------------------- ### Get Node Information (Standard Detail) Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SEARCH_GUIDE.md Use `get_node` with `detail="standard"` (the default) when you need comprehensive configuration details for a node. Set `includeExamples: true` to retrieve real template configurations. ```javascript get_node({ nodeType: "nodes-base.slack", // Required: SHORT prefix format includeExamples: true // Optional: get real template configs }) // detail="standard" is the default ``` -------------------------------- ### Use Smart Parameters for Clarity Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Employ smart parameters like `branch` and `case` to enhance the clarity and readability of your node configurations. ```javascript branch="true" ``` ```javascript case=0 ``` -------------------------------- ### Get Specific Workflow Version Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/WORKFLOW_GUIDE.md Fetch details of a particular workflow version by its `versionId` using `n8n_workflow_versions` with `mode: 'get'`. ```javascript n8n_workflow_versions({ mode: "get", versionId: 123 }) ``` -------------------------------- ### Get First Item - _input.first() Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-python/DATA_ACCESS.md Use `_input.first()` to retrieve only the first item from the previous node. This is useful for single-item operations, processing API responses, or getting an initial data point. ```python # Get first item from previous node first_item = _input.first() # Access the JSON data data = first_item["json"] print(f"First item: {data}") return [{"json": data}] ``` ```python # Get API response (typically single object) response = _input.first()["json"] # Extract what you need return [{ "json": { "user_id": response.get("data", {}).get("user", {}).get("id"), "user_name": response.get("data", {}).get("user", {}).get("name"), "status": response.get("status"), "fetched_at": datetime.now().isoformat() } }] ``` ```python data = _input.first()["json"] # Transform structure return [{ "json": { "id": data.get("id"), "contact": { "email": data.get("email"), "phone": data.get("phone") }, "address": { "street": data.get("street"), "city": data.get("city"), "zip": data.get("zip") } } }] ``` ```python item = _input.first()["json"] ``` -------------------------------- ### Configure Database Node as AI Tool Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Set up a database node (e.g., Postgres) as an AI tool. Define metadata and SQL query parameters. Ensure a read-only database user for security. ```javascript { // Tool metadata name: "query_customers", description: "Query customer database. Use SELECT queries to find customer information by email, name, or ID.", // Postgres config operation: "executeQuery", query: "={{$json.sql}}", // AI provides SQL // Security: Use read-only database user! } ``` -------------------------------- ### GET /n8n_executions (List) Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/WORKFLOW_GUIDE.md Lists workflow executions based on filters. ```APIDOC ## GET /n8n_executions ### Description Lists executions for a specific workflow. ### Parameters #### Request Body - **action** (string) - Required - Must be "list" - **workflowId** (string) - Required - The ID of the workflow - **status** (string) - Optional - Filter by status: success, error, waiting - **limit** (number) - Optional - Maximum number of results ### Request Example { "action": "list", "workflowId": "workflow-id", "status": "error", "limit": 100 } ``` -------------------------------- ### Configuration Discovery Workflow in n8n Source: https://context7.com/wilkomarketing/antigravity-n8n-skills/llms.txt Outlines a three-step process to discover node configurations using `get_node`, starting with standard detail and progressively requesting more information if needed. ```javascript // CONFIGURATION DISCOVERY WORKFLOW // Step 1: Get node info (standard detail default) get_node({nodeType: "nodes-base.httpRequest"}) // Step 2: If stuck on specific field, search for it get_node({ nodeType: "nodes-base.httpRequest", mode: "search_properties", propertyQuery: "body" }) // Step 3: Only if needed, get full schema get_node({ nodeType: "nodes-base.httpRequest", detail: "full" // 3-8K tokens, use sparingly }) ``` -------------------------------- ### Importing Python Standard Library Modules Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-python/STANDARD_LIBRARY.md Demonstrates which modules are available and which external packages are unsupported in n8n. ```python # ❌ NOT AVAILABLE - Will cause ModuleNotFoundError import requests # No HTTP library! import pandas # No data analysis! import numpy # No numerical computing! import bs4 # No web scraping! import selenium # No browser automation! import psycopg2 # No database drivers! import pymongo # No MongoDB! import sqlalchemy # No ORMs! # ✅ AVAILABLE - Standard library only import json import datetime import re import base64 import hashlib import urllib.parse import urllib.request import math import random import statistics ``` -------------------------------- ### Credential Management Best Practices Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/FALSE_POSITIVES.md Demonstrates the difference between insecure hardcoded credentials and the recommended n8n credential system. ```javascript // BAD: Real API key in workflow { "headers": { "Authorization": "Bearer sk_live_abc123..." } // ❌ NEVER hardcode real credentials! } // GOOD: Use credentials system { "authentication": "headerAuth", "credentials": { "headerAuth": { "id": "credential-id", "name": "My API Key" } } } ``` -------------------------------- ### Basic Switch Node Configuration Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/OPERATION_PATTERNS.md Set up a basic Switch node with multiple rules. Ensure the number of rules matches the number of available outputs. A 'fallbackOutput' can be specified for non-matching cases. ```json { "mode": "rules", "rules": { "rules": [ { "conditions": { "string": [ { "value1": "={{$json.status}}", "operation": "equals", "value2": "active" } ] } }, { "conditions": { "string": [ { "value1": "={{$json.status}}", "operation": "equals", "value2": "pending" } ] } } ] }, "fallbackOutput": "extra" // Catch-all for non-matching } ``` -------------------------------- ### Resolve missing_required error Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/SKILL.md Example of identifying and fixing a missing required property error. ```javascript // Error { "type": "missing_required", "property": "channel", "message": "Channel name is required" } // Fix config.channel = "#general"; ``` -------------------------------- ### Validation Best Practices Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/SKILL.md Ensuring configurations are validated before deployment. ```javascript // Configure and deploy without validating const config = {...}; n8n_update_partial_workflow({...}); // YOLO ``` ```javascript // Validate before deploying const config = {...}; const result = validate_node({...}); if (result.valid) { n8n_update_partial_workflow({...}); } ``` -------------------------------- ### Add Timestamp to Each Item Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-python/SKILL.md Example of processing a single item in 'Run Once for Each Item' mode. ```python # Example: Add processing timestamp to each item item = _input.item return [{ "json": { **item["json"], "processed": True, "processed_at": datetime.now().isoformat() } }] ``` -------------------------------- ### Common Workflow Steps Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Follow this sequence for building and managing workflows: search nodes, get node details, validate the node, create the workflow, verify it, update partially, and finally activate. ```text search_nodes → find node get_node → understand config validate_node → check config n8n_create_workflow → build n8n_validate_workflow → verify n8n_update_partial_workflow → iterate activateWorkflow → go live! ``` -------------------------------- ### Common Input Access Patterns Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-python/DATA_ACCESS.md Examples of common data access scenarios in n8n. ```python sum(i["json"].get("amount", 0) for i in items) ``` ```python _input.first()["json"].get("data") ``` ```python _input.item["json"] ``` ```python _node["API"]["json"] ``` ```python [i for i in items if i["json"].get("active")] ``` ```python {**_input.first()["json"], "new": True} ``` ```python _input.first()["json"]["body"] ``` -------------------------------- ### HTTP Request Configuration Flow Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/DEPENDENCIES.md Demonstrates the sequential dependency chain required to enable and configure a POST request body. ```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! ``` -------------------------------- ### Validate Webhook Data Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/webhook_processing.md Example condition for an IF node to verify required fields in the webhook body. ```javascript // IF node condition {{$json.body.email}} is not empty AND {{$json.body.name}} is not empty ``` -------------------------------- ### Configure Retry Logic Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/ERROR_CATALOG.md Example warning for missing retry logic in external API calls. ```json { "type": "best_practice", "property": "retryOnFail", "message": "External API calls should retry on failure", "suggestion": "Add retryOnFail: true, maxTries: 3, waitBetweenTries: 1000" } ``` -------------------------------- ### Python Beta vs Native Execution Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-python/SKILL.md Comparison of syntax and helper availability between Python Beta and Native modes. ```python # Python (Beta) example items = _input.all() now = _now # Built-in datetime object return [{ "json": { "count": len(items), "timestamp": now.isoformat() } }] ``` ```python # Python (Native) example processed = [] for item in _items: processed.append({ "json": { "id": item["json"].get("id"), "processed": True } }) return processed ``` -------------------------------- ### Invalid HTTP Method Error Example Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/ERROR_CATALOG.md Shows how to resolve an invalid HTTP method error. ```json { "type": "invalid_value", "property": "method", "message": "Method must be one of: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS", "current": "FETCH", "allowed": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"] } ``` ```javascript { "method": "FETCH", // ❌ Invalid "url": "https://api.example.com" } ``` ```javascript { "method": "GET", // ✅ Use valid HTTP method "url": "https://api.example.com" } ``` -------------------------------- ### Known n8n Issue Warnings Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/FALSE_POSITIVES.md Examples of common false-positive warnings encountered in n8n workflows. ```json { "type": "metadata_incomplete", "message": "IF node missing conditions.options metadata", "node": "IF" } ``` ```json { "type": "configuration_mismatch", "message": "Switch has 3 rules but 4 output connections", "node": "Switch" } ``` ```json { "type": "credentials_invalid", "message": "Cannot validate credentials without execution context" } ``` -------------------------------- ### Example validation response structure Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/VALIDATION_GUIDE.md The structure of a validation response containing errors, warnings, and a summary. ```javascript { "nodeType": "nodes-base.slack", "workflowNodeType": "n8n-nodes-base.slack", "displayName": "Slack", "valid": false, "errors": [ { "type": "missing_required", "property": "name", "message": "Channel name is required", "fix": "Provide a channel name (lowercase, no spaces, 1-80 characters)" } ], "warnings": [ { "type": "best_practice", "property": "errorHandling", "message": "Slack API can have rate limits", "suggestion": "Add onError: 'continueRegularOutput' with retryOnFail" } ], "suggestions": [], "summary": { "hasErrors": true, "errorCount": 1, "warningCount": 1, "suggestionCount": 0 } } ``` -------------------------------- ### Unmatched Expression Bracket Errors Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-javascript/ERROR_PATTERNS.md Examples of syntax errors involving quotes and brackets, and their corrections. ```javascript // ❌ WRONG: Unescaped quote in string const message = "It's a nice day"; // Single quote breaks string ``` ```javascript // ❌ WRONG: Unbalanced brackets in regex const pattern = /\{(\w+)\}/; // JSON storage issue ``` ```javascript // ❌ WRONG: Multi-line string with quotes const html = "

Hello

"; // Quote balance issues ``` ```javascript // ✅ CORRECT: Escape quotes const message = "It\'s a nice day"; // Or use different quotes const message = "It's a nice day"; // Double quotes work ``` ```javascript // ✅ CORRECT: Escape regex properly const pattern = /\\{(\\w+)\\}/; ``` ```javascript // ✅ CORRECT: Template literals for multi-line const html = `

Hello

`; // Backticks handle multi-line and quotes ``` ```javascript // ✅ CORRECT: Escape backslashes const path = "C:\\\\Users\\\\Documents\\\\file.txt"; ``` -------------------------------- ### Invalid Operation Value Error Example Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/ERROR_CATALOG.md Demonstrates an invalid operation value error and the correct configuration. ```json { "type": "invalid_value", "property": "operation", "message": "Operation must be one of: post, update, delete, get", "current": "send", "allowed": ["post", "update", "delete", "get"] } ``` ```javascript { "resource": "message", "operation": "send" // ❌ Invalid - should be "post" } ``` ```javascript { "resource": "message", "operation": "post" // ✅ Use valid operation } ``` -------------------------------- ### Format Dates Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-javascript/BUILTIN_FUNCTIONS.md Demonstrates various output formats including ISO, SQL, HTTP, and custom string patterns. ```javascript const now = DateTime.now(); return [{ json: { isoFormat: now.toISO(), // ISO 8601: "2025-01-20T15:30:00.000Z" sqlFormat: now.toSQL(), // SQL: "2025-01-20 15:30:00.000" httpFormat: now.toHTTP(), // HTTP: "Mon, 20 Jan 2025 15:30:00 GMT" // Custom formats dateOnly: now.toFormat('yyyy-MM-dd'), // "2025-01-20" timeOnly: now.toFormat('HH:mm:ss'), // "15:30:00" readable: now.toFormat('MMMM dd, yyyy'), // "January 20, 2025" compact: now.toFormat('yyyyMMdd'), // "20250120" withDay: now.toFormat('EEEE, MMMM dd, yyyy'), // "Monday, January 20, 2025" custom: now.toFormat('dd/MM/yy HH:mm') // "20/01/25 15:30" } }]; ``` -------------------------------- ### Schedule Daily at Specific Time (Minimal) Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/OPERATION_PATTERNS.md Configure a rule to run a task daily at a specific hour and minute. Always set the timezone explicitly to avoid unexpected behavior. ```javascript { "rule": { "interval": [ { "field": "hours", "hoursInterval": 24 } ], "hour": 9, "minute": 0, "timezone": "America/New_York" } } ``` -------------------------------- ### Use Smart Parameters for Node Connections Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Employ smart parameters like 'branch' and 'case' for clearer and more readable node connections, especially for multi-output nodes like IF and Switch. ```javascript // IF node connection { type: "addConnection", source: "IF", target: "Handler", sourceIndex: 0 // Which output? Hard to remember! } ``` ```javascript // IF node - semantic branch names { type: "addConnection", source: "IF", target: "True Handler", branch: "true" // Clear and readable! } ``` ```javascript { type: "addConnection", source: "IF", target: "False Handler", branch: "false" } ``` ```javascript // Switch node - semantic case numbers { type: "addConnection", source: "Switch", target: "Handler A", case: 0 } ``` -------------------------------- ### Using Environment Variables for Paths in n8n Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/webhook_processing.md Demonstrates the correct practice of using environment variables for dynamic paths, such as webhook prefixes, to manage different environments (dev/prod). ```javascript {{$env.WEBHOOK_PATH_PREFIX}}/form-submit ``` -------------------------------- ### Resolve invalid_value error Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/SKILL.md Example of identifying and fixing an invalid value error by updating to an allowed option. ```javascript // Error { "type": "invalid_value", "property": "operation", "message": "Operation must be one of: post, update, delete", "current": "send" } // Fix config.operation = "post"; // Use valid operation ``` -------------------------------- ### Connect Tools Correctly Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Comparison of incorrect and correct tool connection methods in n8n. ```text 1. ❌ Wrong: Connecting tools to main port HTTP Request → AI Agent // Won't work as tool! 2. ✅ Correct: Use ai_tool connection type HTTP Request --[ai_tool]--> AI Agent ``` -------------------------------- ### Define best_practice warning structure Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/SKILL.md Example of a validation warning object suggesting a best practice improvement. ```json { "type": "best_practice", "property": "errorHandling", "message": "Slack API can have rate limits", "suggestion": "Add onError: 'continueRegularOutput' with retryOnFail" } ``` -------------------------------- ### Define missing_required error structure Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-validation-expert/SKILL.md Example of a validation error object indicating a missing required property. ```json { "type": "missing_required", "property": "channel", "message": "Channel name is required", "fix": "Provide a channel name (lowercase, no spaces, 1-80 characters)" } ``` -------------------------------- ### Clean Stale Connections in n8n Source: https://context7.com/wilkomarketing/antigravity-n8n-skills/llms.txt Provides an example of using `n8n_update_partial_workflow` with the `cleanStaleConnections` operation as a recovery strategy. ```javascript // CLEAN STALE CONNECTIONS (recovery strategy) n8n_update_partial_workflow({ id: "workflow-id", operations: [{type: "cleanStaleConnections"}] }) ``` -------------------------------- ### Implement Async Tools Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-workflow-patterns/ai_agent_workflow.md Workflow pattern for handling slow tool operations without blocking the response. ```text AI Agent → [Queue slow tool request] → Return immediate response → [Background: Execute tool + notify when done] ``` -------------------------------- ### Optimizing `get_node` Detail Level in n8n Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Explains the performance implications of `detail: "full"` versus the default `detail: "standard"` for `get_node` and suggests alternatives for specific needs. ```javascript // WRONG - Returns 3-8K tokens, use sparingly get_node({nodeType: "nodes-base.slack", detail: "full"}) // CORRECT - Returns 1-2K tokens, covers 95% of use cases get_node({nodeType: "nodes-base.slack"}) // detail="standard" is default get_node({nodeType: "nodes-base.slack", detail: "standard"}) ``` ```javascript 1. `get_node({detail: "standard"})` - for operations list (default) 2. `get_node({mode: "docs"})` - for readable documentation 3. `get_node({mode: "search_properties", propertyQuery: "auth"})` - for specific property ``` -------------------------------- ### Calculate Total from All Items Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-python/SKILL.md Example of aggregating data across all input items in 'Run Once for All Items' mode. ```python # Example: Calculate total from all items all_items = _input.all() total = sum(item["json"].get("amount", 0) for item in all_items) return [{ "json": { "total": total, "count": len(all_items), "average": total / len(all_items) if all_items else 0 } }] ``` -------------------------------- ### Incorrect Code Node Return Patterns Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-javascript/ERROR_PATTERNS.md Examples of invalid return structures that fail n8n validation. ```javascript // ❌ WRONG: Returning object instead of array return { json: { result: 'success' } }; // Missing array wrapper [] ``` ```javascript // ❌ WRONG: Returning array without json wrapper return [ {id: 1, name: 'Alice'}, {id: 2, name: 'Bob'} ]; // Missing json property ``` ```javascript // ❌ WRONG: Returning plain value return "processed"; ``` ```javascript // ❌ WRONG: Returning items without mapping return $input.all(); // Works if items already have json property, but not guaranteed ``` ```javascript // ❌ WRONG: Incomplete structure return [{data: {result: 'success'}}]; // Should be {json: {...}}, not {data: {...}} ``` -------------------------------- ### Deploy Template Directly Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Deploy a template to an n8n instance with optional configuration for naming and version management. ```javascript // Deploy template to your n8n instance n8n_deploy_template({ templateId: 2947, name: "My Weather to Slack", // Custom name (optional) autoFix: true, // Auto-fix common issues (default) autoUpgradeVersions: true // Upgrade node versions (default) }); // Returns: workflow ID, required credentials, fixes applied ``` -------------------------------- ### Workflow Template Expressions Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-expression-syntax/EXAMPLES.md Examples of referencing webhook data and other node outputs in a real-world workflow context. ```json { "body": { "text": "London" } } ``` ```text https://nominatim.openstreetmap.org/search?q={{$json.body.text}}&format=json ``` ```text https://api.weather.gov/points/{{$node["OpenStreetMap"].json[0].lat}},{{$node["OpenStreetMap"].json[0].lon}} ``` ```text Weather for {{$json.body.text}}: Temperature: {{$node["Weather API"].json.properties.temperature.value}}°C Conditions: {{$node["Weather API"].json.properties.shortForecast}} ``` -------------------------------- ### Get Emails Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-node-configuration/OPERATION_PATTERNS.md Retrieve emails using the Gmail node. Can fetch all emails or a limited number with specific filters. ```javascript { "resource": "message", "operation": "getAll", "returnAll": false, "limit": 10 } ``` ```javascript { "resource": "message", "operation": "getAll", "returnAll": false, "limit": 50, "filters": { "q": "is:unread from:important@example.com", "labelIds": ["INBOX"] } } ``` -------------------------------- ### Get Template Details Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-mcp-tools-expert/SKILL.md Retrieve specific template details by ID, choosing between structure-only or full workflow JSON. ```javascript get_template({ templateId: 2947, mode: "structure" // nodes+connections only }); get_template({ templateId: 2947, mode: "full" // complete workflow JSON }); ``` -------------------------------- ### Python: Standard Library - Date/Time Operations Source: https://github.com/wilkomarketing/antigravity-n8n-skills/blob/main/n8n-code-python/SKILL.md Demonstrates how to get the current date and time using `datetime.now()`, add time deltas using `timedelta`, and format dates into strings with `strftime()`. ```python # Date/time from datetime import datetime, timedelta now = datetime.now() tomorrow = now + timedelta(days=1) formatted = now.strftime("%Y-%m-%d") ```