
In general when there are only a few child records it's not a problem using a loop inside a plugin. But if you have a bunch of child records it can exceed the execution timout of 2 minutes. As far as I know processes with a long runtime should be excluded from plugins and webhooks should be used instead. Are there any other methods to avoid timeouts in this scenario?
Hello,
You can implement your plugin as an azure function. You can configure Dynamics 365 to call your azure function webhook using Plug-in Registration tool. Please refer to this great blog, it explains the whole process to create your first plugin as an azure function.
https://us.hso.com/blog/writing-microsoft-dynamics-365-plug-ins-in-azure-functions/