> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cassidyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Knowledge Base folder contents

> Retrieve the list of files within a Knowledge Base folder to use in a Workflow.

Retrieve the contents of a [Knowledge Base](/knowledge-base/overview) folder within a [Workflow](/workflows/overview). Returns a list of files in the folder that you can loop over or reference.

<Steps>
  <Step title="Add the action">
    In the Workflow builder, click **+** between blocks and select **Get Knowledge Base Folder Contents** from the action library.

    <Frame>
      <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-0.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=d14066bb619d208cd2ba807af51e41b7" alt="Action library with Get Knowledge Base Folder Contents selected" width="1008" height="430" data-path="images/reference/get-knowledge-base-folder-contents-img-0.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-1.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=dcba42aa722b8a04308faf611dfee5b3" alt="Get Knowledge Base Folder Contents action added to the Workflow" width="1018" height="1272" data-path="images/reference/get-knowledge-base-folder-contents-img-1.png" />
    </Frame>
  </Step>

  <Step title="Select the folder">
    Choose how to reference the Knowledge Base folder using one of three options:

    * **Static folder** — Select a specific folder directly from your Knowledge Base. Best when you always need the same folder, such as a client's document folder or a specific project directory.

    <Frame>
      <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-3.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=fbc30ef3a95e04d8abffc800b161a237" alt="Static folder selection from Knowledge Base" width="1008" height="768" data-path="images/reference/get-knowledge-base-folder-contents-img-3.png" />
    </Frame>

    * **Knowledge Base Item Reference** — Use a variable that references a Knowledge Base folder. Useful for dynamically selecting folders based on client names or project IDs from previous Workflow steps.

    <Frame>
      <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-4.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=ab2517aecfd806ff0263f3d6a2e69cda" alt="Knowledge Base Item Reference variable selector" width="1016" height="210" data-path="images/reference/get-knowledge-base-folder-contents-img-4.png" />
    </Frame>

    * **Dynamic Path** — Specify a folder path using variables or naming conventions. Select the **Knowledge Base Collection** where the folder is located, then enter the **Folder Path** separated by forward slashes. Useful for accessing folders based on dynamic inputs like client names or date-based directories.

    <Frame>
      <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-5.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=d1e1434b8bff0c9b1e038959ffdad1e2" alt="Dynamic Path with Collection and Folder Path fields" width="1000" height="530" data-path="images/reference/get-knowledge-base-folder-contents-img-5.png" />
    </Frame>
  </Step>

  <Step title="Use the folder contents in subsequent steps">
    Once configured, the following variables are available in later Workflow steps:

    * **Folder Name** — The name of the retrieved folder
    * **Link to Folder** — A direct link to the folder in the Knowledge Base
    * **Knowledge Base Item Type** — The type (e.g., Folder, Collection)
    * **Folder Contents** — A list of the item names within the folder

    <Frame>
      <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-6.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=b88128c0faea7afd697cd1a5b799b550" alt="Output variables available from Get Knowledge Base Folder Contents" width="1490" height="896" data-path="images/reference/get-knowledge-base-folder-contents-img-6.png" />
    </Frame>
  </Step>
</Steps>

<Info>
  **Common pattern: Loop + Get Knowledge Base File**

  A powerful combination is to use **Get Knowledge Base Folder Contents** with a [Loop](/reference/actions/loop) and [Get Knowledge Base File](/reference/actions/get-knowledge-base-file) to process each file in a folder individually. For example, retrieve a client folder containing multiple contracts and proposals, then loop through each document to generate summaries or extract key terms.

  1. Use **Get Knowledge Base Folder Contents** to retrieve all files in a folder
  2. Add a **Loop** action that iterates over the folder contents
  3. Within the Loop, use **Get Knowledge Base File** to retrieve each individual file's content
  4. Process each file (e.g., summarize, extract information, or analyze)

  <Frame>
    <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-8.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=492b7354959fa09b1789bb2b64cd087f" alt="Workflow showing Get KB Folder Contents feeding into a Loop" width="1012" height="808" data-path="images/reference/get-knowledge-base-folder-contents-img-8.png" />
  </Frame>

  <Frame>
    <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-9.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=03303a11198bfa0c1e6dcbbbfc3fa63f" alt="Loop action iterating over folder contents" width="1014" height="658" data-path="images/reference/get-knowledge-base-folder-contents-img-9.png" />
  </Frame>

  <Frame>
    <img src="https://mintcdn.com/cassidy/NfnWXcqF9xNMFxoX/images/reference/get-knowledge-base-folder-contents-img-10.png?fit=max&auto=format&n=NfnWXcqF9xNMFxoX&q=85&s=77f927b9d6d1e46a9669c8c71544ec2b" alt="Get Knowledge Base File inside the Loop using the current item" width="1006" height="804" data-path="images/reference/get-knowledge-base-folder-contents-img-10.png" />
  </Frame>
</Info>

## Related

* [Get Knowledge Base File](/reference/actions/get-knowledge-base-file)
* [Loop](/reference/actions/loop)
* [Knowledge Base overview](/knowledge-base/overview)
