@Anonymous Thanks for reaching out. You can leverage the Parse JSON action to validate if the message content is valid JSON or not.
In the below workflow I have leveraged the Parse JSON action and, in the content, I am converting my message content to base64ToString and for Schema specifying the empty JSON schema.
Now in my condition I am checking whether my Parse JSON action failed or succeeded. I have configured run after behavior on my condition, so it is executed in both failed and successful scenario of my previous Parse JSON action. For actions please refer to this action.
Syntax: actions('your action name').status
Example: actions('Parse_JSON').status
If my message content is valid JSON then the true condition will be executed and for not valid JSON false condition will be executed and you can further write your logic on true and false condition.
Let me know if you need any assistance.
Please accept as "Yes" if the answer is helpful so that it can help others in the community. If you need any help/clarification/concerns/follow up questions, then please click on "Add Comment" on my answer and provide more details.