Depth limit writing content with a/b tests

I’m seeing an issue where creating content via the write API with an a/b test variation that has quite a deep structure (more than 20 nodes deep), then I get an HTTP 500 error.

This does not apply to creating content without a/b test variations.

A reproduction of the issue is here:

Is this a bug or a known limitation? Any ideas how I can work around this issue?

Thanks!

Hello @jchisholm

Thank you for sharing such a clear reproduction of the issue. This is very helpful.

We’ll review this in detail on my end, try to reproduce the behavior, and discuss it further with our internal team. As you mentioned, the issue doesn’t seem to affect non-A/B test content.

We really appreciate your patience and the thorough report—it makes troubleshooting much easier.

Thanks,

Hello @jchisholm

The error you’re seeing isn’t a bug in the Write API itself but rather a limitation of Firestore, which enforces a maximum nesting depth of 20 levels per document. When an A/B test variation includes blocks nested more deeply than that, Firestore rejects the payload and the request fails with an HTTP 500.

To work around this limitation, we recommend using symbols and references instead of embedding extremely deep structures directly within the variation. This approach allows you to:

  • Break down complex hierarchies into smaller, reusable content entries.

  • Reference those entries inside your variation rather than nesting all elements inline.

  • Stay well within Firestore’s depth limit while still preserving the ntended structure.

This pattern also makes your content more modular and easier to manage across multiple variations.

Let us know if you have any further questions.

Thanks,