---
title: "Try"
description: "Run a protected path, catch catchable errors, then always run cleanup."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/error/try"
---
# Try

> Run a protected path, catch catchable errors, then always run cleanup.

<block-meta block="Yes" channels="Any" folder="basic/error" group="Error" groupTo="/build/workflows/blocks/error" icon="i-lucide-shield" pipe="Input" scope="Module" tool="No" type="err.try">



</block-meta>

**Try** wraps a stretch of the graph. **Do**, **On error**, and **Always** are the same kind of branch as a [Condition](https://docs.vettero.com/build/workflows/blocks/condition/condition) true/false path (not a Lambda body). The run comes back to Try after the branch ends so **Always** and **Out** can run.

Catchable errors from Do that have no local **Error** outlet go to **On error** when it is connected. If **On error** is unused, **Always** still runs, then the error continues outward (another Try, or the run fails). Fatal errors skip **On error**, still run **Always** when possible, then stop the session.

A [Return](https://docs.vettero.com/build/workflows/blocks/module/return) inside Do or On error runs **Always** first, then ends the workflow.

## 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>
        Do
      </strong>
      
       (<code>
        try
      </code>
      
      )
    </td>
    
    <td>
      Protected body
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        On error
      </strong>
      
       (<code>
        catch
      </code>
      
      )
    </td>
    
    <td>
      Catchable errors from Do
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Always
      </strong>
      
       (<code>
        finally
      </code>
      
      )
    </td>
    
    <td>
      After Do or On error (cleanup)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues the main path after Always
    </td>
  </tr>
</tbody>
</table>

On **On error**, context includes `error` (`message`, `code`, `data`, `blockId`, `blockType`). The incoming pipe is an error snapshot: bind `pipe.error` (not `pipe.value`). Connect [Branch errors](https://docs.vettero.com/build/workflows/blocks/error/branch) here to split by code.

**Always** and **Out** keep that `error` after a catch (and on uncaught errors that skip On error). Their **pipe** is the leftover from Do or On error — not Try In, and not Always’s last block. After a successful Do that emits a value, bind `pipe.value`. After a failure, bind `pipe.error` or `error`. Unset blocks (for example Say) clear the leftover pipe; use `error` in that case.

## Use case

- Call an [API](https://docs.vettero.com/build/workflows/blocks/utility/api), and if it fails notify then continue.
- Always mark a [table](https://docs.vettero.com/data/tables) row even when the body throws or returns.

<block-page-nav>



</block-page-nav>


## Sitemap

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