Skip to main content
Question

Displaying sorted results using notify action in a for loop

  • April 2, 2026
  • 1 reply
  • 18 views

Hello - has anybody tried displaying sorted results using Notify action within a for loop? We are invoking notify within a for loop and passing it an employee list that is sorted by the last name. However the results displayed are not ordered. It seems like notifications are sent at random. Kindly share any insights / solutions if you have encountered this.

- for:
      output_key: sent_notifications
      each: employee
      index: idx
      in: data.merge_result.employees
      steps:
        - notify:
            output_key: notification_result
            recipient_id: meta_info.user.id
            message:
              RENDER():
                args:
                  full_name: employee.full_name
                  country: employee.country
                  total_pending: employee.total_pending
                  preview_trainings: employee.preview_trainings
                
                template: |
                  👤 **{{full_name}}** – {{country}}
                  🗒 **{{total_pending}} pending training(s)**
                       
                       {{preview_trainings}}

1 reply

rgeroulo
Forum|alt.badge.img+1
  • Community Manager
  • April 2, 2026

Hi ​@Mudi,

If sorting data within the message object, that card will always be static and render exactly as you design it.

In your example though, you are trying to order multiple, individual Notify messages and send them to your same AI Assistant chat. In this case, proactive notifications can be batched, delayed due to rate limits, retried, etc. These messages might not always send in the same order due to these constraints, hence why you are seeing them arrive in a different order.

In this case, is there a need to send messages to users in a specific order?

Best,

Ryan