I think you confused activity with workflow. The question and the code are activity code, not the workflow code.
StartToClose timeout is an activity timeout. You also disabled the activity retries by setting maximumAttempts to 1. So if the activity doesn’t complete in 5 minutes it times out. My guess is that the workflow doesn’t handle the activity failure exception correctly and fails.
A few comments about your activity timeouts:
` startToCloseTimeout: ‘5m’`` is the maximum time the single activity attempt to execute. So if activity is expected to run longer you have to set it to longer value.
scheduleToStartTimeout: '30s', this is the time an activity task can stay in a queue before being picked up by a worker. We don’t recommend setting this value at all unless you are using worker specific task queue.
`heartbeatTimeout: ‘5m’, this is the maximum time between heartbeat calls. Setting this value to the same value as StartToClose timeout doesn’t make sense.
NOT_FOUND happens when heartbeat is emitted for an already timed out activity.
Thanks! makes sense now. I will increase the timeout for the startToCloseTimeout for the activity.
The initial reasoning for scheduleToStartTimeout: '30s' is that if all the workers are busy and unable to pick up this activity from the queue, I want it to time out rather than pick it up later. In my use case, it’s important to pick it up within at least 30 seconds.
The initial reasoning for scheduleToStartTimeout: ‘30s’ is that if all the workers are busy and unable to pick up this activity from the queue, I want it to time out rather than pick it up later. In my use case, it’s important to pick it up within at least 30 seconds.
I see. This is a valid use case for the scheduleToStartTimeout.