How do FilePicker works?

My team and I are currently working with Camunda 8 (self-managed Zeebe instance 8.7.7), using the “in-memory” file storage approach. We’re trying to enable a Tasklist user to upload a file through the “File Picker” form element.

During our testing, we observed that the file upload returns a JSON containing the file’s metadata, as described in the documentation.

However, we haven’t been able to retrieve the uploaded file afterward. We’ve tried the following:

  1. Using the REST API – The engine responds that the document with the given ID (automatically assigned) does not exist.
  2. Using the file as an email attachment – The connector fails to recognize the file.

Are we missing something? Also, how does uploading a file via a form differ from uploading a file via the REST API?

Hi there! :waving_hand:

Great question about FilePicker functionality in Camunda 8! Based on your setup with self-managed Zeebe 8.7.7 and in-memory file storage, I can help explain what’s happening and how to properly retrieve your uploaded files.

How FilePicker Works

When a user uploads a file through the FilePicker form element, here’s what happens:

  1. File Upload: The file gets stored in your configured document store (in-memory in your case)
  2. Metadata Return: The FilePicker returns a JSON array containing metadata and a documentId:
    [
      {
        "documentId": "u123",
        "endpoint": "https://api.example.com/documents/u123",
        "metadata": {
          "fileName": "Document.pdf",
          "contentType": "application/pdf"
        }
      }
    ]
    
  3. Variable Storage: This metadata (not the file content) gets stored in your process variable

Retrieving Uploaded Files

To retrieve the actual file content, you need to use the documentId with the REST API:

curl --location '<your_cluster_endpoint>/v2/documents/{documentId}' \
  --header 'Authorization: Bearer <your_token>'

Important: The process variable only contains the file reference, not the actual file content. You must fetch the content separately using the document ID.

Potential Issues with In-Memory Storage

Here’s likely what’s causing your problems:

1. Component Isolation

In Docker Compose or multi-component setups, in-memory storage is not shared between components. If Tasklist stores the file in its in-memory store, Zeebe or other components can’t access it. This could explain why the REST API says the document doesn’t exist.

2. Development-Only Limitation

In-memory storage is intended only for development and testing. Files are:

  • Lost when the application restarts
  • Not persisted to disk
  • Not shared between different components

3. File Retrieval for Connectors

For email attachments or other connectors, you need to:

  1. Retrieve the file content using the REST API
  2. Encode it (e.g., base64) if needed
  3. Pass the encoded content to your connector

Camunda doesn’t automatically convert file references to content for connectors.

Form Upload vs REST API Upload

Both methods store files in the same document store and work similarly:

Aspect Form Upload (FilePicker) REST API Upload
Storage Document store (in-memory) Document store (in-memory)
Returns Metadata in process variable Metadata in API response
Retrieval Use documentId with /v2/documents/{id} Use documentId with /v2/documents/{id}
Content Reference only, not file content Reference only, not file content

Recommendations

  1. For Production: Switch from in-memory to a persistent document store (file system, cloud storage, etc.)
  2. For Testing: Ensure all components use the same document store configuration
  3. For File Access: Always use the REST API with the documentId to retrieve file content
  4. For Connectors: Fetch and encode file content before passing to connectors

References

Does this help explain the behavior you’re seeing? Let me know if you need clarification on any part!

Thank you for the in-depth response!