How To Backup N8n Workflows in 10 Minutes FAST!

Code from the video:

{{ ‘Backup_’ + new Date().toLocaleDateString(‘en-US’, { day: ‘2-digit’, month: ‘short’, year: ‘numeric’ }).replace(‘,’, ‘’).replace(/ /g, ‘-’) }}

AND

const obj = $input.first().json;
const jsonString = JSON.stringify(obj, null, 2); // nicely formatted JSON string

return [{
json: {
fileName: $input.first().json.name + “.json”,
rawJson: jsonString // ← this will go into a cell
}
}];