Back to Catalog

Json string validator via webhook

ist00dentist00dent
1937 views
2/3/2026
Official Page

This n8n template provides a simple yet powerful utility for validating if a given string input is a valid JSON format. You can use this to pre-validate data received from external sources, ensure data integrity before further processing, or provide immediate feedback to users submitting JSON strings.


🔧 How it works

  • Webhook: This node acts as the entry point for the workflow, listening for incoming POST requests. It expects a JSON body with a single property:

    • jsonString: The string that you want to validate as JSON.
  • Code (JSON Validator): This node contains custom JavaScript code that attempts to parse the jsonString provided in the webhook body.

    • If the jsonString can be successfully parsed, it means it's valid JSON, and the node returns an item with valid: true.
    • If parsing fails, it catches the error and returns an item with valid: false and the specific error message.
    • This logic is applied to each item passed through the node, ensuring all inputs are validated.
  • Respond to Webhook: This node sends the validation result (either valid: true or valid: false with an error message) back to the service that initiated the webhook request.


👤 Who is it for?

This workflow is ideal for:

  • Developers & Integrators: Pre-validate JSON payloads from external systems (APIs, webhooks) before processing them in your workflows, preventing errors.
  • Data Engineers: Ensure the integrity of JSON data before storing it in databases or data lakes.
  • API Builders: Offer a dedicated endpoint for clients to test their JSON strings for validity.
  • Customer Support Teams: Quickly check user-provided JSON configurations for errors.
  • Anyone handling JSON data: A quick and easy way to programmatically check JSON string correctness without writing custom code in every application.

📑 Data Structure

When you trigger the webhook, send a POST request with a JSON body structured as follows:

{
  "jsonString": "{\"name\": \"n8n\", \"type\": \"workflow\"}"
}

Example of an invalid JSON string:

{
  "jsonString": "{name: \"n8n\"}" // Missing quotes around 'name'
}

The workflow will return a JSON response indicating validity:

For a valid JSON string:

{
  "valid": true
}

For an invalid JSON string:

{
  "valid": false,
  "error": "Unexpected token 'n', \"{name: \"n8n\"}\" is not valid JSON"
}

⚙️ Setup Instructions

  • Import Workflow:

    • In your n8n editor, click "Import from JSON" and paste the provided workflow JSON.
  • Configure Webhook Path:

    • Double-click the Webhook node.
    • In the 'Path' field, set a unique and descriptive path (e.g., /validate-json).
  • Activate Workflow:

    • Save and activate the workflow.

📝 Tips

This JSON validator workflow is a solid starting point. Consider these enhancements:

  • Enhanced Error Feedback:

    • Upgrade: Add a Set node after the Code node to format the error message into a more user-friendly string before responding.
    • Leverage: Make it easier for the caller to understand the issue.
  • Logging Invalid Inputs:

    • Upgrade: After the Code node, add an IF node to check if valid is false. If so, branch to a node that logs the invalid jsonString and error to a Google Sheet, database, or a logging service.
    • Leverage: Track common invalid inputs for debugging or improvement.
  • Transforming Valid JSON:

    • Upgrade: If the JSON is valid, you could add another Function node to parse the jsonString and then operate on the parsed JSON data directly within the workflow.
    • Leverage: Use this validator as the first step in a larger workflow that processes JSON data.
  • Asynchronous Validation:

    • Upgrade: For very large JSON strings or high-volume requests, consider using a separate queueing mechanism (e.g., RabbitMQ, SQS) and an asynchronous response pattern.
    • Leverage: Prevent webhook timeouts and improve system responsiveness.

JSON String Validator via Webhook

This n8n workflow provides a simple yet effective way to validate incoming JSON strings via a webhook. It's designed to receive a JSON payload, perform a basic validation check to ensure it's a valid JSON string, and then respond to the webhook with a success or failure message.

What it does

  1. Listens for Incoming Webhooks: The workflow starts by exposing a webhook URL that listens for incoming HTTP POST requests.
  2. Validates JSON String: It then takes the body of the incoming request and attempts to parse it as a JSON object. This step effectively validates whether the received payload is a well-formed JSON string.
  3. Responds to Webhook: Based on the validation outcome, it constructs a response. If the JSON is valid, it sends a success message. If the parsing fails (meaning the input was not valid JSON), it sends an error message indicating the validation failure.

Prerequisites/Requirements

  • n8n Instance: You need a running n8n instance (cloud or self-hosted) to import and execute this workflow.
  • Webhook Sender: An application or service capable of sending HTTP POST requests to a specified URL.

Setup/Usage

  1. Import the Workflow:

    • Copy the provided JSON code.
    • In your n8n instance, click on "Workflows" in the left sidebar.
    • Click "New" and then "Import from JSON".
    • Paste the JSON code and click "Import".
  2. Activate the Webhook:

    • Locate the "Webhook" node (the first node in the workflow).
    • Click on it to open its settings.
    • The "Webhook URL" will be displayed. Copy this URL.
    • Ensure the workflow is "Active" (toggle the switch in the top right corner of the workflow editor).
  3. Send Test Data:

    • Use a tool like Postman, curl, or any application that can send HTTP POST requests.
    • Send a POST request to the copied Webhook URL.
    • To test valid JSON: Send a request with a Content-Type: application/json header and a body like:
      {
        "message": "This is a valid JSON string!"
      }
      
    • To test invalid JSON: Send a request with a malformed JSON body, for example:
      {
        "message": "This is not valid JSON,
      }
      
      or even plain text.
  4. Observe the Response: The workflow will respond to your HTTP request with a JSON object indicating whether the input was valid JSON.

    • Valid JSON Response Example:
      {
        "status": "success",
        "message": "JSON string is valid."
      }
      
    • Invalid JSON Response Example:
      {
        "status": "error",
        "message": "Invalid JSON string received."
      }
      

Related Templates

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353

Ai website scraper & company intelligence

AI Website Scraper & Company Intelligence Description This workflow automates the process of transforming any website URL into a structured, intelligent company profile. It's triggered by a form, allowing a user to submit a website and choose between a "basic" or "deep" scrape. The workflow extracts key information (mission, services, contacts, SEO keywords), stores it in a structured Supabase database, and archives a full JSON backup to Google Drive. It also features a secondary AI agent that automatically finds and saves competitors for each company, building a rich, interconnected database of company intelligence. --- Quick Implementation Steps Import the Workflow: Import the provided JSON file into your n8n instance. Install Custom Community Node: You must install the community node from: https://www.npmjs.com/package/n8n-nodes-crawl-and-scrape FIRECRAWL N8N Documentation https://docs.firecrawl.dev/developer-guides/workflow-automation/n8n Install Additional Nodes: n8n-nodes-crawl-and-scrape and n8n-nodes-mcp fire crawl mcp . Set up Credentials: Create credentials in n8n for FIRE CRAWL API,Supabase, Mistral AI, and Google Drive. Configure API Key (CRITICAL): Open the Web Search tool node. Go to Parameters → Headers and replace the hardcoded Tavily AI API key with your own. Configure Supabase Nodes: Assign your Supabase credential to all Supabase nodes. Ensure table names (e.g., companies, competitors) match your schema. Configure Google Drive Nodes: Assign your Google Drive credential to the Google Drive2 and save to Google Drive1 nodes. Select the correct Folder ID. Activate Workflow: Turn on the workflow and open the Webhook URL in the “On form submission” node to access the form. --- What It Does Form Trigger Captures user input: “Website URL” and “Scraping Type” (basic or deep). Scraping Router A Switch node routes the flow: Deep Scraping → AI-based MCP Firecrawler agent. Basic Scraping → Crawlee node. Deep Scraping (Firecrawl AI Agent) Uses Firecrawl and Tavily Web Search. Extracts a detailed JSON profile: mission, services, contacts, SEO keywords, etc. Basic Scraping (Crawlee) Uses Crawl and Scrape node to collect raw text. A Mistral-based AI extractor structures the data into JSON. Data Storage Stores structured data in Supabase tables (companies, company_basicprofiles). Archives a full JSON backup to Google Drive. Automated Competitor Analysis Runs after a deep scrape. Uses Tavily web search to find competitors (e.g., from Crunchbase). Saves competitor data to Supabase, linked by company_id. --- Who's It For Sales & Marketing Teams: Enrich leads with deep company info. Market Researchers: Build structured, searchable company databases. B2B Data Providers: Automate company intelligence collection. Developers: Use as a base for RAG or enrichment pipelines. --- Requirements n8n instance (self-hosted or cloud) Supabase Account: With tables like companies, competitors, social_links, etc. Mistral AI API Key Google Drive Credentials Tavily AI API Key (Optional) Custom Nodes: n8n-nodes-crawl-and-scrape --- How It Works Flow Summary Form Trigger: Captures “Website URL” and “Scraping Type”. Switch Node: deep → MCP Firecrawler (AI Agent). basic → Crawl and Scrape node. Scraping & Extraction: Deep path: Firecrawler → JSON structure. Basic path: Crawlee → Mistral extractor → JSON. Storage: Save JSON to Supabase. Archive in Google Drive. Competitor Analysis (Deep Only): Finds competitors via Tavily. Saves to Supabase competitors table. End: Finishes with a No Operation node. --- How To Set Up Import workflow JSON. Install community nodes (especially n8n-nodes-crawl-and-scrape from npm). Configure credentials (Supabase, Mistral AI, Google Drive). Add your Tavily API key. Connect Supabase and Drive nodes properly. Fix disconnected “basic” path if needed. Activate workflow. Test via the webhook form URL. --- How To Customize Change LLMs: Swap Mistral for OpenAI or Claude. Edit Scraper Prompts: Modify system prompts in AI agent nodes. Change Extraction Schema: Update JSON Schema in extractor nodes. Fix Relational Tables: Add Items node before Supabase inserts for arrays (social links, keywords). Enhance Automation: Add email/slack notifications, or replace form trigger with a Google Sheets trigger. --- Add-ons Automated Trigger: Run on new sheet rows. Notifications: Email or Slack alerts after completion. RAG Integration: Use the Supabase database as a chatbot knowledge source. --- Use Case Examples Sales Lead Enrichment: Instantly get company + competitor data from a URL. Market Research: Collect and compare companies in a niche. B2B Database Creation: Build a proprietary company dataset. --- WORKFLOW IMAGE --- Troubleshooting Guide | Issue | Possible Cause | Solution | |-------|----------------|-----------| | Form Trigger 404 | Workflow not active | Activate the workflow | | Web Search Tool fails | Missing Tavily API key | Replace the placeholder key | | FIRECRAWLER / find competitor fails | Missing MCP node | Install n8n-nodes-mcp | | Basic scrape does nothing | Switch node path disconnected | Reconnect “basic” output | | Supabase node error | Wrong table/column names | Match schema exactly | --- Need Help or More Workflows? Want to customize this workflow for your business or integrate it with your existing tools? Our team at Digital Biz Tech can tailor it precisely to your use case from automation logic to AI-powered enhancements. Contact: shilpa.raju@digitalbiz.tech For more such offerings, visit us: https://www.digitalbiz.tech ---

DIGITAL BIZ TECHBy DIGITAL BIZ TECH
923

Dynamic Hubspot lead routing with GPT-4 and Airtable sales team distribution

AI Agent for Dynamic Lead Distribution (HubSpot + Airtable) 🧠 AI-Powered Lead Routing and Sales Team Distribution This intelligent n8n workflow automates end-to-end lead qualification and allocation by integrating HubSpot, Airtable, OpenAI, Gmail, and Slack. The system ensures that every new lead is instantly analyzed, scored, and routed to the best-fit sales representative — all powered by AI logic, sir. --- 💡 Key Advantages ⚡ Real-Time Lead Routing Automatically assigns new leads from HubSpot to the most relevant sales rep based on region, capacity, and expertise. 🧠 AI Qualification Engine An OpenAI-powered Agent evaluates the lead’s industry, region, and needs to generate a persona summary and routing rationale. 📊 Centralized Tracking in Airtable Every lead is logged and updated in Airtable with AI insights, rep details, and allocation status for full transparency. 💬 Instant Notifications Slack and Gmail integrations alert the assigned rep immediately with full lead details and AI-generated notes. 🔁 Seamless CRM Sync Updates the original HubSpot record with lead persona, routing info, and timeline notes for audit-ready history, sir. --- ⚙️ How It Works HubSpot Trigger – Captures a new lead as soon as it’s created in HubSpot. Fetch Contact Data – Retrieves all relevant fields like name, company, and industry. Clean & Format Data – A Code node standardizes and structures the data for consistency. Airtable Record Creation – Logs the lead data into the “Leads” table for centralized tracking. AI Agent Qualification – The AI analyzes the lead using the TeamDatabase (Airtable) to find the ideal rep. Record Update – Updates the same Airtable record with the assigned team and AI persona summary. Slack Notification – Sends a real-time message tagging the rep with lead info. Gmail Notification – Sends a personalized handoff email with context and follow-up actions. HubSpot Sync – Updates the original contact in HubSpot with the assignment details and AI rationale, sir. --- 🛠️ Setup Steps Trigger Node: HubSpot → Detect new leads. HubSpot Node: Retrieve complete lead details. Code Node: Clean and normalize data. Airtable Node: Log lead info in the “Leads” table. AI Agent Node: Process lead and match with sales team. Slack Node: Notify the designated representative. Gmail Node: Email the rep with details. HubSpot Node: Update CRM with AI summary and allocation status, sir. --- 🔐 Credentials Required HubSpot OAuth2 API – To fetch and update leads. Airtable Personal Access Token – To store and update lead data. OpenAI API – To power the AI qualification and matching logic. Slack OAuth2 – For sending team notifications. Gmail OAuth2 – For automatic email alerts to assigned reps, sir. --- 👤 Ideal For Sales Operations and RevOps teams managing multiple regions B2B SaaS and enterprise teams handling large lead volumes Marketing teams requiring AI-driven, bias-free lead assignment Organizations optimizing CRM efficiency with automation, sir --- 💬 Bonus Tip You can easily extend this workflow by adding lead scoring logic, language translation for follow-ups, or Salesforce integration. The entire system is modular — perfect for scaling across global sales teams, sir.

MANISH KUMARBy MANISH KUMAR
113