Keep the running connection
After submission, keepWatchTasks attached to the selected Worker. The stream sends a current snapshot and then the terminal update. Reconnect within the configured grace period after an interruption. GetTaskResult can inspect a result but does not keep a running task attached.
Read the terminal result
For
ReturnValueHandler, read the returned outputs. For table writes, retain the writer statistics and any job_id, then confirm storage readiness separately.
Decide whether to repeat work
- Distinguish an RPC or connection failure from a returned task failure.
- Query the original task when the submission outcome is uncertain.
- Fix input, function, or configuration errors before repeating.
- Inspect the existing write state if the task reached its Writer Plugin.
- Create new work only after deciding that another execution is appropriate.