A state-machine alone does not resolve the timeout issue. Each process has a 10 minute timeout, so any single automate resolution can run for up to 10 minutes. When you introduce a retry the process restarts and the timeout is reset as well.
The idea for long running task is to run them asynchronously so the the automate state-machine can perform a retry which would allow for the timeout to be reset.
Taking our provisioning state-machine as an example, we send the request to the provider to create the new VM then enter the CheckProvisioned state which retries waiting for the VM to be identified as a resource in the database. It could take a long time for the provider to create the VM depending on many factors, but the retry breaks up the process so we do not encounter the 10 minute timeout limit for a single process.
Similarly, retirement has a retry state waiting for the machine to power off.
I do not know the detail of your add_template method but you would need to determine how to launch the process and then have a state between the create_template and import_template states that would retry until the create was completed.