My endpoint is being hit by my custom action twice for some reason. There’s an initial POST to my endpoint after the trigger, for which I return a 200 OK. After my 200 response, there’s another POST to my endpoint for some reason. My trigger is ‘When status changes to something’ and I’m only changing the status once. Are there any gotchas that I need to be aware of to prevent this from happening? Why would the custom action be triggered twice? Thanks!
Endpoint being hit twice even with 200 response
Hello there @shyam-ayrshare,
No gotchas here. It sounds strange.
This might be because of some other automation being triggered and changing a status column, or if you use the same endpoint for different triggers, there might be another trigger calling your action.
If none of those are the cases, we can schedule a call to see what might be happening.
Let me know!
I tried sending a 200 OK back immediately without doing anything with the POST content. In this case, I don’t see the endpoint being hit a second time, so I have a feeling it has something to do with how long my endpoint takes to return a 200 OK.
Once I get the POST content, I make 2 Monday API calls plus do some internal processing. I tried not waiting for the response of one of the Monday API calls and send a 200 OK and again, my endpoint doesn’t get hit twice. Unfortunately, since the connection is closed, the second API call doesn’t actually get run. So it does look like if my endpoint takes a certain amount of time to send a 200 OK, monday will send another POST. Have you seen this before? What would you recommend me to do in this case?
WOW nm this was totally my bad. I figured out the issue. Thanks for your response!
Hello again @shyam-ayrshare,
I am glad you found the source of the issue!
Let us know if you need anything else