What is the best way to have an http post within an activity?

Hello! I am new to temporal and trying out couple of things before completely adopting. What is the best way to have a http post within an activity considering activity needs to be idempotent.

We make a http post call to a third party service and do some processing with the result. If the activity is interrupted, because of some reason - exception in the code, a signal comes in or some other reason, how to properly structure this so that we don’t make the post call which yields different results every time? Any help/ideas would be really helpful. Just a rough idea of the method

@WorkflowMethod
void doThis(){
final var response = thirdPartyClient.updateThat();
//doSomething with the response.
}

The snippet you posted uses the third-party client directly from the workflow code. This is not allowed as calls to external services should happen in activities.

There is no way to implement an idempotent activity that calls a nonidempotent API. This is not Temporal specific but applies to any distributed system.