For the complete documentation index, see llms.txt. This page is also available as Markdown.

๐ŸŽฏ Exercise 3

Objective: Practice combining Loop, Decision, Sleep, and Stop tools to process data conditionally and control workflow execution.

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:

  1. If the order amount is greater than 2000, log it as a "High Value Order"

  2. If the order amount is between 1000 and 2000, pause for 5 seconds and then log it as a "Medium Value Order"

  3. 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.

Last updated

Was this helpful?