Site icon JD Bots

How to Set Up and Run the Contact Form to Data Table for n8n

Card titled Set Up the n8n Contact Form, labelled n8n Tutorial setup guide, with a form node linked to a table node and three notes: n8n 2.48.7 in Docker, two workflows to import, each message becomes a row.

You have the source code of Contact Form to Data Table for n8n. This guide takes it from the zip file to a working contact form on your own computer, with every message saved as a row in an n8n data table.

By the end, the form opens at http://localhost:5678/form/contact, and each message sent through it appears in the Contact messages table.

Cost: free. Everything runs on your own computer, with no accounts or API keys. n8n’s Community Edition costs nothing to self-host. Docker Desktop is free for personal use, education and small businesses (fewer than 250 employees and less than $10 million in yearly revenue); larger companies need a paid Docker subscription.

Every screen and output on this page is real, run with n8n 2.48.7 and Docker Desktop on macOS.

Get the Source Code

Get the complete source code of Contact Form to Data Table for n8n on Dewiride Store →
The archive holds the two workflows and the Docker Compose file this guide sets up and runs.

Prerequisites

Step 1: Unzip the Source Code

Open Terminal and go to the folder that holds the zip, such as Downloads:

Terminal

cd ~/Downloads

Unzip it:

Terminal

unzip contact-form-data-table-n8n-1.0.0.zip

It creates a folder named contact-form-data-table-n8n. Go into it:

Terminal

cd contact-form-data-table-n8n

The folder holds the two workflows in workflows, compose.yml for n8n, .env.example with two optional settings, and a README.

Step 2: Start n8n

Already run n8n 2? Skip to Step 4 and import the workflows into your own n8n.

compose.yml runs n8n 2.48.7 in Docker, reachable only from your computer. Start it:

Terminal

docker compose up -d

docker compose reads compose.yml in this folder, and up -d starts n8n in the background. The first time, Docker downloads the n8n image first. When the last line says Started, n8n is running:

Output (the lines that matter)

Volume contact-form-data-table-n8n_n8n_data Created
Network contact-form-data-table-n8n_default Created
Container contact-form-data-table-n8n-n8n-1 Started

Step 3: Create Your Owner Account

Open http://localhost:5678 in your browser. The first time, n8n asks for an owner account: enter your email address, name and a password, and click Next.

The first time n8n opens, it asks for an owner account.

n8n then shows a few questions and a free licence offer. Answer or skip them until n8n opens. How to Install n8n with Docker shows each of these screens.

Step 4: Import the Two Workflows

Import the setup workflow first. Click + at the top of the left sidebar, then New workflow. Click ⋯ next to the workflow name, then Import › From file, and choose set-up-contact-messages-table.json in the workflows folder.

The three dots, then Import › From file.

If n8n asks Importing this from an AI tool?, click Skip. It offers to connect AI tools to n8n, which this guide doesn’t need.

Click Skip; this guide doesn’t need it.

The workflow opens as Set up the Contact messages table. Now import contact-form-to-data-table.json the same way, into a second new workflow.

Step 5: Create the Data Table

Open Set up the Contact messages table and click Execute at the bottom of the canvas. Both nodes turn green, and n8n says Workflow executed successfully.

The setup workflow creates the table.

Click Overview (the house icon in the left sidebar), then the Data tables tab. The Contact messages table is there, ready for messages. Running the setup workflow again doesn’t create a second table.

The new table, under Overview › Data tables.

Step 6: Publish the Form

Open Contact form to data table, click Publish at the top right, then Publish again in the dialog. How to Publish a Workflow in n8n explains the dialog. Click Got it on the Workflow published message. The button now says Published, and the form is live.

The form workflow, published.

Step 7: Send a Message

Open http://localhost:5678/form/contact in your browser. This is the form your visitors fill in. All three fields are required, and the form checks that the email address is valid.

The form your visitors fill in.

Fill it in and click Submit. The form answers Form Submitted once the message is saved:

Shown once the message is saved.

Back in n8n, open Overview › Data tables › Contact messages. Each message is a new row:

Each message is a row.

Take Messages from Your Website

The n8n from compose.yml listens only on your computer, so only you can open the form. To take messages from your website’s visitors, run the two workflows on an n8n that’s online, and link to its form address, https://<your n8n address>/form/contact. n8n’s Docker Compose guide covers running n8n on a server.

Clean Up

To stop n8n, run this in the folder:

Terminal

docker compose down

It stops n8n and removes its container:

Output (the lines that matter)

Container contact-form-data-table-n8n-n8n-1 Removed
Network contact-form-data-table-n8n_default Removed

Your workflows and messages stay in Docker’s n8n_data volume, so docker compose up -d brings everything back.

Warning: docker compose down -v also deletes the volume, with every workflow and message in it. It can’t be undone.

Troubleshooting

ProblemCauseFix
The form says Problem submitting responseThe Contact messages table is missing. The failed run in Executions says Data table with name "Contact messages" not foundRun Set up the Contact messages table (Step 5), then send the message again
Conflicting Form Path when you publishThe contact form workflow is in n8n twiceArchive and delete the copy, or change Form Path in one of them
Bind for 127.0.0.1:5678 failed: port is already allocatedAnother container uses port 5678, such as another n8nCopy .env.example to .env, set N8N_PORT to a free port such as 5701, run docker compose up -d again and use that port in the addresses
The form page isn’t found right after docker compose up -dn8n turns published workflows on a few seconds after it startsWait a moment and reload

FAQ

Can I use my own n8n instead?

Yes, if it runs n8n 2. Skip Steps 2 and 3, and import the two workflows into it. They were tested with n8n 2.48.7.

Where are the messages stored?

In the Contact messages data table, inside n8n’s data on your computer. To save them as a file, click ⋯ next to the table’s name, then Download CSV.

Does it work on Windows and Linux?

It has been tested on macOS so far.

Conclusion

You took the contact form from its zip to a live form: n8n running in Docker, the two workflows imported, the Contact messages table created and the form published. Every message your visitors send is now a row you can read in n8n.

To see how the workflow is built, Part 2 of the n8n Tutorial builds it step by step.

Additional Resources

Related

n8n and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by n8n GmbH.

Exit mobile version