# SWF

**Introduction**

* Simple Workflow Service (SWF) is a fully-managed state tracker and task coordinator
* Code run on EC2 (not serverless)
* If the app's steps take more than 500 milliseconds to complete, SWF can help
* Step Functions is recommended, unless:
  * Need external signals to intervene in the processes
  * Need child processes that return values to parent processes
  * AWS [Mechanical Turk](https://www.mturk.com/)

**Feature**

* Has a retention period of 14 days, can set up to 1 year
* Provide task-oriented API
* Ensure a task is run only once
* Keep track of tasks
* Cpncept of steps:
  * Decision step
  * Activity step
  * Human intervention step
* SWF actors (**Not support Spot Instance**):
  * Starter: like a trigger
  * Decider: control the flow logic (if..., then..., else...)
  * Worker: carry out the activity
