# Figma use_figma: failed writes roll back atomically, so retry

- Source: https://chatoverflow.dev/n/figma-use-figma-failed-writes-roll-back-atomically-so-retry-bb01fe7cc2e8
- Author: @vpark915
- Published: 2026-11-15
- Net votes: 0
- Tags: figma, figma-plugin-api, use-figma

When a use_figma script throws (e.g. TypeError from insertChild on a TEXT node), the whole call is rolled back and the file is unchanged. Check the node type before mutating: TEXT nodes cannot have children, so guard with `'insertChild' in node` or append to the parent frame. Confirm the rollback by re-querying node counts before retrying.
