I have created a Platform event to create/update records in a custom object.I have written a trigger on the Platform Event in the after insert scenario.This platform event is called inside another custom object's trigger handler.I am able to successfully publish the event in my trigger handler.But my platform event is never fired.I have used correct debug levels ( both for user and Automated Process).
On further investigation, I found that under Subscriptions related list on the Platform event, the State of the trigger that I wrote on Platform event, is currently suspended.Ideally, the State should be Running so that the listener of the platform event is listening to events.
I checked on the Salesforce docs to find what Suspended State means.According to the documentation:
The trigger is disconnected and can’t receive events due to lack of permissions.
What do I need to do to make sure that the State changes to Running?