TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tools for converting Python code to AWS Step Function JSON

86 pointsby ocfnashabout 7 years ago

4 comments

strigliaabout 7 years ago
Great to see open source tooling around Step Functions. Personally I&#x27;m still holding out for someone taking the States language spec (<a href="https:&#x2F;&#x2F;states-language.net&#x2F;spec.html" rel="nofollow">https:&#x2F;&#x2F;states-language.net&#x2F;spec.html</a>) and turning out higher-level tooling for writing&#x2F;inspecting&#x2F;manipulating state machines.<p>Agree w&#x2F; bpicolo (hi Ben!) that the tooling still can come a long way for those who can&#x27;t use Lambdas directly. This code is interesting, but it misses my major use case for Step Functions -- running a workflow across several services transparently.<p>If I had to guess the future, I suspect that tools like Step Functions will become more and more crucial as we realize that in a FaaS world the job of coordination is complex and essential.<p>Interesting video from Tim Bray showing off the variety of Step Function uses in the wild <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=sMaqd5J69Ns" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=sMaqd5J69Ns</a>. Lots of Lambda, but not solely!
ak217about 7 years ago
Step Functions have great potential for orchestrating complex executions of Lambdas or even fleets of them. My co-workers and I designed a threadpool pattern with step functions that we use for orchestrating complex long-running tasks: <a href="https:&#x2F;&#x2F;github.com&#x2F;kislyuk&#x2F;domovoi&#x2F;blob&#x2F;master&#x2F;domovoi&#x2F;examples&#x2F;state_machine_threadpool_app.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kislyuk&#x2F;domovoi&#x2F;blob&#x2F;master&#x2F;domovoi&#x2F;examp...</a><p>However, there are currently some big issues with step functions: compared to Lambdas, they are not very scalable, not very economical, and have low I&#x2F;O size limits (because all I&#x2F;O gets interpreted by the executor, so they limit the state size to 32KB). Running Lambdas, we&#x27;re used to be able to burst to many thousands of concurrent executions. The Step Functions burst start limit is 500, with just 25 per second after that (and 400 for state transitions). This can be seriously limiting if you need to process more activities in your system.
bpicoloabout 7 years ago
Step functions have a lot of good use cases - strong guarantees, concurrent, distributed, good at recovery in all the right ways. It&#x27;s a terrific queueing layer abstraction for complex business processes. I suspect there are a lot of businesses out there with adhoc state machine definitions in queue workers that would benefit from formalization.<p>I had a closed-source proof of concept for a little framework for building these in Python while at a former employer that worked out pretty neat. The gist was arranging &#x2F; building them more in pure code and automatically generating&#x2F;deploying lambda tasks and state machine.<p><pre><code> @task(name=&#x27;foo&#x27;) def some_lambda(input): .... state_machine = StateMachine( {...define_some_steps} ) </code></pre> then it was able to take advantage of Zappa to immutable deploy steps as lambdas and build new state machine definitions with a little bit of python magic. Was pretty nifty and not particularly tricky to make it work.<p>Amazon would do really well releasing a maintained open-source lib &#x2F; docker container that would be able to emulate state machines locally. The definition language is pretty simple, but it&#x27;s something that you definitely want to be able to test end-to-end. I at one point did a little PoC for that bit too (<a href="https:&#x2F;&#x2F;github.com&#x2F;bpicolo&#x2F;local-step-functions" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bpicolo&#x2F;local-step-functions</a>).<p>The one big miss for me in step functions right now is that Tasks can&#x27;t just POST to an HTTP endpoint for request&#x2F;response to take advantage of existing infrastructure&#x2F;http services easily. That&#x27;d be a real killer feature. They&#x27;re currently distributed in nature requiring lambdas or polling daemons, which is powerful but also requires a lot of operational &#x2F; configuration &#x2F; deployment overhead where a simpler model would suffice for many use cases - seems like there&#x27;s no reason you shouldn&#x27;t be able to just deploy a monolith and get a lot of use out of step functions in that regard. There are ways you could sort of shim it with lambdas but the overhead is pretty high to do that (you&#x27;d need to carry &#x2F; edit routes in the task data which would ruin the declarative nature of task definitions)
brylieabout 7 years ago
This seems similar to Apache Airflow:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;apache&#x2F;incubator-airflow&#x2F;blob&#x2F;master&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;apache&#x2F;incubator-airflow&#x2F;blob&#x2F;master&#x2F;READ...</a>