Coroutine and withContext or not when using Webclient or AWS Async

What is the best practice when i am using coroutines together with for example Spring-Boots WebClient or AWS DynamoDbEnhancedAsyncClient. Both are easy to use in suspend function but i am unsure if i should put them into an other Dispatcher or if i should run them in the global one. Most examples in the internet are executing them in the global scope without the “withContext”. But some documentations are saying “do IO stuff using the IO disopatcher”.

And maybe an other question in the same direction. I have an other method rendering a PDF document what uses a lot of CPU and Memory and takes up to one second. Is it okay to do that in the global or should i also put that into an other dispatcher?

Thanx a lot

Should i simply do this:

suspend fun findById(contractId: ContractId): Contract? {
  return contractsTable.getItem { request ->
    request
      .consistentRead(true)
      .key { key -> key.partitionValue(contractId) }
  }.await()
}

or should i use the IO context like:

suspend fun findById(contractId: ContractId): Contract? = withContext(Dispatchers.IO) {
  contractsTable.getItem { request ->
    request
      .consistentRead(true)
      .key { key -> key.partitionValue(contractId) }
  }.await()
}