Searchable Directory API using Data Tables and Webhooks - n8n Workflow

Create a robust, searchable directory API using an n8n workflow and Data Tables. Easily retrieve curated YouTube educational content by topic using custom keyword matching.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users needing a custom, low-latency API without external databases like Postgres or MySQL.

  • Developers creating internal knowledge base tools or resource directories.

  • Anyone seeking advanced examples of using the n8n Data Table node for lookup and storage.

  • Automation specialists looking for reusable n8n templates for data management.

Overview

This n8n workflow serves a dual purpose: first, it provides a simple mechanism for initializing a database (the Data Table) with source data; second, it establishes a powerful search API endpoint via a Webhook. By running this n8n template, you can quickly deploy a self-hosted directory capable of matching user search terms to relevant data entries. The core value lies in using the built-in n8n Data Table node for fast storage and retrieval, combined with custom JavaScript logic to preprocess search queries. This makes the overall n8n workflow highly efficient for serving specific resource lookups, demonstrating sophisticated use of core n8n features.

How it Works

The n8n workflow operates in two distinct logical branches:

1. Database Initialization (One-Time Setup)


  1. Manual Start: The automation begins with the When clicking 'Execute workflow' n8n trigger.

  2. Load Data: The Load Video Database Code n8n node contains a hardcoded array of ten educational video records, including metadata like Educator, Difficulty, and Description.

  3. Iteration: The data is processed through the Loop Over Items n8n node to handle each record individually.

  4. Data Persistence: The Insert row Data Table n8n node stores each video record into the designated n8nEducatorVideos Data Table, populating the database for future searches.

2. Search API (Production)


  1. API Trigger: The Webhook n8n trigger waits for an incoming HTTP POST request containing a topic keyword (e.g., {"topic": "voice"}). This is the main activation n8n trigger for the API.

  2. Keyword Processing: The Process Search Term Code n8n node intercepts the input topic. It standardizes common variations (e.g., maps 'audio' or 'talk' to 'voice', or 'scrape' to 'scraping'). This ensures better matching within the Data Table.

  3. Database Query: The Get row(s) Data Table n8n node performs a filtered query on the n8nEducatorVideos table, looking for records where the Description column likes the processed search term.

  4. Format Results: The Set Message n8n node takes the results from the Data Table and formats them into a clean, markdown-style message string, incorporating video titles, links, and descriptions.

  5. Respond: The Respond to Webhook n8n node sends the formatted message back to the requesting client immediately, completing the API interaction.

Installation Guide

To deploy this powerful n8n workflow using these n8n templates, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance.

  2. Data Table Setup: Before running, you must create an n8n Data Table named n8nEducatorVideos. This table must contain the following columns (case-sensitive):

Educator
video_title
Difficulty
YouTubeLink
* Description

  1. Initialize Database: Locate the bottom branch (starting with the Manual Trigger) and click 'Execute workflow' on the When clicking 'Execute workflow' n8n trigger. This runs the Load Video Database and populates your Data Table.

  2. Activate and Test: Activate the entire n8n workflow. Copy the Production URL displayed in the Webhook n8n node.

  3. Testing: Use a tool like Postman to send a POST request to the Webhook URL with a body similar to {"topic": "voice"} or {"topic": "scraping"}.

Node Details

Webhook (n8n trigger): Serves as the public API entry point. It listens for POST requests containing the search term (topic). Key setting: HTTP Method is POST.
Process Search Term (Code n8n node): A custom code n8n node that cleans and normalizes the input topic to enhance search relevance. It simplifies keyword variants (e.g., 'talk' becomes 'voice').
Get row(s) (Data Table n8n node): Executes the core search functionality. It uses a like condition filter on the 'Description' column, matching the normalized search topic against the stored video descriptions.
Set Message (Set n8n node): Essential for output formatting. This n8n node uses expressions to compile the retrieved data (titles, links, difficulty) into a single, structured string ready for the final API response.
Respond to Webhook (n8n node): Transmits the formatted search results back to the client, providing the outcome of the n8n workflow.
Load Video Database (Code n8n node): Contains the static data used for initialization. This n8n node generates ten items that represent the video records to be inserted.


  • Insert row (Data Table n8n node): Used exclusively in the initialization phase to write the video records loaded by the Code n8n node into the Data Table.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
David Olusola
David Olusola

I design enterprise-grade automation systems that eliminate bottlenecks, cut manual work by 70%+, and unlock millions in lost revenue opportunities. My clients — typically achieve 5–10x ROI within the first 90 days. Currently partnering with select high-growth companies ready to scale faster with AI automation. [email protected]

Featured*