From c9753ae5da2fa2d13fa97b95282b5b1e28a33092 Mon Sep 17 00:00:00 2001 From: Marcel Rebro Date: Tue, 13 Jan 2026 12:55:33 +0100 Subject: [PATCH 1/2] docs: update state persistence section to clarify usage of Actor.useState method --- .../actors/development/builds_and_runs/state_persistence.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/platform/actors/development/builds_and_runs/state_persistence.md b/sources/platform/actors/development/builds_and_runs/state_persistence.md index 218b88f387..079e105c8b 100644 --- a/sources/platform/actors/development/builds_and_runs/state_persistence.md +++ b/sources/platform/actors/development/builds_and_runs/state_persistence.md @@ -47,9 +47,9 @@ By default, an Actor keeps its state in the server's memory. During a server swi ## Implementing state persistence -The [Apify SDKs](/sdk) handle state persistence automatically. +The simplest way to handle state persistence is with the [`Actor.useState`](/sdk/js/reference/class/Actor#useState) method, which automatically saves and retrieves your state during migrations. -This is done using the `Actor.on()` method and the `migrating` event. +For more control or when using Python, you can manually handle state persistence using the `Actor.on()` method and the `migrating` event. - The `migrating` event is triggered just before a migration occurs, allowing you to save your state. - To retrieve previously saved state, you can use the [`Actor.getValue`](/sdk/js/reference/class/Actor#getValue)/[`Actor.get_value`](/sdk/python/reference/class/Actor#get_value) methods. From 8416e81d12bc096459fa64163b0c1ba9930a19ed Mon Sep 17 00:00:00 2001 From: Marcel Rebro Date: Thu, 15 Jan 2026 07:46:19 +0100 Subject: [PATCH 2/2] Update sources/platform/actors/development/builds_and_runs/state_persistence.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MichaƂ Olender <92638966+TC-MO@users.noreply.github.com> --- .../actors/development/builds_and_runs/state_persistence.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/platform/actors/development/builds_and_runs/state_persistence.md b/sources/platform/actors/development/builds_and_runs/state_persistence.md index 079e105c8b..abe29d3292 100644 --- a/sources/platform/actors/development/builds_and_runs/state_persistence.md +++ b/sources/platform/actors/development/builds_and_runs/state_persistence.md @@ -47,7 +47,7 @@ By default, an Actor keeps its state in the server's memory. During a server swi ## Implementing state persistence -The simplest way to handle state persistence is with the [`Actor.useState`](/sdk/js/reference/class/Actor#useState) method, which automatically saves and retrieves your state during migrations. +To handle state persistence, use the [`Actor.useState()`](/sdk/js/reference/class/Actor#useState) method. This method automatically saves and retrieves your state during migrations. For more control or when using Python, you can manually handle state persistence using the `Actor.on()` method and the `migrating` event.