@Corey Egan I don’t think you are going to be able to get around the default 5s time with a Webhook action. There are a couple of ways to go about resolving this:
- Work with the platform you are sending the data to and see if they can optimize their endpoint to provide a response in a more reasonable time
- Segment events have a message ID so see if the endpoints have the ability to dedupe events based on this value
- Instead of using the Webhook, create a destination function so that you have more control over the request and response and when to “retry” events.
Hey @Corey Egan - I raised this to our support engineering team to take a look.
Closing the loop here with the ticket response from our Support Eng team:
“For more context on this topic, each time a Destination Function is invoked, it has 5 seconds to complete, otherwise the entire function for that event will be retried. So, if the function takes longer than 5 seconds to complete, then it would be retried until it received a success response from the destination. Our retry feature sits after functions and the rates cannot be modified since it works the same for all destinations. Functions also have a timeout of 5 seconds, and I'm afraid this is a hard limit that cannot be modified.
Additionally, the most common cause for timeouts are multiple requests sent in sequentially, instead of in-parallel, or an external fetch
call taking too long to return a response.
You can use the Tester Feature in the editor to determine the duration of your external requests.
I recommend checking this section of our docs explaining how to improve the speed of external requests: Improving Speed of External Requests.”
Destination functions FAQs
Does Segment retry failed function invocations?
Yes, Segment retries invocations that throw RetryError or Timeout errors (temporary errors only). Segment’s internal system retries failed functions API calls for four hours with a randomized exponential backoff after each attempt. This substantially improves delivery rates.
Retries work the same for both functions and cloud-mode destinations in Segment.
https://hookdeck.com is what you need. They’ll accept the webhook and pass it along to your destination.