Step Functions MAP state billing question
Hello,
I was wondering how billing works for the 'map' state in step functions. Let's say I have an array with 100 items and they are processed by map state. States in map state are;
1- pass 2- wait 3- pass
so in this case there are at least 300 transitions, right? Meaning almost 300 times more expensive than handling all items in a lambda function with a 'for loop' or something similar.
I could not find any documentation about the billing of map state. I hope somebody can help me out with this.
Thanks!
Each step execution, including the steps invoked by map state count as a billable step function state execution. So yes, if you execute 300 steps that is 300 times more expensive then executing 1 step -- in Step Functions Cost The total cost will depend on the cost of the lambda and anything it does as well.
One approach to managing large lists is to break the list into 'buckets' using the Map state, then send each 'bucket' to a lambda call. Example, if you have 1,000,000 objects, construct a map state that segments them into iterations of 1000 each, then call the lambda 1000 times with 1000 records each. Adjust the size of the buckets as needed for your use case so that the time it takes to execute each bucket is 'reasonable' for your case. If you already can process the largest size of your data set in 1 lambda call and there is no other value in splitting them up, then you dont need map. Or if the total cost of the worse case is small enough for your use case then use the approach that works best.
It depends on the type of workflow you've selected. The standard one is billed by the number of state transitions, so yes if you loop with a map state, it will cost the number of iteration * the number of states in each iteration. If you can use the express workflow, the cost is much lower (you pay per number of executions).
How to choose: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html (the main limit is the 5 minutes duration for express vs 1 year for standard...)
Relevant questions
Step Functions MAP state billing question
Accepted Answerasked 5 months agoCan I specify GET URL path parameter in step function?
asked 3 months agoAWS StepFunctions: sum() function returns error about not finding path
asked 2 months agohow to trigger a step function from a s3 object notification?
asked a month agoState Language Specification
asked 2 months agoStep function state to execute a Glue job seems to be stalling
asked a year agoStep Function - dynamodb query with Boolean Filter
Accepted Answerasked 3 months agoStep Function Retry Metrics
asked 3 months agoS3 object and lambda function in step machine with the asynchronous express workflows
Accepted Answerasked 4 months agoStep Function error handling
asked a month ago