You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty new to xstate, and am building a workflow that relies on input from a webhook. Most of the actions are async, as it involves sending an email, or making database updates.
Because the flow only runs after receiving a webhook, I need to be able to create a snapshot, and restore it every time this webhook is invoked.
I've gone through the entire documentation, and all of the examples, but none of it mentions how to handle this.
Below is a basic example of my webhook annd workflow. As you can probably tell, the main problem lies with storing the final snapshot. I have no idea to get a snapshot after an event was send.
Here's an example of what I expect the flow to look like:
Webhook triggers request.received and completes. The current state should be wait_for_request_prompt after requestReceived was executed.
Second webhook triggers request.prompt. The current state should be wait_for_request_processing after requestPromptReceived was executed.
In most other events, it will return to the idle state.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm pretty new to xstate, and am building a workflow that relies on input from a webhook. Most of the actions are async, as it involves sending an email, or making database updates.
Because the flow only runs after receiving a webhook, I need to be able to create a snapshot, and restore it every time this webhook is invoked.
I've gone through the entire documentation, and all of the examples, but none of it mentions how to handle this.
Below is a basic example of my webhook annd workflow. As you can probably tell, the main problem lies with storing the final snapshot. I have no idea to get a snapshot after an event was send.
Here's an example of what I expect the flow to look like:
request.received
and completes. The current state should bewait_for_request_prompt
afterrequestReceived
was executed.request.prompt
. The current state should bewait_for_request_processing
afterrequestPromptReceived
was executed.In most other events, it will return to the
idle
state.Beta Was this translation helpful? Give feedback.
All reactions