---
title: "Async"
description: "Run nested tasks in parallel, then settle with all, any, or all-settled."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/utility/async"
---
# Async

> Run nested tasks in parallel, then settle with all, any, or all-settled.

<block-meta block="Yes" channels="Any" folder="basic/utility" group="Utility" groupTo="/build/workflows/blocks/utility" icon="i-lucide-loader" pipe="Value" scope="Any" tool="No" type="utl.async">



</block-meta>

**Async** starts several nested bodies at once, waits according to **Strategy**, then continues. **Tasks**, **Resolve**, **Reject**, and **Finally** are **new callback scopes**. Connect each one to a [Lambda](https://docs.vettero.com/build/workflows/blocks/module/lambda) block, the same way as a [loop](https://docs.vettero.com/build/workflows/blocks/loops) **Callback**.

A [Return](https://docs.vettero.com/build/workflows/blocks/module/return) inside a task returns that task’s result, not the whole workflow.

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Strategy
      </strong>
    </td>
    
    <td>
      <strong>
        All
      </strong>
      
       — wait until every task succeeds; fail if any task fails. <strong>
        Any
      </strong>
      
       — succeed when the first task succeeds; fail only if every task fails. <strong>
        All settled
      </strong>
      
       — wait for every task and collect both successes and failures
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues on the main path after settle
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Tasks
      </strong>
    </td>
    
    <td>
      <strong>
        New callback scope
      </strong>
      
       — one nested body per connected task. Connect to <a href="https://docs.vettero.com/build/workflows/blocks/module/lambda">
        Lambda
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Resolve
      </strong>
    </td>
    
    <td>
      <strong>
        New callback scope
      </strong>
      
       when settle succeeds
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Reject
      </strong>
    </td>
    
    <td>
      <strong>
        New callback scope
      </strong>
      
       when settle fails
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Finally
      </strong>
    </td>
    
    <td>
      <strong>
        New callback scope
      </strong>
      
       that always runs after settle
    </td>
  </tr>
</tbody>
</table>

Inside each **Tasks** body, `args` holds that task’s arguments. End the body with [Return](https://docs.vettero.com/build/workflows/blocks/module/return) so Async can collect a value.

## Pipe schema

The next block on the main **Out** reads this on the data pipe (`pipe.value`). The value is an object:

<table>
<thead>
  <tr>
    <th>
      Key
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        result
      </code>
    </td>
    
    <td>
      any
    </td>
    
    <td>
      Settled payload (shape depends on <strong>
        Strategy
      </strong>
      
       and what the bodies return)
    </td>
  </tr>
</tbody>
</table>

## Use case

- Fan out several [API](https://docs.vettero.com/build/workflows/blocks/utility/api) calls, then continue when **All** succeed.
- Race two lookups with **Any**.
- Always log or notify in **Finally**, including after **Reject**.

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
