If a workflow waits with workflow.wait(), how to handle workflow task timeout

Hi,

I have a workflow with a while loop that makes an API call, batches the results, and then waits (workflow.wait()) for the batch to complete (which takes around 5-15 seconds, possibly longer).

However, I’m seeing a “Workflow Task Timed Out” error. I understand that the workflow task timeout is set to 10 seconds, but since I’m using workflow.wait(), shouldn’t there be a way to prevent the task timeout?

Could you help me understand why this is happening?

I have a workflow with a while loop that makes an API call,

you should not call any downstream apis in workflow code, do it from activities / local activities only.

can you show your code and your json event history, so can better understand question please?