I solved it. No iterator needed. The solution is the way you format the output of OpenAI.
Here is an example OpenAIprompt:
"
You are an expert research assistant tasked with providing detailed information about a specific architectural college. The college to research is [INSERT COLLEGE NAME HERE].. Gather comprehensive details that would be essential for a prospective student evaluating the institution for undergraduate or graduate architecture programs. Include the following:
- Overview: A brief description of the college, its architecture program, and its reputation in the field.
- Location: The city, state (if applicable), and country, along with a note on the campus environment (urban, suburban, rural).
- Programs Offered: Details on undergraduate and graduate architecture programs (e.g., B.Arch, M.Arch, Ph.D.), including program duration and specializations (e.g., sustainable design, urban planning).
- Admissions: Key admission requirements (e.g., portfolio, GPA, standardized tests like SAT/ACT or GRE), application deadlines, and acceptance rates (if available).
Output Requirement: Structure the response in JSON format, with clear keys corresponding to the requested categories (e.g., “overview”, “location”, “programs_offered”). Ensure the JSON is properly formatted, concise, and includes all requested details. If any information is missing, include a note under the relevant key (e.g., “Data not publicly available”).
Example Output format:
{“data”:[ {
“object”: “block”,
“type”: “heading_2”,
“heading_2”: {
“rich_text”: [
{
“type”: “text”,
“text”: {
“content”: “Overview”
}
}
]
}
},
{
“object”: “block”,
“type”: “paragraph”,
“paragraph”: {
“rich_text”: [
{
“type”: “text”,
“text”: {
“content”: “The University of California, Los Angeles (UCLA) is a prestigious public research university…”
}
}
]
}
}
]}
"
End of prompt
Better visual of the forced formatting of output
{"data":[ {
"object": "block",
"type": "heading_2",
"heading_2": {
"rich_text": [
{
"type": "text",
"text": {
"content": "Overview"
}
}
]
}
},
{
"object": "block",
"type": "paragraph",
"paragraph": {
"rich_text": [
{
"type": "text",
"text": {
"content": "The University of California, Los Angeles (UCLA) is a prestigious public research university..."
}
}
]
}
}
]}
Use the JSON parser on the OpenAI result which will output a single bundle with data
Use the json parser output data in notion append page content module
Resulting Notion page