Nested sequences and Plant Groups

@juangrados Unfortunately this still isn’t possible with basic sequences and variables because a group cannot be passed through a sequence into a subsequence without triggering the parent to run for every group member.

However, if you are willing to play around with some custom Lua code in your sequences, here is a workaround idea you can try. I’ve set up my sequence variables as follows:

And then I added one Lua command to the sequence with the following code:

-- Mount Soil Sensor Tool
soil_sensor_tool = variable("Soil Sensor Tool")

-- Move to Measure Point
measure_point = variable("Measure Point")
  x = measure_point.x
  y = measure_point.y,
  z = measure_point.z,
  safe_z = true

-- Measure Soil Moisture
soil_sensor_pin = 59
soil_moisture = read_pin(soil_sensor_pin, "analog")

-- Unmount Soil Moisture tool

-- Check if Moisture is below threshold
moisture_threshold = 500
if soil_moisture < moisture_threshold then
  -- Mount Water Tool
  water_tool = variable("Water Tool")

  -- Iterate over plants in group
  for i,member in ipairs(group(variable("Group ID")) do
      -- Get plant object
      plant = api({
          method = "get",
          url = "/api/points/" .. member

      -- Move to plant and water
      move_absolute(plant.x, plant.y, 0)

  -- Unmount Water Tool

Instead of passing in the plant group directly, we’re passing in the plant group’s ID, which will not trigger the sequence to run in its entirety for every group member. Instead, the iteration is determined by the Lua code and only happens when needed.

To find a group’s ID, navigate to it in the app and look for the last part of the URL (the numbers), for example:

While this is definitely a workaround, it will allow you to not need 36 wrapper sequences :sweat_smile: Hope this helps!