> ## 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.

# Upload Knowledge Base file

> Upload a file to your Knowledge Base from within a Workflow.

Upload a file to your [Knowledge Base](https://docs.cassidyai.com/knowledge-base/overview.md) from within a [Workflow](https://docs.cassidyai.com/workflows/overview.md). Use this to automatically store trigger attachments, generated reports, exported documents, or any file output from a previous step.

**1. Add the action**

In the Workflow builder, click **+** between blocks and select **Upload Knowledge Base File** from the action library.

![Action library with Upload Knowledge Base File selected](https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-0.png?fit=max\&auto=format\&n=S3C8nlCeFAZnY2mJ\&q=85\&s=7b59f529ec0d75472e214b0117ea5352)

![Upload Knowledge Base File action added to the Workflow](https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-1.png?fit=max\&auto=format\&n=S3C8nlCeFAZnY2mJ\&q=85\&s=09b16fcf12c0e266609b8dee16439052)

**2. Enter the file name**

Specify the name for the uploaded file. You can use **#** to [insert variables](https://docs.cassidyai.com/guides/prompt-engineering.md#workflow-prompts) from previous steps or the trigger to dynamically generate the file name.

![File Name field with variable reference](https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-3.png?fit=max\&auto=format\&n=S3C8nlCeFAZnY2mJ\&q=85\&s=8d806cb22a827434ea0b821a253d380e)

**3. Select the file to save**

Choose the file source:

* **Trigger attachment** — Select files attached to email triggers or form submissions. Useful for automatically saving contracts, invoices, or reports sent via email.
* **Variable from previous step** — Use files generated by other Workflow actions, such as [Export as PDF](https://docs.cassidyai.com/reference/actions/export-as-pdf.md) or [Export as Microsoft Word Document](https://docs.cassidyai.com/reference/actions/export-as-word.md).

**4. Select the location**

Choose where in your Knowledge Base the file should be uploaded:

* **Static Folder** — Select a specific folder directly from your Knowledge Base. Best when you always upload to the same location, such as a contracts folder.

![Static Folder selection from Knowledge Base](https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-4.png?fit=max\&auto=format\&n=S3C8nlCeFAZnY2mJ\&q=85\&s=a61b16fe6f5799ea3cb812bc720150b9)

* **Knowledge Base Item Reference** — Use a variable that references a Knowledge Base folder. Useful when the destination folder is selected dynamically, such as a client folder from a trigger input.

![Knowledge Base Item Reference variable selector](https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-5.png?fit=max\&auto=format\&n=S3C8nlCeFAZnY2mJ\&q=85\&s=4d7b4cea1bd03b311af4a4d702e621b4)

* **Dynamic Path** — Specify a folder path using variables or naming conventions. Select the **Knowledge Base Collection**, then enter the **Folder Path** separated by forward slashes. Toggle **Create if Not Found** to automatically create the folder if it doesn't exist.

![Dynamic Path with Collection, Folder Path, and Create if Not Found toggle](https://mintcdn.com/cassidy/IidvkNl_ihp_r6SS/images/reference/upload-knowledge-base-file-img-6.png?fit=max\&auto=format\&n=IidvkNl_ihp_r6SS\&q=85\&s=b46056c0b81158ad1419e9ca08995c46)

## Related

* [Create Knowledge Base Document](https://docs.cassidyai.com/reference/actions/create-knowledge-base-document.md)
* [Knowledge Base overview](https://docs.cassidyai.com/knowledge-base/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.