Your code can“t finish at doPost(e) runing time response, so it make a loop. Like @TheMaster explain. Create another funcion with your code that makes the process. Consider doPost a trigger to execute a function. Learn about time triggers creation. I recomend also, you create an Id to your webhook interation. If you have a mesage from webhook that create a trigger, you dont want the trigger start twice about the same message, so you start the trigger only if the "message id" its a new message, try save the messages id on User Properties. and compare the inmediate old message with the actual trigger starter, to evitate the trigger start more than once by the same start command.