Make a test loop in a scenario

Hi.
I am trying to make chatgpt produce a summary with limited number of characters, but can’t manage to do it (see Can't make chatgpt produce a text with limited characters number)

So I am thinking about creating a loop & test:

  • ask chatgpt create a summary
  • test if output is less than X characters long
  • if not, ask chatgpt to make it shorter and test again
  • if output is less than X characters, get out of the loop.

How can I do that in a scenario?