(Animation nodes) Is there a way to instance objects inside a subprogram?
You can use a script as workaround, so that AN cannot see that you create object instances in a subprogram:



Using scripts is the same way as all subprograms in AN. For script: 


Add a text
Write the script, identifying the variables that will be inputs and output
Set these parameters adequately in the script node


But, a big warning: be careful about the frame changes as it could generate a lot of objects.

If this is happening, you can use some script to apply in Python console, like:

for m in [m for m in bpy.data.meshes if m.users == 0]: bpy.data.meshes.remove(m)