The specific subflow can be used as a webhook endpoint (/events
) for getting notifications from a Minio installation and automating the enrichment of a newly inserted object with metadata.
It filters notification messages based on new objects put but also if they already have the specific metadatum needed. This is because the flow puts the object again with the new metadata, so it creates a new notification and thus an infinite loop if this comparison is not made.
The flow requires the node-red collection @reggae_ulli/node-red-contrib-minio-all-fix
for the interface with the Minio server.
The user can configure which metadata field this skip comparison can be performed in the relevant switch node 'if already has metadata skip'
.
The user also needs to configure the details of the minio instance in the minio nodes.
The flow shows an example of getting a csv file with columns id
and value
and extracting the min and max of the column name set in the flow UI (default: value
). The user can change this in the function node 'calc and add metadata', where the relevant logic can be adapted.
This is not the most performing way to do this automation, since it doubles the transfers to Minio (needs to get the object, calculate the values and then put it back). In the future the flow will be updated to use the copyObject method of minio that can change only the metadata of the file without putting it back.