Server Task Triggers

In version 5.9.5 released earlier this week, we've added the concept of "Triggers" to EasyMorph Server Tasks.

Historically, tasks could be run manually, or be scheduled to either run once at a specific date and time, or run on a repeating schedule. It was also possible to run tasks when external events happened, by making an API call to EasyMorph Server, but this required significant programming skills for a start. Triggers allow you to run tasks not only on a schedule as before, but also on other events occurring, both within and externally to EasyMorph. Some examples would be when a supplier uploads a new file to a specific folder, when an email is received from a customer, or when a new record appears in a database table.

v5.9.5 introduced the first 2 Triggers, the "Schedule trigger" and the "Email Received trigger". You can see more about what they do and how to configure triggers in the blog post accompanying the release.

In future releases we plan on adding more triggers, including:

  • The File trigger - when a file is added or updates in a specific folder. This could be files uploaded to a space, via the new in-built SFTP server, or just about any other method of updating files onto your EM Server.
  • The Dropbox trigger - Like the File trigger but monitoring a file on Dropbox instead.
  • The Database Row trigger - when a row is added to a chosen database table.

Down to the real reason for this post. The possibilities are almost endless, so we'd love to hear from you what events or scenarios you'd like to see a trigger for? Or even any specific features you'd like to see within the above mentioned triggers?

3 Likes

Triggering a task after putting a message on a Kafka or RabbitMQ queue would be very helpful.

I guess AWS's SQS could also be added to that list. Thanks for the idea! :+1:

Server Task Triggers add another promising layer for enterprise scheduling!

Really looking forward to the database row trigger. May beside adding a row, the trigger could also fire if any row in the database table is changed/deleted?

Instead of referring to another module/project to call (successor) within a project, you could also design it as a trigger (predecessor) and thereby chain/link projects. The trigger fires if a project from EM server ran (successfully or failed) and might use its predecessor's output as an input.

That's more challenging technically, because adding new rows can be relatively easily tracked via the total row count, or via an increased timestamp/rowID. However, tracking changed rows would require comparing all rows (or their hashes) in every check.

Initially, we thought about having triggers for started/failed projects, however, after giving it more thought, it became clear that it would be very hard to track such dependencies as they would be implicit.

Instead, we will offer a new mechanism called "pipelines" or "processes" that will link multiple tasks into a single pipeline (process, flow). In such a pipeline, it will be explicitly defined what task is triggered after another task finishes.

Really looking forward to the database row trigger. May beside adding a row, the trigger could also fire if any row in the database table is changed/deleted?

That’s probably achievable, but in a tricky way.
This could work in a two-phase setup.
First, you create another SQL database table (mon_table ) and configure SQL database triggers such as AFTER UPDATE and AFTER DELETE for the original table. On trigger execution, update a column value (timestamp/rowID) in mon_table .
Second, you configure an EM Server database trigger to watch mon_table for timestamp/rowID updates.

1 Like