Background Functions overview

This feature is in BETA and may not be available on all plans.

Netlify’s Background Functions allow you to set up serverless function processes that run longer than 10 seconds and up to 15 minutes. For tasks like batch processing, scraping, and slower API workflow execution, they may be a better fit than synchronous serverless functions.

These longer-running functions are processed as background tasks through AWS Lambda using asynchronous invocation. This means that when a function is invoked, it’s added to a queue instead of being processed immediately. There is an initial 202 success response when a function is queued. If function execution returns an error, AWS will retry the execution after one minute. If it fails again, another retry happens two minutes later. When a background function is successfully executed, you generally pass the result to a destination other than the originating client.

Like all Netlify Functions, background functions are version-controlled, built, and deployed along with the rest of your Netlify site. You can configure and monitor them along with your other serverless functions. You can build background functions in JavaScript, TypeScript, or Go.