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), Failure which simply ends the state machine with a bit of optional extra error metadata, Success which 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, null to pass none (Task will get {} as input)
  • RP can use $ to pass just it to output (discard input), null to discard Task result, only support a subset of JSON Path b/c they are so-called reference paths which 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 null to 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)