Run Workflow Error: Input array is not a valid JSON array

Hello,

I am using the Run Workflow block in a couple of my MindStudio workflows. When triggering one of these workflows yesterday, I consistently received the error message: “Input array is not a valid JSON array”.

I have been using the “Auto-Extract” Iterator within the Run Workflow blocks, with simple extraction prompts such as “Extract all urls”. This was working well up until about a week ago.

To demonstrate the issue, I followed the video in the Run Workflow Quick Help section to recreate a similar workflow, but I am experiencing the same error.

Here is a remix link. https://app.mindstudio.ai/agents/run-workflow-test-e613920d/remix

Is there something I’m missing or is there a change to how extraction and input arrays are supposed to be formatted for these blocks?

Any help is much appreciated.

Aaron

Hi @AaronK,

Thanks for the remix link!

The Auto Extract iterator uses AI to process data. It usually works well, but since it relies on AI, it may be slightly inconsistent.

Quick Fix:

  1. The Google Search block saves results to {{searchResults}}, but the Generate Text block is pointing to {{JSON searchResults}}. Update it to {{searchResults}} or {{json searchResults}} so it matches
  2. Right now, the Run Workflow block saves its outputs to {{extractedResults}}, but the prompt in the last Generate Text block isn’t referencing that variable. Update it so it pulls from {{extractedResults}}

Best Fix:
Adopt the JSON array iterator:

  1. In the Generate Text prompt, reference {{searchResults}} or {{json searchResults}}

  2. Update the Sample Output in Generate Text to a JSON array (like in the screenshot)

  3. Change the iterator in the Run Workflow block to JSON Array

  4. Make sure the last Generate Text block references {{extractedResults}} since that’s where the outputs are saved

Thank you very much! Those tips did the trick.

Much appreciated.

1 Like