Skip to content

Netlify errorNetlify Function times out

Your Netlify Function stops at its time limit, usually while it waits on an AI model, an outside API or a database. Here’s what Netlify’s docs say about the limits and the ways around them, or hand it over at a fixed price.

Short answer

Netlify gives synchronous functions 60 seconds and scheduled functions 30 seconds, and neither limit is configurable. So find the slow part instead of looking for a setting: an outside call with no timeout, a database far from the function’s region, or heavy work inside the function. Work that takes longer belongs in a background function, which answers with 202 straight away and can run for up to 15 minutes.

Why it times out, and what to do

  1. 01

    The limit can’t be raised

    Netlify’s defaults list a 60-second execution limit for synchronous functions, 30 seconds for scheduled functions and 15 minutes for background functions, and mark none of them as configurable. If a request needs longer than 60 seconds, change how the work runs rather than looking for a setting.

  2. 02

    Waiting on an AI model or outside API

    Calls to an AI model or another service can stall. Set a timeout on each one, kept under 60 seconds, and return a clear error to the user when it fires.

  3. 03

    The function is far from your database

    “Deploying serverless functions close to their data sources, such as a database or another backend service, can greatly reduce roundtrip time for data retrieval” Netlify, Optional configuration for functions

    New sites deploy functions to cmh (Ohio) by default. If your database is somewhere else, every query makes the round trip. On Pro and Enterprise plans you can choose the function region to sit near the database.

  4. 04

    The function’s own work is heavy

    “You're hitting out-of-memory errors or timeouts caused by the function's own work, rather than by waiting on an external service or database.” Netlify, Optional configuration for functions

    Image or PDF work, large JSON or CSV files and other CPU-bound jobs can run out of time on their own. Netlify suggests raising memory or vCPU for that case, and notes that billing scales with the configured size.

  5. 05

    Long work belongs in a background function

    “When a function is invoked asynchronously, there is an initial 202 success response that indicates that the function was successfully invoked.” Netlify, Background Functions overview

    Set background: true in the function’s config. The caller gets an empty 202 response straight away and the function keeps running for up to 15 minutes, so Netlify suggests passing the result somewhere other than the caller, such as your database.

    export const config: Config = {
      background: true,
      path: "/process",
    }

Checked against the vendor’s docs on : Netlify docs: Optional configuration for functions; Netlify docs: Background Functions overview.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Vercel function 504 timeout · Build failed on Netlify or Vercel · 404 on refresh on Netlify or Vercel · Backend and API development

Questions

More on this error

Can I raise the 60-second limit on Netlify?

Netlify’s defaults table lists the synchronous execution limit as not configurable. For longer work it offers background functions, which run for up to 15 minutes.

Does a background function return my result to the browser?

No. The caller gets an empty 202 response right away, and Netlify says you generally pass the result to a destination other than the originating client, such as your database.

What do I need to give you to fix the timeout?

Repository access and a link to the Netlify site. We find which call runs long, then add timeouts or move the work to a background function, delivered as a pull request for you to review and deploy.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; we reply by email, usually within one business day.