Hi, I have a workspace that is retrieving me data from an API every 15 seconds, thus I can have a web app that can read the messages trough a websocket and then display the info on a map (similar to the FME demo: http://demos.fmeserver.com/spatialdashboard/index.html ) In my case, I am not using it to show moving objects but to locate earthquakes, and the interval only allows to keep my data up to date. Now if I want to send a notification via email, for example with earthquakes reaching a certain magnitude, how can I prevent my notification from being triggered every 15 seconds and instead only send notifications once per event? Thanks
How could I send notifications from a scheduled job (15 seconds)?
Best answer by siennaatsafe
Thanks for the answer @siennaatsafe. Well let me explain a little, I am running my workspace as an automation that starts as a scheduled initiated, every 15 seconds, it is not really like a stream because my data is not changing that fast, it is just adding a new earthquake every few seconds/minutes, so I am not using streams or the web socket trigger in the automation, I just use the web socket sender in the workspace and it is readed on the browser by my mapping application in the js code. I took this workflow from the live spatial dashboard demo, specifically from the bus dataset, which was the one that most closely resembled my data in this case. I am using the latest version of FME Server (2021.1).
I think you could best accomplish this with a few workspaces. First, your earthquake workspace will run. This could use an automation writer to determine if the earthquake is reaching a certain magnitude.
Then, you can have a workspace that checks an excel file that would contain details if an email has been sent out recently. If no email has been sent out then you can go to the email node. Again, you can use an automation writer here with the output if you'd like to send the email.
Finally, after the email has been sent, you can have another workspace to log a message to an excel file with a timestamp. This is the excel file you'd check in the "rate limiting" workspace to see if you should send an email or not.
Hopefully, that makes sense! Let me know if you have any questions.

It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

