On this page
What this issue is
Many modern sites send form data to a serverless function: a small piece of backend code that the host starts only when a request arrives. If nobody has used it for a while, the host has to boot it first. This delay is called a cold start.
A cold start alone adds a second or two. The real trouble starts when the function then does slow work on top: connecting to a database, calling a CRM, sending an email through SMTP. Together these can pass the function's time limit or the browser's patience. The visitor sees a spinner, an error or nothing, and the lead may or may not be saved.
- Visitor fills formClicks Submit after a quiet period
- Function cold startHost boots the code from scratch
- Slow workDatabase, CRM and email calls pile up
- TimeoutBrowser or host gives up
- Lead in inbox and CRMNever arrives or arrives half done
The function times out before it finishes, so everything after it is lost.
Why it costs you leads or sales
Cold starts hit the visitors who arrive after a quiet spell: early morning, weekends, the first click from a new ad campaign. These are often your most valuable first impressions. Because later submits are fast, you and your developer test the form, it works, and the problem looks like a one-off.
A timeout is also messy. The visitor may see an error and leave, or retry and create duplicates. Sometimes the lead is saved but the email or CRM step never ran, so the form looks fine while nothing reaches your team.
Example: illustrative numbers only. A warm function answers quickly; a cold one with slow downstream calls can pass a typical 10-second limit.
How to check if your site has it
Wait for the function to go idle
Leave the site alone for 15 to 30 minutes. Idle times vary by host, so try longer if needed.
Open DevTools and submit
In your browser press F12, open the Network tab, then submit the form with test data. Find the request to your form endpoint and read the Time column.
Compare with a second submit
Submit again straight away. If the second request is far faster, a cold start is the likely cause.
Read the function logs
In your host's dashboard (Vercel Functions logs, Netlify Functions, AWS CloudWatch) look for the duration of each call and for timeout or 502/504 errors.
Check the lead landed everywhere
Confirm the test lead reached the inbox and the CRM, not only that the page showed success.
How to fix it
The core idea is the same everywhere: answer the visitor quickly, and do the slow work separately. Start with the generic steps, then apply the platform notes.
Respond first, work later
Validate, save the lead to a fast store or queue, return success, then send emails and CRM calls in the background.
Raise the function timeout
Raise the maximum duration to what your plan allows, as a safety net rather than the main fix.
Slim the function
Remove unused packages, import only what you need and reuse database connections outside the handler so they survive between calls.
Reduce cold starts
Use a lighter runtime, a region close to your database, or your host's option for keeping instances warm if your plan offers it.
Add a client timeout and retry message
If the request takes too long, show a clear message and keep the entered data so the visitor can retry. Use an idempotency key so a retry does not create a duplicate lead.
Return early
Save the lead, respond with 200, and hand email and CRM work to a queue or background job.
Set the duration
On Vercel set maxDuration for the function; on AWS Lambda raise the Timeout setting; on Netlify check the function timeout for your plan.
Check where the form posts
Standard WordPress forms run on a normal server and rarely cold start. If your form posts to an external serverless endpoint, treat it as custom code.
Move slow integrations
If your form plugin calls a CRM during submit, check whether it offers asynchronous or queued sending in its settings.
Check the form action
Native Webflow forms do not use your own functions. If you set a custom action or a script that posts to a serverless endpoint, apply the custom code steps to that endpoint.
Do not rely on tags for delivery
Tags that fire after submit can be cut off if the page waits on a slow response. Keep delivery in the backend, not in a tag.
const form = document.querySelector('form');
form.addEventListener('submit', async (e) => {
e.preventDefault();
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), 15000);
try {
const res = await fetch(form.action, {
method: 'POST',
body: new FormData(form),
signal: controller.signal
});
if (!res.ok) throw new Error('Bad response');
form.innerHTML = '<p>Thanks, we have your message.</p>';
} catch (err) {
alert('This is taking longer than usual. Your details are still in the form. Please try again.');
} finally {
clearTimeout(timer);
}
});Before
- Function validates, writes to the database, calls the CRM and sends email before replying
- A cold start plus slow calls pass the time limit
- Visitor sees an error or a spinner
After
- Function validates, saves the lead and replies at once
- CRM and email run from a queue or background job
- Visitor sees success and the team gets the lead
How to confirm it's fixed
- Wait for the idle period again, then submit a test lead and note the request time
- The first submit after idle finishes well inside your timeout
- The success message appears and no error shows
- The test lead reaches the inbox and the CRM exactly once
- Function logs show no timeouts or 502/504 responses
- Retrying after a simulated slow response does not create a duplicate
How to prevent it happening again
Set a submit time budget, for example that the form must answer in under 5 seconds even when cold, and test against it after every deploy. New code, a heavier library or a slower CRM call can quietly push you back over the line.
Example: 06:00
Function has been idle all night
Example: 07:42
First visitor from an ad submits the form
Example: 07:42 + 12s
Cold start plus CRM call pass the limit; the request times out
Example: 07:43
Visitor leaves. Later submits are fast, so nobody notices
Cold and slow
Leads or data lost
The request passes the time limit, the visitor sees an error and the lead may be lost or half processed.
Toggle the cause to see how the submit result changes.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. It runs your real form journey on a schedule and flags a duration anomaly: if a submit takes much longer than usual, or the journey fails, you get one alert after a re-check from a second region, with a screenshot and a likely cause.
What it does not do: it has no submit budget, meaning you cannot set a fixed maximum time for the submit step and be alerted the moment it is crossed. A slow but still successful submit may therefore go unflagged if it is not unusual compared with earlier runs. Scheduled checks also may not land on a cold function every time.
Questions people ask
Why does my contact form time out the first time but work on retry?
Most likely the backend is a serverless function that went idle and had to cold start. The first request pays the start-up time plus any slow database, CRM or email calls, and can pass the time limit. Later requests hit a warm function and finish fast.
What is a serverless cold start?
It is the delay when a host has to start your function from scratch because it has not run recently. It usually adds a second or two, and more if the code is heavy or opens connections on start-up.
How do I stop my serverless form from timing out?
Reply to the visitor as soon as the lead is saved and move slow work such as CRM and email calls to a background queue. Also slim the function, raise the timeout as a safety net and show a clear retry message in the browser.
Can a form timeout lose leads even if the page shows success?
Yes. If the function saves the lead but times out before sending the email or CRM call, the visitor may see success while your team receives nothing. Always check that a test lead reaches the inbox and the CRM.
How can I test a form for cold start problems?
Leave the site idle for 15 to 30 minutes, open DevTools Network, submit the form and read the request time. Then submit again and compare. A big gap between the two means a cold start.
Does keeping a function warm fix the problem?
It helps by removing most cold starts, but it does not fix slow downstream calls. Combine it with a lightweight handler that replies quickly and does the slow work in the background.
Will FunnelGuard alert me when my form submit is slow?
Partly. It flags a duration anomaly when a submit takes unusually long or fails, but it has no fixed submit budget you can set. Keep your own time limit and check function logs too.
Related issues
- CNV-044Submit shows spinner foreverFix guide
- CNV-046Form endpoint returns 4xx/5xxFix guide
- CNV-045Form submits but shows a generic 'something went wrong'Fix guide
- CNV-051Lead delivered very late (queued for hours)Fix guide
- CNV-054Double-click submits two leadsFix guide
- CNV-048Form says success but lead never reaches emailFix guide