For logging purposes, you might want the need to grab a WFA execution log. I initially wrote this to dump those in an OCI database, but for this post, I narrowed it down to just dumping them in CSV-files (jobinfo, input parameters & return parameters). The original script also updates statuses (for example, when a jobstatus changes from failed => resume => completed), but that compare is only possible when we dump in a database and i can query it again, so for this csv-output method, an update won't work (but I kept the code in comment).
I did make the script incremental. Job logs can take a while to grab, so I allow a timeout. I keep the last jobid in a simple text-file. Original, obviously, I stored this in the database. I you are interested in the the database version, give me a ping.