Best way to support a long-running Activity without running into an Activity Timeout Error?

I have a Temporal Activity that pulls data from an external source can takes upwards of >40 sec or many minutes to complete. Currently, my Temporal Activity runs into an activity timeout error regularly.

"activity timeout"

What are the best practices for implement this long-running Activity so that it does not run into a “context exceeded” or “activity timeout” error?

I have changed a number of the Timeout Settings within the Workflow and Activities
(ex. WorkflowTaskTimeout, WorkflowRunTimeout, WorkflowExecutionTimeout, StartToCloseTimeout, ScheduleToCloseTimeout, ScheduleToStartTimeout) to >10min (to simulate allowing a long-running Activity) and unfortunately still get an activity timeout.

Which of the Timeout Settings should be set to allow for a long-running activity within a Workflow?

In addition, generally, what is the best way to support this Long-running activity, without a Timeout?

Workflow timeouts are not related to activity timeouts in any way. So don’t change them for this use case.

You want to specify a long (the longest possible activity execution) StartToCloseTimeout. And then a short HeartbeatTimeout (let’s say 1 minute). If heartbeat timeout is specified the activity must heartbeat periodically with a heartbeat interval that is lower than the heartbeat timeout. This way an activity can execute for a long time and fail fast.

See this presentation that explains the activity timeouts in greater detail.