
When a visitor submits a form on your website, something has to tell the rest of your systems. You can ask the website every minute whether anything new has arrived (polling), or you can let the website call you the moment it happens. That second approach is a webhook, and it is the connection point for a large share of everyday automation.
Webhook vs polling
| Webhook | Polling | |
|---|---|---|
| Who starts it | The sending system, when the event happens | Your workflow, on a schedule |
| Delay | Near real time | Up to one polling interval |
| Wasted work | None | Most checks find nothing new |
| Needs a public URL | Yes | No |
| If your system is down | The event may be lost unless the sender retries | You catch up on the next poll |
What actually arrives
A webhook is just an HTTP request, usually a POST, sent to a URL you control. The interesting part is the body. Two formats are common:
- JSON (
application/json): structured and easy to read, for example{"email":"ana@example.com"}. - Form-encoded (
application/x-www-form-urlencoded): flat key=value pairs, the same format a plain HTML form submits.
The format matters because your automation tool parses each one differently, and the field names are not always what you expect. Some form plugins send the field IDs, some send the field labels exactly as a visitor sees them (including capital letters and spaces), and some nest everything under a fields object. The first step of any webhook workflow should be to look at one real request and write down the exact shape before building anything on it.
Test URL, production URL
Most automation platforms give you two addresses for the same webhook. The test URL only listens while you are in the editor with the workflow open and waiting; the production URL only works when the workflow is switched on. A very common first-day mistake is pasting the test URL into the form plugin, seeing it work once, and then never seeing another submission. Paste the production URL into the live site, and use the test URL only while building.
Respond quickly
The sender is waiting for your answer. If a workflow takes thirty seconds to run an AI model and send emails, the sender may time out and retry, which can create duplicates. Two good patterns:
- Return a quick
200 OKas soon as the data is received, then continue processing. - If you must answer with a result, keep the work before the response short and move the slow parts after it.
Make it safe to receive twice
Webhook senders retry when they do not get a clear success response, so assume every event can arrive more than once. The technique is called idempotency: give each event a unique key (an order number, a submission ID, or a hash of the email plus timestamp), check whether you have already processed it, and skip it if so. In a spreadsheet-based workflow this can be as simple as updating a row by key instead of always appending a new one.
Security basics
- Treat the URL as a secret. A long, random path is better than
/webhook/contact. - Check a shared secret. Many services let you add a custom header or sign the payload. Reject requests that do not carry the right value.
- Validate the data. Never trust field contents. Check that an email looks like an email and that required fields are present before you act on them.
- Do not log sensitive data longer than you need to.
A debugging checklist
- Did the request reach the URL at all? Check the receiving tool’s execution list.
- Is the body in the format you assumed? Open the raw payload.
- Are the field names exactly right, including case and spaces?
- Is the workflow active, and are you using the production URL?
- Did a firewall, a caching layer or a security plugin block the request?
Key takeaways
A webhook is a push notification between systems. It is faster and cheaper than polling, but it asks more of you: look at the real payload first, answer fast, expect duplicates, and keep the URL private.