Skip to content

docs: State persistence update#2176

Open
marcel-rbro wants to merge 5 commits intomasterfrom
docs/state-persistence-fix
Open

docs: State persistence update#2176
marcel-rbro wants to merge 5 commits intomasterfrom
docs/state-persistence-fix

Conversation

@marcel-rbro
Copy link
Contributor

@marcel-rbro marcel-rbro commented Jan 13, 2026

Note

Refines guidance on Actor state persistence.

  • Recommends using Actor.useState for automatic state save/restore during migrations
  • Clarifies manual persistence via Actor.on() migrating event and retrieval with Actor.getValue/Actor.get_value, noting Python usage
  • Editorial updates in state_persistence.md; no code changes

Written by Cursor Bugbot for commit c9753ae. Configure here.

@marcel-rbro marcel-rbro requested a review from TC-MO as a code owner January 13, 2026 11:57
@github-actions github-actions bot added the t-docs Issues owned by technical writing team. label Jan 13, 2026
@apify-service-account
Copy link

Preview for this PR was built for commit c9753ae and is ready at https://pr-2176.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 8416e81d and is ready at https://pr-2176.preview.docs.apify.com!

@marcel-rbro marcel-rbro force-pushed the docs/state-persistence-fix branch from fedaa28 to 5f9cd6d Compare March 3, 2026 11:00
@apify-service-account
Copy link

Preview for this PR was built for commit fedaa280 and is ready at https://pr-2176.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 5f9cd6d and is ready at https://pr-2176.preview.docs.apify.com!

Copy link
Member

@metalwarrior665 metalwarrior665 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, much cleaner now

@apify-service-account
Copy link

Preview for this PR was built for commit 4a1e053 and is ready at https://pr-2176.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit c1da0d5 and is ready at https://pr-2176.preview.docs.apify.com!

Copy link
Contributor

@TC-MO TC-MO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion for clarity, otherwise LGTM

## Implement state persistence

To manually persist state, use the `Actor.on` method in the Apify SDK:
Use the [`Actor.useState()`](/sdk/js/reference/class/Actor#useState)/[`Actor.use_state()`](/sdk/python/reference/class/Actor#use_state) method to persist state across migrations. This method automatically saves your state to the key-value store and restores it when the Actor restarts.
Copy link
Contributor

@TC-MO TC-MO Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion for better clarity?

Suggested change
Use the [`Actor.useState()`](/sdk/js/reference/class/Actor#useState)/[`Actor.use_state()`](/sdk/python/reference/class/Actor#use_state) method to persist state across migrations. This method automatically saves your state to the key-value store and restores it when the Actor restarts.
Use the JS SDK's [`Actor.useState()`](/sdk/js/reference/class/Actor#useState) or Python SDK's [`Actor.use_state()`](/sdk/python/reference/class/Actor#use_state) methods to persist state across migrations. This method automatically saves your state to the key-value store and restores it when the Actor restarts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-docs Issues owned by technical writing team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants