How to make subprocess & migration_lookup plugins behave consistently with single and multiple items arrays I have a JSON that can hold single or multi values arrays and I can't make subprocess + migration_lookup behave consistently. It correctly imports the nodes in all cases, but it adds the reference to the imported nodes (entity reference field) only when I have more than 1 item in my array.
my JSON can looks like this:
&quot;behaviour&quot;: [
          {
            &quot;name&quot;: &quot;behaviour name&quot;,
            &quot;description&quot;: &quot;behaviour description&quot;
          }
        ]

or like this:
&quot;behaviour&quot;: [
          {
            &quot;name&quot;: &quot;behaviour name&quot;,
            &quot;description&quot;: &quot;behaviour description&quot;
          },
          {
            &quot;name&quot;: &quot;another behaviour name&quot;,
            &quot;description&quot;: &quot;another behaviour description&quot;
          }
        ]

the process part of my migration config:
  field_behaviour:
    plugin: sub_process
    source: behaviour_array
    process:
      target_id:
        plugin: migration_lookup
        migration: import_behaviours_json
        source: name
This is just guessing, but you could try forcing the multiple flag on the source field using the multiple_value plugin from Migrate Plus:
field_behaviour:
  -  
    plugin: multiple_values
    source: behaviour_array
  -  
    plugin: sub_process
    process:
      target_id:
        plugin: migration_lookup
        migration: import_behaviours_json
        source: name