What is Timeout?

A maximum time something may take before it is stopped.

Where Timeout goes wrong in real apps

Each of these is a short scenario built from a real failure in an app made with AI. Read the answer here, or walk through it yourself in about four minutes.

  • Launch day · 4 minutes · Pro

    The 504 at second 60

    Generating a long AI report works on your laptop. In production, where the route's time limit is set to 60 seconds, big reports fail with '504 Gateway Timeout'.

    Why do I get a 504 timeout only in production?

    Hosted serverless functions stop at a set time limit, while your laptop has none. Long AI calls, imports or file processing exceed it and return 504 Gateway Timeout. Streaming improves the wait but still counts toward the limit; move long tasks to a background job that reports progress.

    Read the fix
Endpoint
One specific address on your server that does one job, like /api/invoices. Each one needs its own safety checks.
Request
A message your browser (or any program) sends to a server asking for something: 'give me invoice 105' or 'save this profile'.
Response
The server's reply to a request: the data, plus a status code saying whether it worked.
Production
The real, live version of your app that customers use, as opposed to the copy on your laptop.
Serverless function
A piece of server code that starts for each request and stops soon after. You pay per use, and it has time and size limits.
Cron job
Work that runs on a schedule or in the background, instead of while someone waits for a page.

All 62 terms in the glossary

Before you go

Get the next trail by email

Five short lessons on what breaks in apps built with AI and how to check yours, then one email each time a new trail ships. Unsubscribe in one click.