@FZK i would suggest following:
1. Create a SharePoint list which stores all the keywords and the location of folders where the documents related to that keyword are stored, so SharePoint list will have two columns one Title column which you can rename to Keyword, and one more single line text column called Folder path which will point to folder in document library for this keyword, below is example data of the list
| Keyword (Title) | Folder Path |
CN001 | Documents/CN001 |
CN002 | Documents/CN002 |
1. Then create a flow with the trigger when new email arrives in shared mailbox
2. In the flow add Get Items action to get data from the list that you created as per above instructions
3. Then add filter array action to see which keyword from the list does the email contain, use below condition in filter array action
contains(triggerBody()?['Subject'], item()?['Title'])
4. Add condition action, and use following expression on left side of condition and add expressions "true" in right side of condition and select equals to from dropdown
empty(body('Filter_Array'))
5. In Yes branch of condition add Compose action and use following expression to get the folder path in which the attachments are to be saved
body('Filter_Array')?[0]['FolderPath']
6. Further create another flow with template "https://powerautomate.microsoft.com/en-US/templates/details/f7a46809e53c42108034e56acf83bb79/save-my-email-attachments-to-a-sharepoint-document-library/" to know the steps on how to save attachments to document library. Note this another flow will only be used for reference for you to know actions to configure for saving attachments to library, later on your can delete this another flow. Use the folder path in Create file action to save attachments to given folder path of the keyword