Can't seem to read global variable values

Hey, MindStudio team! This is an Advance Local issue where our mystery of the global variable continues…

It seems that there is a bug whereby MindStudio cannot read global variables. We can write to global variables, but not read them.

We are investigating this issue presently in this AI Agent: 1cd9364d-9000-409d-aedb-e5edcb61f010. Go to the workflow named “Aazzara”.

The issue is in the block named “Compare to Global”, where it compares a runtime variable named changeAnalysis to a global variable named global.Aazzara. We have the spelling correct. This is not the only workflow with a similar issue.

To do a test, I created a separate Generate Text block where I save the runtime variable changeAnalysis to global.test. Then, immediately following, I save global.test to a runtime variable called test. The results are that I can save to the global variable, but cannot read its value.

To try this yourself, connect the block “Get Latest Deaths” (which saves to changeAnalsys to the block “Save to Global Test”.

Thank you for looking into this for us! We appreciate it!

Hi @TechWriterLouis,

The global variable in your workflow contains a JSON object, so when the Agent runs and the variable resolves, the AI model receives [object Object].

To fix this, reference your global variable with the syntax below to convert the JSON object into a string:

{{json varName}}

Hey, @Alex_MindStudio !

Ah, I see. Indeed, that fixed the issue. It’s odd, that these workflows had been working previously for several weeks, but then seemed to break. Did your team enforce an explicit check on JSON arrays recently? (I see that in Debugger you now collapse JSON array data to save screen space–perhaps this change happened around the same time?)

I’ll let David know about this change. Thank you for your help, as always!

Hi @TechWriterLouis,

I’ll double-check, but we haven’t made any changes that would affect global variables. Could it be that you previously had JSON arrays or objects without square brackets? Both can be used without adding json before your variable.