▶ Stepthrough All tutorials Blog Glossary Prompts Videos Visual guides Cheat sheets Start Learning Free

Lovable + n8n: a web form with an AI backend, step by step

Lesson cheat sheetOne page · US letterLovablen8n

A free one-page cheat sheet: a Lovable form posts to an n8n webhook, and an AI Agent logs it in Google Sheets and replies by Gmail.

Free, no sign-up and no email needed. It prints on one letter-size page; the whole sheet is below.

▶StepthroughFree printable cheat sheet · learn.ynteractive.com

Lovable + n8n: a web form with an AI backend, step by step

Lovable builds the form, n8n does the thinking and the actions. The only link between them is one webhook URL, kept in a Lovable secret.

The form in Lovable

  • Start with a prompt, paste the form prompt, click Build.
  • Fields Name, Email, Question and Feedback, sent as JSON with the keys name, email, question and feedback.
  • The prompt says: don't hard-code any webhook URL. Use the N8N_WEBHOOK_URL secret.

The backend in n8n

  1. Add first step…, On webhook call. Set Respond to Using 'Respond to Webhook' Node.
  2. Add AI Agent. Set Source to Define below and paste a prompt template that reads the body, like {{ $json.body.name }}.
  3. + Add Option, System Message, paste the message below.
  4. Chat Model: OpenAI Chat Model, model gpt-5-mini.
  5. Tool: Google Sheets Tool on a Leads sheet with the same four columns, each set with ✦. Then add Gmail Tool.
  6. After the AI Agent, add Respond to Webhook. Nothing to configure.

The system message

You are a helpful assistant.

Use the google sheets tool to add the lead to the google sheet.

Use the gmail tool to reply to the form submitter.

The lesson's whole system message. Add your services and hours so replies sound like you.

Go live: test URL vs production URL

Publish first
Click Publish. The production URL only works once the workflow is published.
Copy the right URL
Open Webhook, click the Production URL tab, click the URL to copy. The test URL only works during testing.
Store it
In Lovable, click More, add the secret N8N_WEBHOOK_URL, paste, Save.
Test it
Preview, Fill with test data, Send Message, then check the Leads sheet.

Remember: Publish first, copy the Production URL second, and keep it in a Lovable secret, never in the page.

Practice it free: Lovable + n8n: Build a Web App with an AI Backend at learn.ynteractive.com/modules/lovable-n8n. This sheet: learn.ynteractive.com/content/cheat-sheets/lovable-n8n-form-flow. Businesses in the lesson examples are made up. By Robert Breen, October 1, 2026.

Practice it in the free lesson

Lovable + n8n: Build a Web App with an AI Backend. Build a contact form in Lovable and connect it to an n8n workflow — webhook trigger, AI Agent, Google Sheets, Gmail, and a Respond node that ties it all together. You do every step yourself in a practice copy of Lovable and n8n, it checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, and nothing touches your real accounts.

Start the free lesson

Or read the full step-by-step guide

Lessons on this sheet

Plain-English definitions, each with an example from a free lesson.

The full AI glossary

All free prompt templates

More cheat sheets

All free cheat sheets · All free tutorials