Set it up
Test and go live
Test with fake data first, then publish. Each check below says what you should see in the Sheet, your inbox and your team chat.
#Send a test lead
- Open the main workflow and click Execute workflow. n8n now listens for one request on the test address.
- Run this from a terminal, with your n8n address in place of
YOUR-N8N-DOMAIN:
curl -sS -X POST "https://YOUR-N8N-DOMAIN/webhook-test/lead-capture?utm_source=facebook&utm_medium=paid_social" \
-H "Content-Type: application/json" \
-d '{
"name": "Angelo Bautista",
"email": "angelo.bautista@example.com",
"phone": "0917 555 0199",
"company": "Bautista Bike Shop (Davao City)",
"message": "Can you send our website enquiries to our Telegram group?",
"utm_campaign": "davao-smb-nov",
"page_url": "https://demo.example.com/contact",
"website": ""
}'You should get:
{ "ok": true, "lead_id": "LC-20261111-3XRL", "duplicate": false, "status": "new",
"formSubmittedText": "Thanks! We received your message and will reply soon." }Then check the Leads tab for a new row with status = new, and your team chat for the alert. To test the thank-you email, put your own address in email.
#Check duplicates
Click Execute workflow again (the test address works for one request at a time) and send the same command. Now you should get "duplicate": true, "status": "returning", and the Sheet still has one row for Angelo, with submission_count = 2. No second thank-you email is sent unless ack_on_duplicate is on.
#Run every sample payload
The kit's sample/payloads/ folder covers the main cases. With the main workflow published, or after Execute workflow before each one, run:
for f in sample/payloads/*.json; do
echo "== $f"
curl -sS -X POST "https://YOUR-N8N-DOMAIN/webhook-test/lead-capture" \
-H "Content-Type: application/json" --data @"$f"
echo
done| Payload | What you should see |
|---|---|
01-new-lead.json |
200, a new row, a thank-you email and an alert |
02-duplicate-email.json |
200, Maria's row updated (submission_count 2, status stays contacted), no second email |
03-duplicate-phone.json |
200, Paolo's row updated through the phone match |
04-spam-honeypot.json |
200 {ok:true}, but nothing saved and no alert |
05-invalid.json |
422 {ok:false, errors:[…]} |
#Test the hosted form
In the Lead Capture → Demo Form workflow, click Execute workflow and fill in the popup. After publishing, use https://YOUR-N8N-DOMAIN/form/lead-capture-demo?utm_source=facebook.
The main workflow runs as a sub-workflow, so its execution appears in the main workflow's Executions list. Spam or invalid entries still see the Thank-You page and nothing is saved. If Google Sheets is down, the visitor sees the Error Page.
If the test form comes back empty on a second try instead of showing Thank-You, see this troubleshooting note.
#Test the error handler
The error handler only runs when something fails, so force a failure once:
- Make sure the error handler is published and selected in the main workflow's Settings → Error Workflow.
- In Config, change one character of
sheet_idand save. Publish the main workflow. - Send one request to the production address,
/webhook/lead-capture. The website gets a503. - Check that the error handler ran (its Executions list), a row appeared in the
Error Logtab (the error handler uses thesheet_idin Error Config, which is still correct), and the Telegram error alert arrived. - Put the correct
sheet_idback and save.
n8n runs the error workflow for production executions, so test this through the published workflow rather than Execute workflow.
#Offline tests (no n8n, nothing sent)
The kit includes two Node.js scripts you can run on any computer with Node 18 or newer:
node test/harness.js # runs the workflow's own JavaScript against 22 cases
node test/validate.js # checks node types, versions, connections and that no secrets are includedvalidate.js also fails if any workflow contains both a Form Trigger and a Respond to Webhook node, which n8n 2.x refuses to run.
#Verified live
Run on a self-hosted n8n 2.47.3 on November 11, 2026 (Asia/Taipei time), through the Demo Form test address.
| Test | Result |
|---|---|
| New lead through the Demo Form | Succeeded in 6.07 s. Append Lead Row, Gmail and Telegram ran. Lead LC-20261111-EUNQ. The form showed the Thank-You page and the email subject was “Thanks for contacting [business name]” (the name comes from Config) |
| Same email again | Succeeded in 3.2 s. Update Lead Row ran: status = returning, submission_count = 2, last_seen_at updated, note “matched by email”. Telegram said “Returning lead (#2)”. No second email, as expected. |
| Main workflow unpublished | Execute Workflow ran its saved version. Publishing is only needed for /webhook/lead-capture. |
| Not yet run live | The website webhook through curl, the spam path, and the error handler. |
#Go live checklist
- Sample rows deleted from
Leads, header row kept. - No warning or red badges on any node you use; unused alert nodes deactivated.
- Error handler published and selected in the main workflow's settings.
- Main workflow published; Demo Form published if you use it.
- Your website uses
/webhook/lead-capture, not/webhook-test/. - One real test from the live website lands in the Sheet and your team chat.
- Your privacy notice says enquiries are stored in Google Sheets and processed by n8n.