> ## 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](/knowledge-base/overview) from within a [Workflow](/workflows/overview). Use this to automatically store trigger attachments, generated reports, exported documents, or any file output from a previous step.

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

    <Frame>
      <img src="https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-0.png?fit=max&auto=format&n=S3C8nlCeFAZnY2mJ&q=85&s=7b59f529ec0d75472e214b0117ea5352" alt="Action library with Upload Knowledge Base File selected" width="970" height="720" data-path="images/reference/upload-knowledge-base-file-img-0.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-1.png?fit=max&auto=format&n=S3C8nlCeFAZnY2mJ&q=85&s=09b16fcf12c0e266609b8dee16439052" alt="Upload Knowledge Base File action added to the Workflow" width="1030" height="1586" data-path="images/reference/upload-knowledge-base-file-img-1.png" />
    </Frame>
  </Step>

  <Step title="Enter the file name">
    Specify the name for the uploaded file. You can use **#** to [insert variables](/guides/prompt-engineering#workflow-prompts) from previous steps or the trigger to dynamically generate the file name.

    <Frame>
      <img src="https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-3.png?fit=max&auto=format&n=S3C8nlCeFAZnY2mJ&q=85&s=8d806cb22a827434ea0b821a253d380e" alt="File Name field with variable reference" width="1008" height="236" data-path="images/reference/upload-knowledge-base-file-img-3.png" />
    </Frame>
  </Step>

  <Step title="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](/reference/actions/export-as-pdf) or [Export as Microsoft Word Document](/reference/actions/export-as-word).
  </Step>

  <Step title="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.

    <Frame>
      <img src="https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-4.png?fit=max&auto=format&n=S3C8nlCeFAZnY2mJ&q=85&s=a61b16fe6f5799ea3cb812bc720150b9" alt="Static Folder selection from Knowledge Base" width="1004" height="762" data-path="images/reference/upload-knowledge-base-file-img-4.png" />
    </Frame>

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

    <Frame>
      <img src="https://mintcdn.com/cassidy/S3C8nlCeFAZnY2mJ/images/reference/upload-knowledge-base-file-img-5.png?fit=max&auto=format&n=S3C8nlCeFAZnY2mJ&q=85&s=4d7b4cea1bd03b311af4a4d702e621b4" alt="Knowledge Base Item Reference variable selector" width="1010" height="220" data-path="images/reference/upload-knowledge-base-file-img-5.png" />
    </Frame>

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

    <Frame>
      <img src="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" alt="Dynamic Path with Collection, Folder Path, and Create if Not Found toggle" width="1002" height="650" data-path="images/reference/upload-knowledge-base-file-img-6.png" />
    </Frame>
  </Step>
</Steps>

## Related

* [Create Knowledge Base Document](/reference/actions/create-knowledge-base-document)
* [Knowledge Base overview](/knowledge-base/overview)
