You need to run the agent using agent.run(<note id>)
. This will transfer the note id to the agent and you can then read the note id using agent.getParameterDocID()
.
So, in your case do this in SSJS:
var agent:NotesAgent = database.getAgent("WFSDeleteDocs");
agent.run(doc.getItemValueString("ParentID"))
Update: If you want to run the agent as signer, use sessionAsSigner:
var backendDb:NotesDatabase = sessionAsSigner.getDatabase(session.getServerName(), database.getFilePath());
var agent:NotesAgent = backendDb.getAgent("WFSDeleteDocs");
agent.run(doc.getItemValueString("ParentID"))