Does temporal update the DB multiple times during retry if API call fails

Hi,
We have an application that creates and approves orders or rejects. When an order is created, a workflow is created and an entry is created in the DB table. If a user approves the order, an API call is made to the order service and then the DB is updated. What happens if the API call fails? Does it update the DB multiple times?
Thanks

What happens if the API call fails? Does it update the DB multiple times?

I assume you are making this api call from an activity.
With Temporal activities have a default retry policy which does not restrict retry attempts. Each activity retry is a new activity invocation.

If the order service api is not idempotent and your activity can fail on different error codes returned by the order service you might have to bake this into the activity code, for example before updating the db check if it has been done already, if so you can just complete the activity.

Thank you @tihomir