Skip to content

M-Files

M-Files connects your flow to a vault of the M-Files document management system. With it you can search objects, upload new documents, download a document’s file, lock a document to edit it and unlock it with a new version, or delete it.

Use it when your company’s documents are stored in M-Files and you want a flow to archive or retrieve them without anyone doing it by hand.

When to use it

  • Signed contracts arrive by email and you want to upload them to M-Files with their title.
  • An AI agent needs to find a document by its name and read its content to answer.
  • You want to download a report from M-Files to send it by email or summarise it.
  • A flow produces a new version of a document and you want to store it in M-Files with a change comment.
  • You want to delete documents that are no longer needed.

Configuration

You need an M-Files credential with your server address, your username, your password and the vault’s identifier (GUID). See Credentials.

FieldWhat it does
Credential (required)The M-Files credential used to access the vault.
Operation (required)What the component does. See Operations.
Search ByOnly in Search Objects. By Name searches by text; By ID returns one specific object by its number. Default: By Name.
Search QueryOnly in Search Objects with By Name. The text to look for in the objects’ data. Required in that case.
LimitOnly in Search Objects with By Name. Maximum number of results. Default: 10.
ModeIn the operations that work on an existing object. Custom: you type the object’s number in Object ID. Dynamic: you pick the object from the Object list, loaded from the vault. Default: Custom.
Object TypeThe M-Files object type, for example Document (0). The list is loaded from your vault. It appears in the operations that work on an object and in Search Objects with By ID.
Object IDThe object’s number in M-Files. Required with Mode set to Custom and in Search Objects with By ID.
ObjectWith Mode set to Dynamic. The list of objects of the chosen type, to select one without knowing its number.
File IDOnly in Download Document. The file to download, if the object has several. Empty, the first one is downloaded.
File URLRequired in Upload Document and Check In. The address of the file to upload, or the file encoded in Base64 as a data: value.
Document TitleOnly in Upload Document. The title of the new document in M-Files. Empty, the file name is used.
Check-in CommentOnly in Check In. An optional comment describing the changes in the new version.

Operations

OperationWhat it does
Search ObjectsSearches objects by text or returns one by its number, with its properties.
Upload DocumentUploads a file and creates a new document with it in the vault.
Download DocumentDownloads a document’s file.
Check OutLocks an object for editing, so nobody else can change it in the meantime.
Check InReplaces the file of a locked object with a new one, saves the comment and unlocks it.
Cancel Check OutRemoves the lock from an object without saving changes.
Delete ObjectDeletes an object. If it was locked, the lock is removed first. The object moves to the vault’s deleted view.

Output

The Data output returns M-Files’ answer. Search Objects returns one item per object found, with its properties. Download Document returns the file encoded in Base64, together with its name and type, ready to pass to a component that reads or attaches it. The other operations return M-Files’ confirmation.

The component can also be connected to an Agent as a tool, so the agent searches or downloads documents when it needs them. See Tool Mode.

Example

A law firm wants to archive in M-Files the contracts that clients send back signed.

  1. The flow starts with the email that carries the contract as an attachment.
  2. Add M-Files with the Upload Document operation.
  3. In File URL connect the attachment’s address and in Document Title write Contract followed by the client’s name.
  4. Connect Data to a messaging component that tells the person in charge that the contract is archived.

Good practices

  • To change a document’s content, run Check Out first and then Check In with the new file.
  • Use Mode set to Dynamic while you test the flow, to pick the object from the list. When the object’s number comes from an earlier step, use Custom.
  • If the Object Type list does not load, check that the credential is correct and reload it with the refresh button.