So all I'm trying to do is add a String Input in Geometry Nodes via an internal python script.
I'm basically requesting a json file via http and want to create a blender string for each value.

Basically I want to have this structure

Here's what I tried: bpy.data.node_groups["name of node group"].new("GeometryNodeInputString")

But apparently it doesn't exist, and sure enough it's not in the docs for this command https://docs.blender.org/api/current/bpy.types.GeometryNode.html

After some digging, I'm fairly certain what I want to add is a "Function Node" https://docs.blender.org/api/current/bpy.types.FunctionNodeInputString.html

But I have no idea what the correct way of adding this would be.
Any help would be much appreciated!

  • $\begingroup$ I'm a little confused. Do you want to expose the string input in the Group Input node (and thus the modifier) or do you just want to add it to the node tree? $\endgroup$ Apr 8, 2022 at 16:06
  • $\begingroup$ Sorry for the confusion. I just want to add it to the node tree. I edited the post and added an image to illustrate $\endgroup$
    – oliwoli
    Apr 8, 2022 at 16:20
  • $\begingroup$ No problem. Let me know if my answer is not clear. $\endgroup$ Apr 8, 2022 at 16:41

1 Answer 1


If you want to add a new node to a Geometry Node node group, you have to

  • find the node_group,
  • create the new node, and
  • link it into the group.

Here's a simplified example:

import bpy

obj = bpy.context.active_object
node_group = obj.modifiers['GeometryNodes'].node_group
nodes = node_group.nodes

geom_out = nodes.get('Group Output')

string = nodes.new('FunctionNodeInputString')

node_group.links.new(string.outputs['String'], geom_out.inputs[-1])

It starts from the active object and it assumes that the modifier has the default "GeometryNodes" name. It also assumes that the Group Output node hasn't been renamed.

For your purpose, instead of using geom_out you'll have to select the node that you want the string's output linked to, and instead of geom_out.inputs[-1] you'll have to figure out what input of that node you want to ink to.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .