I have created a Custom Notification Type called SMS Received.
I am calling it from a Flow, where I have insert the correct Id for it and provided all the params. When invoked from the Debugger, it works fine. However, when invoked from a Process triggered by a Platform event, I get an error:
Error Occurred: INVALID_TYPE: sObject type 'CustomNotificationType' is not supported.
Since it works from debugger (in Flow Builder), but not when called from a Process, I'm wondering if user context has anything to do with it? I tried without SenderId and also including the SenderId, set to the Admin's Id. Still doesn't work.
I have found in the past that if you have a Flow running, waiting for a platform event, after a month or two, it just stops and needs to be restarted. I suppose it reaches some limit on its logging. Therefore, I was trying to trigger the Flow from a Process instead, which seems more sustainable.
I changed the Flow, adding a Wait node waiting for the Platform Event that I previously had the Process waiting for. When I take the Process out of the solution, just running it from Flow, it works fine.
So the issue is, when you call the Flow from a Process, it can't access the CustomNotificationType. Must be user context related, but I'm not clear on why.