Netlify Functions

Build scalable,
dynamic applications

Deploy server-side code that works as API endpoints, runs automatically in response to events, or processes more complex jobs in the background.

How it works

Example use cases

Explore on the Netlify Functions Playground

Get shorter build times and faster page load speeds with On-demand Builders.

Learn More

All part of one amazing workflow

Manage everything in one project

Netlify Functions are files you write in JavaScript, TypeScript, or Go and then place inside your project under the path netlify/functions. (Easy, right? You can even configure that.)

Normally, functions are synchronous with a maximum execution time of 10 seconds. But, adding -background to the end of the filename transforms any function into an asynchronous function that can run in the background with up to 15 minutes of runtime.

Build & test locally

You can use Netlify CLI to run a local development server that you can share with others, run a local build and plugins, and deploy your site.

The 2.0 version of our Node-based CLI was rebuilt from the ground up to help improve the site building experience.

Authorize Application Netlify CLI is asking for permission to access Netlify on your behalf. Authorize Deny ◈ Netlify Dev ◈ ◈ Functions server is listening on 56302 ---------------------------------- Local: http://localhost:8080 External: http://192.168.7.47:8080 ----------------------------------

Deploy backend functions & frontend code together

Atomically deploy your sites and apps, pushing frontend code and backend functions together, as a unit, without even requiring a maintenance window.

production Running in . Endpoint: https://site-name.netlify.app/.netlify/functions/name Function [name] Preview deploy Logs retention: Your logs are retained for an hour [] = = = = FunctionscommandpublishNODE_ENV build “functions-build” “yarn run build” “dist” “8.11.3”

Stage, preview, and rollback

Netlify Functions share all of Netlify’s beloved workflow features. Preview every commit with Deploy Preview links. Rollback when needed by simply clicking a prior deployment.

Netlify bot commented 1 day ago Deploy preview for ready! project-name Built with commit https://deploy-preview-3766--www.project-name.app ebc850e https://dpc.project-name.app/deploy-preview-3766... Leave feedback: Merge pull request

Run A/B testing and phased rollouts

Deploy and test multiple branches, and even control which users see which version. Plan full experiments and rolling upgrades that include both front and backend code changes. A/B test not just a button color, but an entire user workflow.

Test #1 Running the beach Branch 75% Split master Branch 25% Split
Authorize Application Netlify CLI is asking for permission to access Netlify on your behalf. Authorize Deny ◈ Netlify Dev ◈ ◈ Functions server is listening on 56302 ---------------------------------- Local: http://localhost:8080 External: http://192.168.7.47:8080 ---------------------------------- production Running in . Endpoint: https://site-name.netlify.app/.netlify/functions/name Function [name] Preview deploy Logs retention: Your logs are retained for an hour [] = = = = FunctionscommandpublishNODE_ENV build “functions-build” “yarn run build” “dist” “8.11.3” Netlify bot commented 1 day ago Deploy preview for ready! project-name Built with commit https://deploy-preview-3766--www.project-name.app ebc850e https://dpc.project-name.app/deploy-preview-3766... Leave feedback: Merge pull request Test #1 Running the beach Branch 75% Split master Branch 25% Split

New

Export traffic and functions logs

Send traffic and functions data to your favorite log management service for cold storage, troubleshooting, monitoring, and alerting with Log Drains. Available today on Enterprise plans.

Learn more

The different flavors of compute on Netlify

Netlify provides developers several powerful tools to make websites and web applications both extremely performant and highly dynamic.

A comparison table for the different flavors of compute on Netlify

Memory

Execution limit

Where it runs

Language

Serverless functions for Real-time compute
Memory
1024MB
Execution limit
10 seconds
Where it runs
AWS Lambda
Language
JavaScript, TypeScript, or Go
Background Functions for long-running tasks
Memory
1024MB
Execution limit
15 minutes
Where it runs
AWS Lambda
Language
JavaScript, TypeScript, or Go
Edge Functions for fast personalization
Memory
512MB
Execution limit
50ms
Where it runs
Deno runtime at network edge
Language
JavaScript or TypeScript
Build-time compute for prerendering pages in advance
Memory
6 - 36GB Up to 10 vCPUs
Execution limit
15 minutes
Where it runs
In our build environment
Language
Almost any language
New! On-demand rendering of pages & assets for large sites
Memory
1024MB
Execution limit
10 seconds
Where it runs
AWS Lambda
Language
JavaScript or TypeScript
Maciej Malesa

Moving all LiveChat websites to Netlify has empowered our Web Dev Team to iterate fast and independently.

Maciej Malesa, CTO, LiveChat

Pricing for Netlify Functions

Netlify Functions are free to try and available as soon as you activate your account. Pricing scales as your usage grows—from small projects to fully customized enterprise plans.

Functions pricing table

Level 0 $0

Level 1 $25 per site /month

Level 2 included with Enterprise plan

Requests /month
125,000
2 million
Unlimited(Fair use. For how this is defined for Functions contact Sales)
Run time /month
100 hours
1,000 hours
Unlimited(Fair use. For how this is defined for Functions contact Sales)
Persistent pages or assets
Generated by On-demand Builders
10,000
10,000
10,000(Higher limits available for Enterprise)
Background Functions
Available on Pro plans and above
Yes
Yes
Yes
Deploy to custom AWS account
No
No
Yes
Extras
No
Add packs of 500,000 requests and 500 runtime hours $19/each
Edge Functions
Invocations /month
1 million(then $2 per 1m)
2 million(Pro plan only, then $2 per 1m)
5 million (then $2 per 1m, for higher usage - contact Sales)

Functions pricing table

Level 0 $0

Requests /month
Run time /month
Persistent pages or assets
Background Functions
Deploy to custom AWS account
Extras
Edge Functions

Level 1 $25 per site /month

Requests /month
Run time /month
Persistent pages or assets
Background Functions
Deploy to custom AWS account
Extras
Edge Functions

Level 2 included with Enterprise plan

Requests /month
Run time /month
Persistent pages or assets
Background Functions
Deploy to custom AWS account
Extras
Edge Functions

Keep exploring the Netlify Platform

  • Netlify Workflow

    Netlify Workflow

    Work as a team, right in Git. Netlify neatly deploys every resource to the right place, from global static assets to serverless functions.

  • Netlify Build

    Netlify Build

    The Git workflow for web development. Build, deploy, and manage modern web projects.

  • Netlify Edge

    Netlify Edge

    A fast, resilient network for web apps. Connected to your development workflow and designed to handle the most complex tasks - or even to run your own custom logic.

  • Addons & Integrations

    Addons & Integrations

    Add powerful capabilities to every build and integrate easily with other SaaS services. Find the plugins you need from the community or even create your own.