# Parent node is busy setting up children, `add_child()` failed in Godot 4

The parent is in the middle of adding its children, and Godot refuses to change that list until it is done. get_parent().add_child(child) from a child's _ready() prints Parent node is busy setting up children, `add_child()` failed. Defer the call: get_parent().add_child.call_deferred(child).

Source: https://flockbay.com/godot/parent-node-is-busy-setting-up-children/ · Updated 2026-10-30

## What Godot is checking

While a node is adding its children and running their _ready(), it marks itself blocked. add_child() on a blocked node prints this error and returns without adding anything; the script carries on, so the child is simply missing.

call_deferred() runs the call at the end of the frame, after the parent has finished, when the child list can change.

## Reproduce it

A node that adds a sibling from its own _ready(), while its parent is still setting up.

```
extends Node

func _ready() -> void:
	var spark = Node.new()
	spark.name = "Spark"
	get_parent().add_child(spark)
	print("after")

```

## What Godot 4.7.2 prints

```
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

ERROR: Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.
   at: add_child (scene/main/node.cpp:1721)
   GDScript backtrace (most recent call first):
       [0] _ready (res://answers/parent-node-is-busy-setting-up-children/repro.gd:6)
after
WARNING: 1 ObjectDB instance was leaked at exit (run with `--verbose` for details).
   at: cleanup (core/object/object.cpp:2536)
```

## Fix it

Defer the add_child() and check on the next frame that it happened.

```
extends Node

func _ready() -> void:
	var spark = Node.new()
	spark.name = "Spark"
	get_parent().add_child.call_deferred(spark)
	await get_tree().process_frame
	print(get_parent().has_node("Spark"))

```

## What the fixed script prints

```
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

true
```

## Run this fix with your agent

Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.

```
My Godot 4 project prints this error: "Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.". Find where it comes from and fix it. The parent is in the middle of adding its children, and Godot refuses to change that list until it is done. get_parent().add_child(child) from a child's _ready() prints Parent node is busy setting up children, `add_child()` failed. Defer the call: get_parent().add_child.call_deferred(child). Then run the game headless and check that Godot's output no longer shows it.
```

## Verified on Godot 4.7.2

Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 18 October 2026, and the output above is what Godot printed, unedited.

Where the check lives in Godot's source: [node.cpp line 1721, the message](https://github.com/godotengine/godot/blob/4.7.2-stable/scene/main/node.cpp#L1721).

## Questions

### Why does add_child() work in _ready() on the same node?

A node can add its own children in _ready(). It is the parent, still running its children's _ready(), that is blocked.

### Is call_deferred() the same as await process_frame?

No. call_deferred() runs at idle time at the end of the current frame; await get_tree().process_frame waits for the next frame to start.

Download Flockbay free: Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot. https://flockbay.com/download/

Related: [Can't add child '…' to '…', already has a parent '…' in Godot 4](/godot/cant-add-child-already-has-a-parent/), [Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead in Godot 4](/godot/cant-change-this-state-while-flushing-queries/), [Node not found: "…" (relative to "…") in Godot 4](/godot/node-not-found-relative-to/), [Every verified Godot 4 answer](/godot/), [How do I see Godot’s output and errors in Flockbay?](/docs/how-do-i-see-godots-output-in-flockbay/)
