Help w/ Batch Message Queues and Incorrect Output Order

Hey everyone! I’ve been building a translating + humanizing workflow with the input coming from Telegram and translating + humanizing with an AI agent. When receiving one message at a time, the output order is fine. But if the input is 2+ forwarded messages, the order of input changes on output.

From what I understand, when forwarding 2+ messages, the workflow is running concurrently, so ultimately the text that takes the longest to translate and humanize will most likely come out last even if it’s the first text on input.

I’ve tried the following:

  • Have the translated and humanized text appended to an array and sorting before output, but this doesn’t work because it’s 3 concurrently executed workflows that are not aware of each other
  • Appending it to Google Sheets then executing a separate workflow after getting it from the Sheet and sorting it, but the order it outputs at is inconsistent.

What are some ways I can get the order to come out right? Or if I’m misunderstanding how the flow of receiving batches of forwarded messages work, please let me know.

Thank you in advance!

Example Input:

Example Output - Incorrect ordering**:**

May be try external db like supabase to track message sequence?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.