Generate sequence numbers on a schedule

Recipe ToolsMarketingData ParserUtilities

What it does

When a trigger fires every 5 minutes, this automation parses a JSON document and loops through each item to compare values. It updates variables based on conditions and logs the results to the job report.

Who it's for

Operations teams who need to process and track sequential data at regular intervals.

How teams use this

Track incrementing values in JSON data

Parse JSON records every 5 minutes and compare sequential values to identify when FirstValue exceeds SecondValue. Log each comparison result to monitor data progression.

Monitor threshold changes in batch processing

Run this automation on a schedule to process batches of items and update tracking variables when thresholds are crossed. The job report captures every comparison for compliance and debugging.

Add custom logic for different data types

Extend the comparison condition to check additional fields or use different operators beyond greater than. Include multiple conditions to handle more complex business rules in the loop.

Route results to external systems

Retarget the logged results to send comparison outcomes to a monitoring dashboard or alerting system instead of only the job report. The schedule and loop logic remain unchanged.

How it works

  1. Start on a 5 minute schedule. This automation runs on a schedule, starting every 5 minutes to process the next batch of data.
  2. Parse JSON and initialize variables. Json Parser reads a JSON document and creates variables for data, output, FirstValue, and SecondValue to track values across iterations.
  3. Loop through each JSON item. For each item in the parsed JSON, repeat the comparison and update steps to process all records in sequence through the loop.
  4. Compare values and update when needed. Check if FirstValue is greater than SecondValue. When true, update SecondValue. When false, keep the current value and log the result.
  5. Record outcomes to job report. Write a message to the job report with the final sequence number and comparison outcome for audit and monitoring purposes.