Hey Liam,
Functions never actually timeout (they technically run forever). The UI just calls them "
Timed Out" when nothing is returned within a certain duration (24 hours). So, even if your function switches to "Timed Out" - realize that it is still running on the integration server, and will switch to "Completed" in the UI upon the
FunctionResult yield (or "Pending" when a new
StatusMessage yield occurs). "
If an acknowledgement is not received within a day, the status for the action changes to Timed Out." See
here.
So, this means that if you want to see the status show as "Pending" continuously (without switching to "Timed Out") your first solution will work, if you have it perform a status message at least every 24 hours (probably more like 23.95 hours to account for the slight delay between run and execution). This is not really required though, as I mentioned, it will run as you want it to until script completion.
------------------------------
Jared Fagel
Cyber Security Analyst Intern
Public Utility
------------------------------