---
title: "Get Datasource"
description: "Fetch a knowledge-base datasource by ID."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/kb/get-datasource"
---
# Get Datasource

> Fetch a knowledge-base datasource by ID.

<block-meta block="Yes" channels="Any" folder="kb" group="Knowledge Base" groupTo="/build/workflows/blocks/kb" icon="i-lucide-file-search" pipe="Value" scope="Any" tool="Yes" type="kb.get-datasource">



</block-meta>

**Get Datasource** (canvas label **KB Get Datasource**) loads one datasource from a [knowledge base](https://docs.vettero.com/data/knowledge-bases), including processing **status** and **progress**.

## Configure

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

<tbody>
  <tr>
    <td>
      <strong>
        Knowledge base
      </strong>
    </td>
    
    <td>
      Store that owns the datasource (required)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Datasource ID
      </strong>
    </td>
    
    <td>
      Datasource to load (required)
    </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 after the datasource is loaded
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`). The value is a datasource object:

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

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Datasource id
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <code>
        structured
      </code>
      
       or <code>
        unstructured
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        content
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Stored content reference
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        addedAt
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      When it was added
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Processing status
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        processedAt
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      When processing finished, if done
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Error message when processing failed
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        progress
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Progress text while processing
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        file
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      File id when set
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Source URL when set
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        config
      </code>
    </td>
    
    <td>
      object
    </td>
    
    <td>
      Extra ingestion settings
    </td>
  </tr>
</tbody>
</table>

## Use case

- Wait until an [Add Datasource](https://docs.vettero.com/build/workflows/blocks/kb/add-datasource) or [Refresh Datasource](https://docs.vettero.com/build/workflows/blocks/kb/refresh-datasource) job finishes before querying.
- Surface `error` in chat when ingestion fails.

<block-page-nav>



</block-page-nav>


## Sitemap

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