06 Oct 2023 02:03 PM
Hi!
Is it possible to read and write an AppState from the workflow level? As for now, I am receiving an error (code 541).
Thank you!
Solved! Go to Solution.
06 Oct 2023 02:50 PM
Hi @veranika_k!
From the error you're getting, I suspect that you're utilizing the "Run Javascript" action to read/write AppState. Unfortunately, it won't work, as the State API requires app context (its ID, to be precise) to work, whereas "Run Javascript" is an ad-hoc action with no app context (ID).
To make it work, you would need an app function. Also, you can find more details about the State SDK client in the documentation.
Please let me know if I can help you further.
11 Oct 2023 05:04 PM
Great response @michal_zawislak although to clarify the latter part of your answer. I just experimented with it in an app, and it seems that app states can be directly called from an app - so it’s not required to call app states from a function.
So using, and accessing app state as part of workflows or notebooks doesn’t work as you mentioned already; it is missing the app context. Accessing app state only makes sense within (custom) apps.
Best,
Sini
12 Oct 2023 07:27 AM
Hi @sinisa_zubic,
Thank you for the clarification! You're right, and I misread the documentation. It clearly states that app states can be used only in the (custom) apps.