How to Use n8n Data Tables (Complete Tutorial) β
n8nFreshπ
2025-10-09
Tutorial Overview β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SETUP WORKFLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. Prerequisites β
β β β
β ββββΊ Install required software β
β β β’ Node.js / Python / etc. β
β β β’ Code editor (VS Code, Cursor) β
β β β
β βΌ β
β 2. Configuration β
β β β
β ββββΊ Get API keys / credentials β
β ββββΊ Set environment variables β
β β β
β βΌ β
β 3. Initialize N8N β
β β β
β ββββΊ Run setup commands β
β ββββΊ Verify installation β
β β β
β βΌ β
β 4. Ready to Build! β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββWhat You'll Learn β
- Core concepts explained
- Step-by-step implementation
- Practical examples
Transcript β
[00:00] All right, you're building NA workflows and constantly running into the same annoying problem. You need to store some data and setting up an entirely different database feels like overkill, right? I think we've all been there. You're busy with the workflow. Everything is working fine until you realize you need to store data between executions. Maybe it's tracking records that haven't been processed. Or maybe you want to store reusable prompts. Or maybe you just want some handy lookup table. Or let's say you've got a
[00:30] workflow that gets triggered every time you receive an email. You then extract lead information from that email and you then need to store that data somewhere. So what do most of us do? We end up creating a separate database or maybe something in air table and then we go through the hassle of integrating a database table or air table in our NAN workflow. This is time consuming, complex, and in some cases even includes additional costs. Now, here's the thing. Edit actually includes a built-in
[01:01] solution called data tables, which is something a lot of people aren't aware of. With data tables, you can actually store and manage your data all within N8N. So, there's no need for external databases and complex integrations. So, in this tutorial, you'll learn everything there is to know about data tables. I'll show you how to create them, how to interact with them in your workflows, and a few very fun real world examples. Enough talk. Let's jump into this. If you are using the hosted
[01:32] version of NAN, then you should have access to data tables already. If you're using the free community version, then all you have to do is update to the latest version. At the time of recording, I'm on version 1.114.4, four and I'll show you how to update your NM instance later on in this video. First, let's create a new workflow. Then let's call this one order processing. All right, so for the trigger, let's add the on form submission trigger. Then let's give this a name like order form
[02:04] and then under form elements, let's add our first field, which is the customer name. Then let's add another field. Let's call this one email. And for the type, let's select email. And for the placeholder then let's add another field there. Let's say item. For the element type let's say drop-down. And we'll give a few options like margarita pizza regina and maybe something like a meatlover's pizza. Cool. So we'll make
[02:36] this a required field. Let's add one more item. Let's call this quantity. Let's change this to a number. All right. So when we execute the step, we can go ahead and enter all of these details. So I'll say Leon, Leonest.com. Then let's select the item and let's set the quantity to two pizzas. Let's send this. And now we can see all the information extracted from that form. And now what we need to do is actually persist this data somewhere. So it's at
[03:08] this point where people actually give up. They don't know which node to choose. They have no idea how to connect to a database, so it can feel very overwhelming. Luckily, Inet got us covered. Let's go back to our dashboard. Let's go to data tables and let's create a new table. First, let's give our table a name like pizza orders. Let's create this. And now we can open this table. And now we're in the data tables builder. By default, we get three
[03:38] columns out of the box. a unique ID for each record and both a created and updated timestamp. We can add our own columns by clicking on this add column button. And now we can enter the name office column. I'll call this one customer. But if I add space, it's going to tell me this is an invalid name. So a proper convention is to simply use an uppercase letter to indicate the new word. So let's call this customer name. Then under types, we can select between
[04:08] string, number, boolean, and date, time. Let's leave this on string and add this column. And look at that, we can now see our column. Let's add a few more. So, we've got our email, which is of type string. Let's add another column. Let's call this one item, which is of type string. And finally, I'm just going to click on add column. And let's call this one quantity. And this is of type number. Let's add this column. And that should be it. We now have our customer name, their email address, the item as
[04:41] well as the quantity as a number. We can also add or remove records from this view as well. So we can click on add row. And now for the customer name, we can say John. For the email, we can enter something like John test.com etc. Now, of course, I don't want to manually add the records using this. I want my workflow to automatically take the contents from the form and add it to this table. We can also remove records by selecting the specific record and
[05:12] then clicking on delete. Right now that we have our table, let's have a look at using it in our workflow. So let's go back to our workflow. I'm just going to execute this form again so we can get some data into this workflow. Cool. I'm actually just going to pin this data so that we can reuse this data going forward. Then let's add another node and this time let's search for data table. Now we can see all the available actions. We can delete rows, get rows, we can check if a row exists, if row
[05:42] does not exist. We can insert rows and of course update rows. Let's select insert rows. From the list of tables, let's select pizza orders. And we'll select map each column manually. Then for the customer name, let's grab the customer name field from the form. Let's do the same thing for the email. The same thing for the item. And the same thing for the quantity. Right now watch what happens when we execute this workflow. Let's open our table. We can now see that result. So this is a very
[06:14] simple use case where we could share that form with our clients and once they've populated the form, we will see those records in this table. And of course, after we've processed this order, all we have to do is grab this record and delete it. Alternatively, you could also add another column containing the order status. That way, you can actually create a filter and only filter on orders that haven't been processed. Let's also have a look at setting up global values. Now, typically, this is what you could use variables for, but this is not available on the community
[06:46] version of N8N. So, what we could do is simply create a new table. So let's create a data table. And what I want to do is store a list of system prompts that I can reuse in my agents. So I'll call this table prompts. Let's click on create. Then let's add a column. And let's call this one name. And the type will be string. So let's click on add column. Then let's add another column. This time I'll call it prompt which is also of type string. Now I'm going to
[07:18] add a few records manually. So this one I'll actually call assistant. And now for the prompt, I'll just enter something like you are a friendly AI assistant called John. Of course, this prompt can be as complex as you want it to be. So I added two more for a pirate and a prompt that will only generate emojis. Now, of course, this can actually be really useful if you have a lot of complex prompts that you want to store somewhere and reuse across all of your workflows. Either way, let's open up a new workflow. I'll just call the
[07:49] workflow agent. Then for the first step, let's add our on chat message trigger. And usually you would add your AI agent at this point. Let's also add our chat model. So I'll just use chat open AI. And for the model, let's just go with GPT5 mini. All right. So I'm not going to focus too much on the agent itself, but what we want to do is add a system message. And of course, this is where you would enter the system prompt for your agent. But what if you wanted this prompt to be reusable in other
[08:20] workflows? Well, that is where you would take that prompt, create the record in your data table, and then reuse the value from the data table itself. So, how does that work? Well, let's go back to the canvas. And before we call the agent, let's add another node and let's search for data table. Let's grab get row. Then from the list, let's select our prompts table. And then under conditions, let's add the name which is equals to. And now we can simply grab
[08:52] the name from the left hand side. So this name over here and add it to this. We simply want one record. All right. So let's test this. I'm just going to say hey. And let's have a look at what we got back from get rows. We retrieved the record from our data table and we also got back our prompt. So what we can do now in the agent node is change the source to define below. And for the user prompt we can simply open up the chat message node and grab the chat input.
[09:24] Then for the system message all we have to do now is grab the prompt from our data table which of course resolves into respond like a pirate. And if we test this chat now it say hey our agent responds like a pirate. If we wanted to swap out this prompt for something else, it's really this easy. So, we change this value to another record in the table and open the chat and let's say hey. And now our agent is only responding with emojis. That's how easy
[09:55] it is. And of course, we can access these prompts from any of our workflows. We can also add data tables as tools to our agent. So, let's say we wanted our agent to summarize all our existing orders. Well, first I'm just going to change this from emoji to assistant like so. Then under tool, we can search for data table tool. Then I'm just going to rename this to retrieve orders. Then for the operation, let's change this to get.
[10:26] From the data table, let's select pizza orders. And I'll simply enable return all. Or of course, we can let the agent decide. Maybe let's do that. All right. So before I run this, let's actually add some records to that table. So let's go back to our pizza orders. All right, cool. So we have two orders for Leon and Susan. Now let's open the chat and let's try this out. Let's say, hey, please can you summarize my orders or I did send this and we can see the agent actually
[10:56] called this retrieve orders tool. And let's have a look at what the agent returned. Here's a summary of your orders. I can see you have two orders at the moment. and the total items is three. This is awesome. Let's make our assistant even better. I want my agent to be able to manage and update all of my to-do items. So, what we can do is, of course, go back to data tables. Let's create a new table. Let's call this to-dos. Then, let's add a new column. Let's call this title. And let's add
[11:28] this column. And maybe let's add one more. And we can call this one status. And let's add one more. And this one I'll call category which is also of type string. Now the first thing I want to do in fact I'm just going to add another sticky like so. Then let's change the color to green. And for the text I'll just change this to to-dos. All right. So let's add another tool. Let's search for data tables. Then for the operation we'll select insert. For the table,
[12:01] let's select to-dos. And then for the values to insert, I'll simply let the agent decide. And I'll rename this node to insert to-do. And let's move it into our little green to-do section. Let's add another node. Let's search, of course, for data tables. For the operation, let's select get. For the table, we'll select to-dos. We'll let the agent decide whether it wants to return everything. And I'll just rename the node to get to-dos. Oh, by the way,
[12:33] we can also give the agent a bit more guidance on the insert node. So, just below things like the status, we can add a description and say should be either complete or incomplete. This way, we're giving the agent a fixed list of values that it can use. And for the category, let's say category based on the title, example, food, groceries, entertainment,
[13:03] etc. Okay, let's add another tool. Let's go to our data table tool. Then for operation, let's change this to update. And this will allow our agent to set the status to complete or incomplete. So for the table, let's select to-dos. And we'll let the agent decide on the title and the status and the category. All right, that should actually be it. Oh, and of course, let's rename this note to update to-dos. Let's open the chat. And
[13:34] let's say please create a new to-do called buy bread. Let's send this. And of course, let's see what the agent is doing. We can see it called this insert to-do tool. And the agent is saying done. I've credit your buy bread to-do list. And if we refresh our data table, we can see our to-do. Let's say, please add another to-do for buy dog food. And in fact, add another one called call mom. Let's send this. I am expecting
[14:05] this tool to be called twice, which it is. And if you have a look, it says both of these were created. Let's refresh our table. And yes, we can see the two new items with the suitable categories. By the way, let's clear the chat. and let's say, please could you list all of my to-dos? Let's send this. And hopefully, we'll get back a list of our to-dos, which we do. How cool is that? Hey, please can you update one of the to-dos for me? Um, I already called my mom today. Hopefully, it will call it
[14:38] update soon. And it did, but it also got an error. So, let's see what this error message is about. At least one condition is required on this match section. Let's add a condition. And in order to uniquely identify this record in the database, we'll use the ID column. Remember, we could have multiple items with the exact same title in this database. But this ID column will be unique for each record. Then for the actual value of the ID, we'll let the agent figure this out. Right? So, let's
[15:09] actually go back to the chat. Let's clear this and let's say, hey, please can you update my to-dos? I already called my mom today. So, please set that to-do to complete. Let's send this. And hopefully the update to-do function will be successful, which it is. All right. So, an agent says done. I marked callmon as complete. And when we refresh this page, we can see that call mom was indeed set to complete. This is awesome. Next, we'll build a slightly more complex workflow that will actually be
[15:41] triggered whenever you receive a new email. will then extract certain information from that mail. This could be anything. It could be lead information. Maybe if you're a content creator, you want to extract sponsorship opportunities, or if you're a restaurant, maybe it's reservations, orders, whatever. Now, in order to monitor these emails 24/7, I highly recommend using N8N in the cloud because running it on your own machine simply won't cut it. Now, of course, you could simply go with N8's paid service. So on
[16:12] their website, you can go to pricing and sign up for a cloud account, which is about β¬20 a month. Of course, this cloud service gives you a lot more functionality than the free version. And if you want to try it out, you can use the link in the description to start using it for free, but I actually want to show you a much cheaper solution for self-hosting N8N. In the description of this video, you'll find a link to this page on Hostinger. You can selfhost anything on Hostinger for as little as $5 per month. Look, personally, I prefer
[16:44] the KMV2 plan as it's extremely fast and really powerful. It scales very well with all of the client and personal projects that I run online. So, simply choose your plan. And of course, here you can choose whether you want to host for one month, which is still only $10 per month compared to the β¬20 on the official service. Of course, you get greater discounts if you go for the 12-month plan or because I use edit all the time, I simply committed to a 24-month plan, which is only $7 per
[17:14] month. Either way, choose your term and at the bottom under applications, select N8N. Then, before you check out, you can actually get an additional 10% off by clicking on have a coupon code and enter my name, Leon. When you apply this, you will get an additional 10% off on your hosting. And finally, hit continue. After the setup process, you'll be able to access your instance from the Hosting Gear dashboard. Now, you don't have to worry about any of this. All you have to
[17:45] do is click on manage app, and that will take you to your brand new NAN instance. Go ahead and complete the setup form. Then, you can fill out all of this info if you want. I'll just click on get started. And on this screen, I highly recommend providing your email address and clicking on send me a free license key. This will unlock a lot of additional functionality in your free instance. Then simply copy that key and back in N8N, go to settings, click on enter activation key and paste in that
[18:17] key. Press activate. And that's it. You can actually go back to your dashboard. And now you can start building workflows. You've got access to data tables and everything else. Oh, and by the way, keeping your N10 instance up to date is really easy as well. From your hostinger instance, simply click on browser terminal. Now, this might look super intimidating, but I promise you it's not. We'll simply run three commands. First, run docker compose pool. Just like that. This will now
[18:48] download all the latest updates for N8N. Then run the command docker compose down. This will temporarily shut down our nitn instance. But don't worry, we won't lose any of our data. Then finally run docker compose up dash d. So let's run this and this will start edit instance back up and we should be able to use it pretty much immediately. So when we click on manage app, everything is still working as expected. So, let's have a look at another very common use
[19:19] case for using Nitin and data tables. Let's say we wanted to give our clients way more options for placing their pizza orders. So, they could simply send us an email something like this that says, "Hey, it's John here. I would like to place an order for five veggie pizzas, please." Now, what makes this different to what we saw before? So, initially we had this order processing form. So this guy over here which provides the details in a very structured format. But when it comes to something like emails, this
[19:51] involves working with unstructured data. Now of course this is a very simple example. In your case, this might actually be lead generation or maybe you want to identify sponsors or retrieve order information. There's just so many different use cases for this. But basically what we need to do is trigger our workflow the moment we receive an email. Identify if this email is related to an order and if it is grab this content, pass it to an NLM and extract the exact information we need. And let's
[20:23] call this email order processing. And now for the trigger. We're going to add the Gmail trigger and we'll select on message received. So when we receive an email, it will fire off this workflow. Then under credentials, let's click on create new credential. And if you are using NM cloud, this is really easy. You'll just click on the sign in button and authenticate your Google account. If you are self-hosting like I am, then this takes a little bit more setup. Go to cloud.google.com
[20:53] and click on console. And don't worry about all of this. The service is completely free. Let's click on select a project. Let's create a new project. And I'll just call this N tutorial. Let's create this. And it will just take a few seconds to create this project. Then let's select our project. Cool. From the left hand side, click on the menu. Then click on APIs and services. Then let's click on library. From here, let's search for Gmail. Then click on the
[21:24] Gmail API and click on enable. So, by the way, if you wanted to give NN access to any other services like maybe Google Calendar or something like that, you can just search for it in the library and enable it. Right. So, the next thing we want to do is go to the oorthth consent screen. This is that popup that shows up when you sign in with your Google account. Let's click on get started and let's give it a name. I'll just call this edit and tutorial and let's select our email. Let's click on next. Select
[21:54] external. Click on next. Then let's enter our email again. Let's click on next. And then let's click on finish and continue and create. Then let's click on audience. Let's click on publish app and confirm this. We're almost done. Let's go to clients. Let's create a new client. Under application type, select web application. And of course, let's give this a name like NN tutorial. Then scrolling down, go to this authorized
[22:24] redirect URI section and click on add URI. Now for this value, we need to copy this value from N8N and paste it into this field. Then let's click on create and this will now give us our client ID and client secret. So I'll copy my ID and add it to N8N. And let's do the same for the secret like so. After entering these values, we'll get the sign in with Google button. Now let's select our Google account. If you get this screen, simply go to advanced and continue.
[22:56] Let's check all of these and click on continue. And that's it. The connection was successful. I know this was a lot, but we only have to set this up once, right? So for the poll time, we can say we want to check for new emails every minute, every hour, every day, whatever. I'll just leave it on every minute. And let's actually click on fetch test event. And now we can see that email saying, "Hi, John here. I'd like to place an order for the pizza." And of course, we can also see the email address. I'm going to pin this data. And
[23:26] now we can use an LLM to classify this email. So if it's not related to an order, we actually just want to exit out of this workflow. So under add, let's go to AI and let's add the text classifier. Then for the text to classify, we can simply grab the text from the input. And then for the categories, let's add a new one and let's say order. For the description, let's say this text is related to placing an order. Or let's add another category called not an
[23:58] order. This text is not related to placing an order. So let's actually test the step. And of course, we have to assign a model first. So under model, let's go to chat open AI. And for the model and I'll just go with GPT5 mini like so. Let's run this node again. And it correctly identified that this text is indeed related to an order. So if it's not related to an order, we'll simply do this. We'll add this no operation do nothing node. This simply
[24:29] terminates the workflow. or if it is related to an order, we want to use an LLM to extract all the relevant information like the name, the email address, the item and quantity. There are a few ways in which we can do this. We can either use an agent or we can simply use an LLM chain. I think an agent will actually be the easiest. So, let's add our agent. And under define below, I'm going to switch over to expression. And let's say email subject,
[25:00] which we can grab from over here. Let's say email body, which of course we can grab from over here. And then for the sender, let's grab this from value. All right. So this should be enough context for our agent. So let's also add a system message. And in here, let's give a very specific system prompt. use the provider tool to update the database. Cool. So, let's actually close out of this. Let's assign a model. In fact, I'm just going to use the same model. And
[25:31] then for the tool, let's look for our data table tools. And for the operation, we'll leave it on insert. For the database name, let's look for pizza orders. And we'll let the AI decide on how to populate these values. Right, this should be fun. Let's actually give this a spin. I'm going to run this workflow. So, it's doing the text classification and now we're running our agent. And let's have a look at what the agent said. I've added the order to the database. Would you like me to send an order confirmation email to the
[26:02] customer? So, this is really cool. We can actually take this a step further by providing a Gmail tool to the agent that it can use to respond to the customer's email. So, you can tell the customer, I've processed your order, or can you provide additional information? So all you really have to do is under tools you can go to Gmail. So select the Gmail tool and under operation you can select send and get the agent to populate all of these fields. Then we can adjust our system prompt a bit to say
[26:34] please use the Gmail tool to respond to the customer's email. If everything was successful then please let them know the order was processed and the order is on its way. If they're missing information like the item name or quantities, then we send them an email for that additional information. All right, cool. So, let's actually go back. Let's run this workflow again. Well, I can see the agent actually inserted a record and called the email tool. And if we go back to our emails,
[27:05] we get a response back, which of course says, "Hey, John, thanks. Your order for the five veggie pizzas have been processed and it's on its way." How awesome is that? I hope you guys enjoyed this video. If you did, please hit the like button and subscribe to my channel for more NAN content. Please let me know down in the comments if you've got any questions. Thank you for watching and I'll see you in this next video. Bye-bye.