JavaScript Promise allSettled() Method

Beginner
6 min read
Updated: Nov 2026
3 examples
Static method

Definition

Promise.allSettled(promises) waits until every promise in the list has settled, fulfilled or rejected, and then fulfills with an array of result objects in input order. A fulfilled entry looks like { status: 'fulfilled', value }; a rejected one looks like { status: 'rejected', reason }. Because failures become entries in the report, the returned promise never rejects.

Remember
Promise.allSettled([a, b])  -> one promise, never rejects

{ status: 'fulfilled', value: ... }
{ status: 'rejected',  reason: ... }

results keep input order
[] -> fulfills with []

Syntax

Call it on Promise with an array (or any iterable) of promises.

JavaScript
Promise.allSettled(iterable)
const results = await Promise.allSettled(iterable);
CallWhat it does
Promise.allSettled([p1, p2])Wait for both to settle; get two result objects.
results.filter((r) => r.status === 'rejected')Keep only the failures; read r.reason.

A static method added in ES2020. Like Promise.all(), it only waits; the tasks were already running.

Library declarations
JavaScript
Promise.allSettled(iterable)   // returns a Promise

// always fulfills with an array of objects (input order):
//   { status: "fulfilled", value: <value> }
//   { status: "rejected",  reason: <reason> }

Parameters

ParameterDescription
iterableAn array (or other iterable) of promises. Plain values are treated as already fulfilled.

Return Value

Return ValueDescription
PromiseFulfills, after every input has settled, with one { status, value } or { status, reason } object per input.

JavaScript Examples

Example 1 — A Health Check Report

Three system checks run together. One fails, but you still want to see all three results.

JavaScript
const checks = [
  Promise.resolve('database ok'),
  Promise.reject(new Error('cache offline')),
  new Promise((resolve) => setTimeout(() => resolve('disk ok'), 30))
];

Promise.allSettled(checks).then((results) => {
  results.forEach((result, i) => {
    if (result.status === 'fulfilled') {
      console.log(i + ': fulfilled -> ' + result.value);
    } else {
      console.log(i + ': rejected -> ' + result.reason.message);
    }
  });
});
Try It Yourself

How It Works

  1. A rejected promise in the list. Promise.reject() fails right away. It is not reported as unhandled, because allSettled attaches its own handler in the same moment.
  2. Wait for the slowest check. The disk check takes 30 ms. allSettled waits for it, even though the cache check has already failed.
  3. Branch on status. Each result object has a status. Fulfilled entries carry value; rejected entries carry reason, here an Error whose message we wrote.

Example 2 — allSettled() Compared with all()

The same three jobs, one of which breaks, given to both methods.

JavaScript
function makeJobs() {
  return [Promise.resolve(1), Promise.reject(new Error('job 2 broke')), Promise.resolve(3)];
}

Promise.allSettled(makeJobs()).then((results) => {
  console.log('allSettled: ' + results.map((r) => r.status).join(', '));
  console.log('values: ' + results.map((r) => (r.status === 'fulfilled' ? r.value : '-')).join(', '));
});

Promise.all(makeJobs())
  .then(() => console.log('all: fulfilled'))
  .catch((error) => console.log('all: rejected (' + error.message + ')'));
Try It Yourself

How It Works

  1. Fresh jobs for each call. makeJobs() builds a new array each time, so both methods see the same situation: jobs 1 and 3 succeed, job 2 fails.
  2. allSettled() reports. Promise.allSettled fulfills with all three outcomes, so you can still use the two values that arrived and see which job failed.
  3. all() gives up. Promise.all rejects with the error from job 2, so the values 1 and 3 are lost and only catch runs.

Example 3 — Split Uploads into Successes and Failures

With await, the result array is easy to filter. Files ending in .exe are refused.

JavaScript
function upload(name) {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      if (name.endsWith('.exe')) reject(new Error(name + ' is not allowed'));
      else resolve(name + ' uploaded');
    }, 30);
  });
}

async function uploadAll(files) {
  const results = await Promise.allSettled(files.map(upload));
  const ok = results.filter((r) => r.status === 'fulfilled').map((r) => r.value);
  const failed = results.filter((r) => r.status === 'rejected').map((r) => r.reason.message);
  console.log('uploaded: ' + ok.length + ', failed: ' + failed.length);
  failed.forEach((message) => console.log('  ' + message));
  console.log(JSON.stringify(ok));
}

uploadAll(['cat.png', 'setup.exe', 'notes.txt']);
Try It Yourself

How It Works

  1. No try/catch needed. Because allSettled never rejects, the await line cannot throw because of a failed upload.
  2. Filter by status. One filter() keeps the fulfilled entries and reads value; the other keeps the rejected entries and reads reason.message.
  3. Report both groups. The user learns that two files worked and exactly which file was refused, instead of a single error for the whole batch.

Browser & Runtime Support

Promise.allSettled() was added in ES2020.

✓ Widely available · ES2020

Promise.allSettled()

Supported in all current browsers and in Node.js 12.9 and newer. The examples were run on Node.js 24.

Wide All current browsers
Google Chrome Chrome 76+
Supported
Mozilla Firefox Firefox 71+
Supported
Apple Safari Safari 13+
Supported
Microsoft Edge Edge 79+
Supported
Node.js Node.js 12.9+
Supported
Deno Recent versions
Supported
Internet Explorer No support
Not supported
Promise.allSettled() Very good

Bottom line: Safe for current browsers. Very old browsers (before 2019 or 2020) need a polyfill or a small helper that maps each promise with then and catch.

Frequently Asked Questions

Not because of the promises you pass in. It waits for all of them and fulfills with a report, even if every one of them rejected.
An object with a status property. Fulfilled entries are { status: "fulfilled", value }, rejected entries are { status: "rejected", reason }.
Promise.all rejects as soon as one promise rejects and loses the other values. allSettled always waits for every promise and tells you how each one ended.
Filter the results for status === "fulfilled" and map each entry to its value property.
On success they finish together. On failure, allSettled still waits for the slowest task; Promise.all stops at the first rejection.

Next: Promise.any()

Take the first promise that succeeds and ignore the failures before it.

any() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful