Netlify · HTTP 504

Netlify 504: Function Timeout

Trace a Netlify function timeout to long synchronous work, slow dependencies, or platform execution limits. Use request IDs and function logs to locate the wait.

Origin / Application

Decode a CDN or gateway error

Paste a captured HTTP response or enter a status and headers. Only the status and response headers are sent; common credential headers are filtered first.

Supports raw headers, full HTTP responses, JSON with status/statusCode and headers, cURL -v/-i response output, and HAR exports. HAR selects a server error first. cURL commands are never executed; request headers, response bodies, and common credential headers are excluded.

Diagnostic report

Error code / name

NETLIFY-FUNCTION_TIMEOUT

Fault domain

Origin / Application

Why it happened

The function did not return before its execution limit. Long database queries, serial external requests, or doing background work inside a request can hold the invocation open.

Actionable fixes

  1. Search function logs using x-nf-request-id and inspect duration and dependency timing.
  2. Move long-running work to a supported background function or external job queue.
  3. Set short per-dependency deadlines and return a clear response when an optional dependency fails.

Why this error happened

The function did not return before its execution limit. Long database queries, serial external requests, or doing background work inside a request can hold the invocation open.

Actionable fixes

  1. Search function logs using x-nf-request-id and inspect duration and dependency timing.
  2. Move long-running work to a supported background function or external job queue.
  3. Set short per-dependency deadlines and return a clear response when an optional dependency fails.

Network failure point

Client -> Netlify Edge -> function starts -> dependency or job exceeds limit -> X 504

Verify origin directly via CLI

curl -sS -I -w 'starttransfer=%{time_starttransfer} total=%{time_total}\n' --max-time 90 https://example.com/.netlify/functions/health

Configuration fix

netlify/functions/report.tstypescript
export default async () => {
  const jobId = await enqueueReport();
  return new Response(JSON.stringify({ jobId }), {
    status: 202,
    headers: { "content-type": "application/json" },
  });
}

Catch this failure before it becomes an outage

SteadyNode's regional HTTP checks detect function latency and 504 responses, while response-header capture helps correlate customer impact with Netlify request logs.

No credit card required.

Start for free

Frequently asked questions

Can a Netlify function timeout be fixed by retrying?

Retries can increase load and still exceed the same limit. Identify slow work and move durable long tasks out of the synchronous request.

Where can I find the failing invocation?

Use the x-nf-request-id from the response to locate the matching Netlify function log entry.

Cloudflare

Vercel and Netlify

AWS CloudFront and ALB

Fastly

Heroku and Render

Nginx and Envoy