Note that both processes FREEZE touchdesigner while the gif is being created. I would recommend eventually breaking this project into two pieces. One piece will be the main project and it won't freeze. The second project will receive an instruction from the first project to execute the ffmpeg gif encoding as a subprocess, and then it will start that subprocess (causing a freeze).
Hit record and then a short time later turn off record.
Pulse the record pulse button. It will save images periodically and then turn them into a gif.