Conditionals in Native text stream

Hi! im using the native ai text stream in bubble but i have issues to do thing when the text stream is done. For example to show popups or to run another ai text stream when the first one finishes.

Somebody knows how to do it?
Im doing it this way but it doesnt work

This is because according to the docs

“Client-side actions that don’t depend on the final API results can proceed without waiting for the stream to fully complete.”

So I’d recommend you switch this to the workflow where the streaming is taking place.

If not, there is a workaround for using “Every time X is true”.
1-Create a group with a yes/no type of content with “no” as it’s Data Source.
2-Change the data source to “yes” every time the group streaming text steam is done.
3-Run workflow every time this group is “yes”.

Hello! thanks! it worked but know when i want to do another text stream with the information of the previous one i have this problem

The text appears ath the debugger in the left but in reality as you see in the right the text stream is empty and i cannot use tthe answer

1 Like

what do you mean when you want to do another text stream?

From what’s happening there, I’d recommend storing the text stream in a group and pulling the data from there, rather than using the ‘Every time’ action, as its behavior can be somewhat inconsistent.

I’m chaining two text streams with Bubble’s native text stream API. After the first stream finishes, I trigger a second stream that should use the first stream’s output as its input. The problem: when the second stream starts and tries to read the first stream’s answer, that value is empty—even though I can see the first stream’s text on the page.

What I’m doing:

  1. Run Stream A → it writes into a group (this is my “source” for the next step).
  2. When Stream A finishes, I start Stream B and pass the group’s value (Stream A’s result) as the prompt/input.
  3. Stream B begins, but the group’s value is blank at that moment.

Using a custom state on the Yes/No group works to chain the streams, but it breaks when I try to save the result.

Flow:

  1. The stream finishes.
  2. I set the group’s custom state to the text stream value.
  3. I create a Thing in the database using that custom state.

Result: the Thing gets created, but the field that should have the streamed text is empty—even though the text is visible on the page in the group.

Any ideas on how to solve that?

I would recommend one of the following approaches

a. Save the text stream full text to a database object (Create/Make changes to a Thing)… and pull the data from there.

b. Use the response ID from the previous call and include it in your next request. You will first need to set this up in the API Connector. I’ll leave the images below.