Generate a PDF-file with variable filename

remove the hard coded filename from the file node & in your function add something like...

// your code
const reportDate = new Date().toISOString().replace(/[TG]/g,'_').replace(/:/g,'-').substring(0,19);
const reportName = 'mydata'
msg.filename = `c/reports/report-${reportName}-${reportDate}.pdf`
return msg;