News & Announcements

Netlify launches Async Workloads: The future of durable serverless architecture

Today, we’re launching Netlify Async Workloads, which empowers developers to construct durable, event-driven workflows seamlessly on any Netlify site. Whether you’re handling AI workloads, mission-critical systems, or large batch processing, Async Workloads offers unparalleled reliability without the hassle of managing additional infrastructure, such as queues, workers, or state management.

Why does durability matter?

Transient issues are inevitable—APIs go down, systems time out, humans accidentally disable features. Businesses with critical processes need to ensure those processes run and are resilient to the unexpected. Durable workloads allow you to define the required work and will automatically continue execution if unexpected issues occur. With persisted state, it doesn’t matter how long the issue takes to resolve, the workload will continue until it is complete. Using systems designed for durable workloads removes the complexity of solving these issues yourself. Async Workloads brings durability to serverless runtimes on Netlify providing more resiliency to your business operations.

How Async Workloads on Netlify works

With Async Workloads, developers can write Async Workload functions just like serverless functions. First, define the custom events that will trigger these workloads, and any site or service can send those events to initiate the process. Netlify takes care of scaling, retries, backoff schedulers, jitter, future scheduling, and prioritization, ensuring your workloads run smoothly and efficiently.

Here’s a glimpse of creating an Async Workload function that responds to a single event:

export default asyncWorkloadFn(({eventData}) => {
    await upgrade({
        accountId: eventData.accountId,
        plan: eventData.plan
    });
});

export const asyncWorkloadConfig = {
    events: ['account.upgrade']
};

And here’s how your system will invoke that workload:

const client = new AsyncWorkloadsClient();
client.send('account.upgrade', { accountId, plan });

This setup allows your workloads to scale effortlessly, whether you need to run 1,000, 10,000, or even 100,000 concurrent processes. In case of failures, Async Workloads will automatically retry until success or until it reaches the retry limit. The state is still persisted so if it takes a week for the system to come back up, the workload will be able to start again without any data loss.

Capture complete workflows

With Async Workloads you can capture the complete story of your workflows. With real-world workflows, it’s common that they could have lots of different steps, there might be a waiting period for some, or even humans in the loop to approve work. Traditionally, this would require many systems orchestrated together to make this happen. With Async Workloads, we simply define the steps that need to run, and Async Workloads take care of the rest. Each step will run as its own isolated, durable compute step—remembering results and triggering retries for only that step. These workflows can even “sleep,” which pauses workflow execution until the future.

For example, here’s an Async Workload that is triggered when a user upgrades their plan:

export default asyncWorkloadFn(({eventData, step}) => {
     
 const account = await step.run(‘upgrade’, ()=>{  
	return upgrade({  
        accountId: eventData.accountId,  
        plan: eventData.plan  
      });  
   });  
   
   await step.run(‘provision-resources’, ()=>{  
	return provision(account);  
   });

   await step.sleep(‘delayed-message’,1 day’);

   await sendThankYouEmail();

 });

export const asyncWorkloadConfig = {  
    events: ['account.upgrade']  
};

This Async Workload function will ensure your users are upgraded, resources are provisioned, and then will wait one day to send an email. No additional systems are needed to handle orchestration. Just define your complete workflow and Async Workloads handles the rest.

Automatic retries and backoff schedules are baked in to make sure work continues and gets completed. If those defaults aren’t enough for your needs, Async Workloads gives you full control to change these settings on a per-workload basis within the asyncWorkloadConfig. This ensures that Async Workloads can meet the demands of any site’s needs.

Faster development with reliable experiences

As systems grow increasingly complex, the risk of reliability issues rises. Async Workloads addresses these challenges by allowing developers to focus on building workloads while the system handles the orchestration and lifecycle of durable computing. This results in faster delivery of value for your business and enhanced reliability from the outset.

Prevent downtime, reduce support burdens, complete transactions, and enable your developers to concentrate on creating more valuable work by leveraging Async Workloads for your most critical tasks.

Start using it today!

Embrace the future of durable, event-driven architecture with Netlify Async Workloads and transform how you build web applications.

Keep reading

Recent posts

How do the best dev and marketing teams work together?