OpenKM Documents
OpenKM Documents connects your flow to the OpenKM document management system to work with documents: upload a new one to a folder, read its properties, search documents by different criteria, move them, rename them, lock them for editing, store a new version or delete them.
To create and organise folders, use OpenKM Folders.
When to use it
- Invoices arrive by email and you want to store them in the OpenKM invoices folder.
- You want to find the documents by one author, or that contain a word, to review them.
- A flow produces a new version of a contract and you want to store it in OpenKM with a comment.
- You want to move the documents of a closed case to an archive folder.
- An AI agent needs to read a document’s properties to answer a question.
Configuration
You need an OpenKM credential with your server address, your username and your password. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The OpenKM credential used to access the system. |
| Operation (required) | What the component does. See Operations. Default: Get Properties. |
| Document UUID | The identifier or full path of the document. Required in every operation except Upload Document and Search Documents. |
| Parent Folder UUID | Only in Upload Document. The identifier of the folder where the document is stored. Required. |
| File URL | In Upload Document, the public address of the file to upload (required). In Checkin, the address of the new version’s file. In both cases it also accepts the file encoded in Base64 as a data: value. |
| Document Name | Only in Upload Document. The document’s name in OpenKM. Empty, it is taken from the file address. |
| Destination Folder | Only in Move Document. The identifier or path of the destination folder, for example /okm:root/archive. Required. |
| New Name | Only in Rename Document. The new name. The file’s original extension is always kept. Required. |
| Version Comment | Only in Checkin. An optional comment describing the changes in the version. |
| Increment | Only in Checkin. How the version number changes: 0 no change, 1 minor version (for example, from 1.0 to 1.1), 2 major version (from 1.1 to 2.0). Default: 1. |
| Limit | Only in Search Documents. Maximum number of results. Default: 10. |
| Add Search Filter | Only in Search Documents. Adds a search criterion. Each filter you choose appears as a new field with its name, where you type the value; the bin icon removes it. |
Operations
| Operation | What it does |
|---|---|
Upload Document | Uploads a file to a folder and creates it as a document. |
Get Properties | Returns the properties OpenKM keeps for a document, such as its path. |
Delete Document | Deletes a document. |
Move Document | Moves a document to another folder. |
Rename Document | Changes a document’s name. |
Checkout | Locks a document for editing. |
Checkin | Uploads the new version of a locked document, with its comment, and unlocks it. |
Cancel Checkout | Removes the lock from a document without saving changes. |
Search Documents | Searches documents with the filters you add. |
Search filters
The Add Search Filter filters use OpenKM’s names. The most common are name (document name), content (text it contains), title, author, keyword, category, folder (folder to search in), folderRecursive (true to include subfolders), mimeType (file type), lastModifiedFrom and lastModifiedTo (modification dates) and sortField with sortReverse (order of the results). In keyword, category and property you can write several values separated by commas.
Output
The Data output returns OpenKM’s answer. Search Documents returns one item per document found, with its properties. Get Properties returns the document’s properties. The other operations return OpenKM’s confirmation or a summary of what was done.
The component can also be connected to an Agent as a tool, so the agent searches or archives documents when it needs to. See Tool Mode.
Example
An accounting firm wants to store in OpenKM the invoices it receives by email.
- The flow starts with the email that carries the invoice as an attachment.
- Add OpenKM Documents with the
Upload Documentoperation. - In Parent Folder UUID enter the identifier of the invoices folder and in File URL connect the attachment’s address.
- In Document Name write the supplier’s name followed by the date.
- Connect Data to a messaging component that tells the accounting team.
Good practices
- To change a document’s content, run
Checkoutfirst and thenCheckinwith the new file. - Add only the filters you need: each filter with a value narrows the search further.
- To find a folder and its identifier, use
List Contentsin OpenKM Folders.
Related components
- OpenKM Folders: create, move, rename and list OpenKM folders.