Cloudomation automatically creates savepoints of your running executions. Savepoints can be used to recover an execution after an error.
Savepoints contain all information needed for the execution to resume at exactly the same instruction and going forward. Additionally the line and name of the Flow-API call and the timestamp is stored.
It is possible to revert an execution to the state of a savepoint for it to resume operation from the instruction. The complete state of the execution is restored, including all variables used in the execution.
Restoring an execution to a savepoint does not however affect other objects, like Cloudomation settings, Cloudomation files, or third party systems. Only the execution is restored. Objects which the execution already modified will remain modified.
Types of Savepoints
Additionally to the automatically created implicit savepoints, a Flow script can explicitly request a savepoint to be created. Such explicit savepoints can also be assigned a name.
Create a named Savepoint
The Flow-API command
create_dump(name) creates an explicit, named savepoint.
import flow_apidef handler(system: flow_api.System, this: flow_api.Execution):# fetch some datadata = this.connect('database',fetch='SELECT * FROM data',).get('output_value')['result']# create a named savepoint# in case of an error the execution can be reverted# to this state and resume normal operationsthis.save_dump('with-fetched-data')# process the data# in case the remote-api call fails it is possible to# revert to the savepoint above and retry the remote-api call# without having to fetch the data againthis.connect('remote-api',method='post',path='/upload',json=data,)return this.success('all done')
Restore an execution to a Savepoint
It is possible to restore a savepoint using the Flow-API:
this.load_dump('with-fetched-data', by='name')# or by IDthis.load_dump('8f47bbb1-6a04-435f-952f-1cbb84f71b4a')
It is also possible to restore a savepoint using the User-Interface:
- open an execution
- click on
name=<savepoint-name>and click ok