Bolt api

Long-Running Job Timeout - Background Tasks Interrupted

Long-running operations (file processing, email sending, bulk updates) timeout. Tasks don't complete.

Operations that take >30 seconds fail on serverless deployments.

Error Messages You Might See

Operation timeout after 60 seconds Function execution terminated Task interrupted by timeout Job never completed

Common Causes

  1. Running long task synchronously in API route
  2. Serverless timeout shorter than task duration
  3. No background job queue (Bull, RabbitMQ)
  4. Task killed before cleanup code runs
  5. No retry mechanism for failed jobs

How to Fix It

Use background job queue: Bull, RabbitMQ, or cloud services (Google Tasks, AWS SQS)

Pattern: API returns immediately with job ID, frontend polls for status

Implement retry logic with exponential backoff

Add timeout to job: if not complete in 5 min, mark failed and retry

Process jobs outside request context: cron job, worker service, or queue consumer

Real developers can help you.

Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Matt Butler Matt Butler Software Engineer @ AWS Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. Tejas Chokhawala Tejas Chokhawala Full-stack engineer with 5 years experience building production web apps using React, Next.js and TypeScript. Focused on performance, clean architecture and shipping fast. Experienced with Supabase/Postgres backends, Stripe billing, and building AI-assisted developer tools.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How do I handle long tasks?

Queue the job, return immediately with ID. Frontend polls /api/job/id for status

What's a good job timeout?

Set longer than expected: if usually 2min, set 5min timeout. Prevents premature kills

Should I retry failed jobs?

Yes. Retry with exponential backoff: 1min, 5min, 30min. Max 3-5 retries

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help