Splitting HTML into chunks

Hi everyone :waving_hand:

I’m building a scenario to analyze large HTML pages for CRM or ERP technology references using ChatGPT. The idea is to split the HTML into 10,000-character chunks (to stay within token limits), process each chunk individually with the OpenAI GPT module, then aggregate the results into a single summary.


:puzzle_piece: Current Setup:

  1. HTTP module retrieves raw HTML from a website (1.body).
  2. Set Variable module attempts to split the HTML into 10,000-character chunks using: splitText(toString(1.body); 10000)
    → Output variable: Chunks
    3.Iterator module is supposed to loop through the Chunks array.
    4.Each chunk is sent to the OpenAI GPT module.
    5.An Array Aggregator collects the GPT results.
    6.Optionally, a final GPT call summarises them before storing in Google Sheets.

Despite the HTML being over 500,000 characters long, the splitText() function only returns 1 chunk. The Iterator then runs just once, and I eventually hit OpenAI’s token limit (~16k tokens) on the final GPT module.

Can anyone advise what I am doing wrong?

Thanks,
Darren
(p.s. - I am still new to make.com :slight_smile: )

Welcome to the Make community!

For more information, do view these similar questions previously asked by other community members, which may answer your question:

Next time, please try to search this forum first for existing answers. This may help you get to the solution faster, and also help keep the forum organised. Thanks for your cooperation!

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.