Processing a JSON array item by item?

Hello everyone,

Sorry for this beginner’s question, but I just can’t find a solution.
I would really appreciate some help on how to properly work with JSON.
I can’t seem to find any information on how to solve this — neither in the mindStudio guides, YouTube tutorials, nor other sources.

How can I process a JSON array item by item?

Examples:
• I have an array of URLs that I want to crawl one by one.
• JSON arrays containing image prompts are generated from articles, and I want to create images from them.

There are countless use cases where this is necessary.

I can access the first item with
{{get myJsonVariable “$.items[0].name”}}
(or by changing the number to access a different item), but I can’t seem to use a variable for that number.

for example: {{get myJsonVariable “$.items[{{counter}}].name”}}
this wont work.

Does anyone have any ideas for me?

Thank you so much.

Hi @mefrankyt,

It sounds like the Run Workflow block is the best fit for your use case.

Here are a couple of examples you can remix into your workspace to explore how they’re structured:

Simple : https://app.mindstudio.ai/agents/run-workflow-simple--remix-46a2a888/remix

Advanced : https://app.mindstudio.ai/agents/run-workflow-advanced--remix-f3bfba48/remix

The key difference between them:

  • The Simple version uses an Iterator to process individual items
  • The Advanced version works with a structured JSON array

Since you’re already working with a JSON array, the Advanced version will likely be the better fit. You’ll just need to change the Execution Mode to Sequential.

Hope this helps!

Perfect! Thank you ever so much — this makes me so happy. I guess I was overcomplicating it.

This is incredibly helpful!