Activity
Initialize a JSON array variable called orders:
[
{"order_id": 101, "amount": 500, "status": "pending"},
{"order_id": 102, "amount": 2500, "status": "pending"},
{"order_id": 103, "amount": 300, "status": "pending"},
{"order_id": 104, "amount": 1500, "status": "pending"}
]
Loop through each order and:
- If the order amount is greater than 2000, log it as a “High Value Order“
- If the order amount is between 1000 and 2000, pause for 5 seconds and then log it as a “Medium Value Order“
- If the order amount is less than 1000, log it as a “Low Value Order“
Outside the Loop, add a Stop tool followed by a Console step with the message “The End”.
Run the workflow and observe that “The End” never gets logged.