2018 Sun May 20
AWS Step Functions
- AWS step functions can be implemented with an aws lambda
- The terminology is state machines with states and each state can be an AWS Lambda
- State names are scoped to region, not to the state machine they show up in... wtf (ref)
State machine names must be 1–80 characters in length, must be unique for your account and region, and must not contain any of the following: [...]
- There are several types of states:
Task(bread and butter, run some logic),Pass(for noops),Choice(for branching based on task result),Parallel(for running multiple whole state machines at the same time, blocking for completion of all, aggregating results),Failurewhich simply ends the state machine with a bit of optional extra error metadata,Successwhich simply ends the state machine happily. (ref) - There is the concept of paths. The purpose of paths is to control the data flowing through the state machine and navigating how to react to its structure. There are three types of paths:
InputPath,OutputPath,ResultPath. IP is concerned with a selector that filters the data sent to the state task, output path is concerned with filtering what the state passes to the next state, result path is concerned with where the task result will fit into the given input. (ref) The flow of path filtering is:state previous -> input -> state now -> IP -> task -> RP -> OP -> output -> state next - paths are expressed as JSON Path
- IP can use
$to pass all input,nullto pass none (Taskwill get{}as input) - RP can use
$to pass just it to output (discard input),nullto discardTaskresult, only support a subset of JSON Path b/c they are so-calledreference pathswhich must identify a single node in a json structure. - OP must match something in IP/RP or else an exception is raised
- OP can use
nullto pass{}as input to next state - If a state does not execute a task its input is its output
- Still need to read about errors (ref)