Runaway Scheduled Agent

We have a problem creating a basic scheduled agent with a “Send Mail Message” simple action.

Basic settings are -

Options = Shared

Trigger = On Schedule (we’ve tried various schedules with no difference)

Target = we’ve tried both options

(“All Documents In Database” and “All New & Modified Documents”)

Simple Action = “Send Mail Message”

User, Subject & Body of message are set, Include boxes are unchecked.

Nothing elaborate about this - very basic.

We just want to send a specific message to specific recipients at specific times.

As soon as we save this agent, it shows as enabled, then a minute later the agent runs. But doesn’t stop running.

ie Instead of one message being sent - the agent sends thousands of the same message.

Subject: Runaway Scheduled Agent

The problem is in your target selection. These kinds of agents run once for every document in your target range. Both All Documents and New and Modified Documents (which means new and modified since last time the agent ran, which in the case of the first time an agent runs is all documents) give you a lot of documents, which means you get a lot of messages.

Usually, I just use LotusScript instead of the deceptive simplicity (and, therefore, lack of flexibility) of “Simple” actions. However, I’ve used a cheap hack in cases like this. Create a document in the database which contains a bunch of words that are unlikely to appear together in any other document (for example: monotreme, spathic, Alhambra, thwart, Dickensian, vermouth). Target all documents, but add conditions in your document selection, selecting documents containing those words. Only one document will meet the conditions given, so your agent will send out only one message.

Subject: RE: Runaway Scheduled Agent

Thanks all !

We ended up creating a blank dB and wrote the scheduled agent in LS.

Works great !

Subject: Runaway Scheduled Agent

David,

I think your agent is sending one message per document. If I were you, I would rethink how I want to go about this. If the user, subject, and the body are set (they never change?), then I would set up a separate database just for this purpose.

I would also think about using LotusScript to have total control over what is happening.

Let me know if I can help.

  • Matt