Lead Capture Kitfor n8n
Get the kit

Set it up

Step-by-step setup

Follow the steps in order. Each one ends with something you can check, so you know it worked before moving on.

#Copy the Google Sheet

  1. Open the sample Sheet that came with the kit → File → Make a copy. No sample link? Create a new Sheet, then File → Import → Upload sample/leads-sample.csv into a tab named exactly Leads.

  2. Make sure there's a second tab named Error Log with this header row:

    Text
    logged_at, workflow, execution_id, execution_url, failed_node, error_message, lead_id
  3. Keep row 1 of Leads exactly as it is (19 headers). Extra columns to the right are fine; the workflow ignores them.

  4. Optional: select column G (phone) → Format → Number → Plain text, so numbers you type by hand keep their +.

  5. Copy the Sheet ID from the address bar. It's the long part between /d/ and /edit, for example 1AbC…xyz.

  6. When you go live, delete the sample rows and keep the header row.

Check: two tabs, Leads and Error Log, with headers in row 1.

#Import the workflows

  1. In n8n, go to Overview → Create workflow, then top-right ⋯ → Import from File… and pick lead-capture-error-handler.json. Click Save.
  2. Do the same for lead-capture-alerts.json → Save.
  3. Optional, for the hosted form: do the same for lead-capture-demo-form.json → Save.

They import unpublished, and nodes that need a credential show a warning badge. That's expected; you'll fix the badges in the next steps.

Check: the main workflow opens with 23 nodes and five sticky notes.

#Fill in the Config node

Open the Config node in the main workflow. It's the only node you need to edit. Change at least these fields:

Field Example Notes
business_name Santos Family Dental Used in the email and the alerts
sheet_id 1AbC…xyz From step 1
ack_from_name Santos Family Dental Sender name on the thank-you email
ack_signature — Dr. Santos & team Last line of the email
n8n_base_url https://n8n.yourdomain.com Builds execution links in the Error Log
alert_telegram / alert_slack / alert_discord true / false / false Any combination
telegram_chat_id -1001234567890 From step 5
slack_channel_id C07ABCDEF12 From step 6
discord_webhook_url https://discord.com/api/webhooks/… Only if alert_discord = true
default_country_code 63 Turns 0917… into +63917…
timezone Asia/Manila Time zone for Sheet timestamps

Then open Error Config in the error-handler workflow and set the same sheet_id, business_name and telegram_chat_id.

Every other field (spam rules, email wording, duplicate behavior) is listed in the node reference.

The Config node: one field per setting. Values here are placeholders.

#Connect Google Sheets and Gmail

The workflow uses two n8n credentials: Google Sheets OAuth2 API and Gmail OAuth2 API. Create each once under Credentials → Add credential.

#On n8n Cloud

Open each credential → Sign in with Google → choose the account that owns the Sheet → allow access. Done; skip to using the credentials.

#On self-hosted n8n (one time per n8n instance)

Self-hosted n8n needs its own Google Cloud OAuth client. This takes about 10 minutes.

  1. Open the Google Cloud console and create a project, for example n8n-leads.
  2. Go to APIs & Services → Library and enable Google Sheets API, Google Drive API and Gmail API.
  3. Go to Google Auth Platform (labelled OAuth consent screen in older consoles) → Get started. Enter an app name and your support email, choose External as the audience, add your contact email, and create it.
  4. Under Audience → Test users, add the Google account you'll sign in with.
  5. In n8n, create the Google Sheets OAuth2 API credential and copy the OAuth Redirect URL it shows. It looks like https://n8n.yourdomain.com/rest/oauth2-credential/callback.
  6. Back in Google Cloud: Clients → Create client → Web application. Under Authorized redirect URIs, paste the n8n redirect URL. Create it, then copy the Client ID and Client secret.
  7. In n8n, paste the Client ID and secret into the credential → Sign in with Google → allow access.
  8. Create the Gmail OAuth2 API credential the same way. You can reuse the same Client ID and secret.

Official n8n guide: Google OAuth2 single service.

#Use the credentials on the nodes

Open each node with a warning badge and pick the credential:

Credential Nodes
Google Sheets Read Existing Leads, Update Lead Row, Append Lead Row, Log Notification Failure, and Log Error to Sheet in the error handler
Gmail Gmail: Acknowledge Lead
Check: Read Existing Leads shows your Google Sheets credential and no warning badge.

#Set up Telegram alerts

  1. In Telegram, open a chat with @BotFather → send /newbot → pick a name and username → copy the token (looks like 123456:ABC…).

  2. In n8n, create a Telegram API credential and paste the token. Select it on Telegram: Alert Team and, in the error handler, Telegram: Error Alert.

  3. Add the bot to your team group. Then send a message in the group that mentions it, such as /start@YourLeadsBot. (Bots in groups only see commands and mentions by default.)

  4. Open this address in your browser, with your token in place of <TOKEN>:

    Text
    https://api.telegram.org/bot<TOKEN>/getUpdates
  5. Find "chat":{"id":-100… in the reply and copy the number, including the minus sign. Paste it into telegram_chat_id in Config and Error Config.

Docs: Telegram credentials in n8n.

#Add Slack or Discord (optional)

#Slack

  1. Go to api.slack.com/apps → Create New App → From scratch.
  2. OAuth & Permissions → Bot Token Scopes: add chat:write. Add channels:read too if you want n8n's channel picker.
  3. Install to Workspace → copy the Bot User OAuth Token (xoxb-…) into an n8n Slack API credential. Select it on Slack: Alert Team.
  4. In the Slack channel, type /invite @YourApp.
  5. Get the channel ID: click the channel name → the ID is at the bottom of the details (starts with C). Paste it into slack_channel_id and set alert_slack = true.

Docs: Slack credentials in n8n.

#Discord (no credential needed)

  1. In Discord: channel → Edit Channel → Integrations → Webhooks → New Webhook → Copy Webhook URL.
  2. Paste it into discord_webhook_url and set alert_discord = true.

Treat the webhook URL like a password: anyone who has it can post to your channel.

#Turn off channels you don't use

If you don't use a channel, for example Slack, do both of these:

  1. Set its toggle in Config to false (alert_slack = false).
  2. Either add its credential anyway, or deactivate the node: select Slack: Alert Team and press D, or right-click → Deactivate.

Otherwise n8n shows a red missing-credential badge on the node, which looks broken to a client even though the workflow runs. In our live demo, Slack: Alert Team is deactivated.

#Publish and connect the error handler

  1. Open Lead Capture → Error Handler and click Publish.
  2. Open the main workflow → ⋯ → Settings → Error Workflow → choose Lead Capture → Error Handler → Save.

The imported file has a placeholder for this setting, so n8n shows no error workflow selected until you pick one. Picking it in Settings replaces the placeholder.

Check: Error Workflow shows Lead Capture → Error Handler.
The error handler: Error Trigger, Error Config, then log to the Sheet and alert on Telegram. This screenshot was taken before its sticky note was updated; you do need to publish it.

#Connect the Demo Form (optional)

Skip this if every lead comes from your own website.

  1. Open Lead Capture → Demo Form → node Save Lead (run main workflow).
  2. Set Source to Database, then Workflow → From list → Lead Capture → Sheet + Alerts. You can also choose By ID and paste the main workflow's ID, which is the part after /workflow/ in its address.
  3. Leave Mode on Run once with all items and Wait For Sub-Workflow Completion on. Both are already set.
  4. Save. To try it, click Execute workflow in the Demo Form workflow and fill in the popup form.
  5. Publish the Demo Form workflow to get the public address: https://YOUR-N8N-DOMAIN/form/lead-capture-demo.
  6. To change the wording, edit the Demo Lead Form node (title and fields) and the Thank-You Page and Error Page nodes.

The main workflow doesn't need to be published for the Demo Form: Execute Workflow runs its saved version. We confirmed this on n8n 2.47.3.

The Demo Form workflow: Form Trigger, Execute Workflow, then a Thank-You or Error page.
The hosted form in test mode.
What the visitor sees after submitting.

#Test, then publish

  1. In the main workflow, click Execute workflow. It now waits for one test request.
  2. Send the sample request from Test and go live to the test address, /webhook-test/lead-capture.
  3. Check all three: a new row in Leads, a thank-you email (use your own address while testing), and an alert in your team chat.
  4. Click Execute workflow again and send the same request. The row is updated, not duplicated.
  5. Click Publish on the main workflow.

Publishing is only needed for the public website address, /webhook/lead-capture. The Demo Form works without it.

Check: the execution shows Succeeded and every node on the path is green.

#Point your website at it

Use the production address on your live site:

Text
https://YOUR-N8N-DOMAIN/webhook/lead-capture

Connect your website has copy-ready HTML and JavaScript forms plus settings for WordPress, Webflow and others. If you set up the Demo Form, you can also share its link, adding UTM tags to see which link brought each lead:

Text
https://YOUR-N8N-DOMAIN/form/lead-capture-demo?utm_source=facebook

Lead Capture Kit for n8n: website enquiries saved to Google Sheets, de-duplicated, thanked and sent to your team chat.

Checked against n8n 2.47.3. n8n, Google Sheets, Gmail, Telegram, Slack and Discord are trademarks of their owners; this kit is not affiliated with them. Sample data is fictional.