out of curiosity does anyone use state machines wi...
# help
k
out of curiosity does anyone use state machines with serverless stacks?
s
I do. what’s up?
k
just wondering if it works well for you. Im thinking my lambda functions would benefit with state machines
s
depends on your use case, but yeah, they work great for me
k
what use cases do you find them useful in?
d
I use them on the front end. I’d like to know more about using them on the backend
s
@Kristian Lake anything that requires Lambda functions to execute in sequence, really. or branch to different functions conditionally
k
Thanks @Sam Hulick so daisy chaining lambda functions to other lambda functions and services? and using the step functions to handle flow/error logic?
s
exactly
k
brill. Glad I was thinking about them in the right way 🙂
s
I have two step functions. one is for user migration.. it goes through & migrates different types of data, one at a time, because each data type depends on the previous one being fully complete first. and then there’s a wait state that waits for one of the previous steps to complete before moving on the other is an audio processor that encodes audio and then runs some functions in parallel, like grabbing metadata & generating waveform data
k
nice thanks for your use cases
How do you find testing this?
s
pretty easy, thanks to SST 😉
k
thats what i wanted to hear 😄
I am hoping my lambdas (with step flows) can be mini programs that i can hit hard with functional testing and the step flows with integration tests
but still new to figuring that bit out
s
just be careful about the “hitting hard” part. you have a concurrency limit for Lambda (1000 concurrent invocations), and it can be easy to hit other rate limits for other services
k
ah thanks for the heads up
@Devin what are your use cases for them on the front end? 🙂
d
I run my entire front end on state machines. Modal has a state of visible and hidden and visible responds to events like
close
k
ah thats really cool