Sync queue messages on a 5-minute schedule

Recipe ToolsMarketingDeveloper ToolCloud PlatformData ParserUtilities

What it does

When the clock triggers every 5 minutes, this automation polls a queue and processes each message. It verifies status and timing, then searches a lookup table to determine where each message goes.

Who it's for

Operations teams who need to move messages from a queue to downstream systems on a regular cadence.

How teams use this

Process queued messages automatically

Poll the queue every 5 minutes and move messages to the next system without manual work. Messages flow through on schedule and the team sees them processed in order.

Route messages by type

Use the lookup table to send each message to a different destination based on its type. Only active items and messages within the scheduled window are processed.

Add a priority routing condition

Extend the lookup table to include a priority field so high-priority messages are routed to a faster queue. The automation checks priority and filters messages accordingly.

Monitor queue depth and alert

Retarget this automation to also check queue depth and send an alert when messages back up. The polling stays the same but adds a visibility layer for the team.

How it works

  1. Run on a 5-minute schedule. The automation starts every 5 minutes to check for new messages waiting in the queue.
  2. Retrieve messages from the queue. Fetch messages from the queue and create a list so each message can be processed in the loop that follows.
  3. Verify status and scheduled time. For each message, get the details and confirm the item is active and the scheduled time has not passed yet.
  4. Search the Stages Mercatus mapping. Query the Stages Mercatus Recipes Mapping lookup table in batch to find routing rules for each message.
  5. Parse and route the result. Parse the lookup result and send each message to the appropriate destination based on the mapping found.