welcome back to back space Academy in this lecture I'm going to go through a 2
high-level overview of the simple workflow service or SWF for short for 3
the associate level certifications you're going to need to have just a 4
understanding of SWF you're not going to need to be an expert in applying and 5
study with and using it from a hands-on perspective but you do need to 6
understand what the terminology around SWF how it works how you would implement 7
it and what and what an example of it would look like. SWF it coordinates 8
work across distributed application components and it helps implement 9
complex business processes and application workflows it's suitable for 10
long-running execution it's not really suitable it can be used for batch 11
processes but it's more suitable for long-running processes for business 12
processes and for long-running workflows and enables complex interactions between 13
a different applications on different platforms between AWS and on-premise 14
infrastructure and even with different users on AWS the features of SWF the 15
tasks are executed with no duplicates the routing it provides routing and 16
queuing of the tasks and it also provides timeout and execution status of 17
tasks and the workflows they can have child workflow so you can have a 18
hierarchy of workflows it also allows the user data input and execution of 19
results to be output as well the components of SWF a workflow that is the 20
control flow logic for the execution of tasks it's like our our business process 21
flow or our workflow so that is the control flow logic and then we have a 22
domain and that contains a work flow or a number of workflows and we have tasks 23
and they can be performed by executable code they can be a web service call or 24
they can even be an end user input they can be performed in parallel or Sara Lee 25
and so they form the basis of our workflow then we have actors and the 26
actors interact directly with SWF to coordinate tasks so what is an actor so 27
an actor can be a workflow starter it can be a decider or an activity worker a 28
workflow starter that can initiate the execution of a workflow a decider that 29
implements the workflow logic and notifies SWF of changes during the 30
workflow execution and the activity figures will they do the work so they 31
perform the activity tasks of the workflow tasks must be registered using 32
either the console or register activity type action which you can do through the 33
API and CLI as well when scheduled you can specify a task 34
list which is a basically a queue and decision and activity tasks they have 35
separate lists or queues particular tasks can be assigned to a particular 36
activity workers you've required through task routing. SWF it's implemented by 37
having communication between the swf service and our applications so our 38
applications can communicate to SWF through the software development kits 39
that are available for a number of languages through the SWF API and that 40
allows us to do HTTP POST calls to the API and we also have a flow framework 41
which is available for Java or Ruby which also has a number of features that 42
simplify creating communication paths to SWF an SWF can also be set up using the 43
console or the command line interface so what does an 44
example look like of SWF workflow so here is a very simple example that was 45
on the AWS website so it's for a video transcoding a transcoding application 46
and it's a very simple process that just grabs a video in codes at video and adds 47
digital rights management or copyright protection to that video and then it 48
finishes so we have actors as we remember from the previous slide we have 49
workflow starters we have workers and we also have decider actors so L started 50
our process there we can see in the middle there Amazon SWS we have in code 51
tasks DRM tasks and we also have decide at asset that occur there that make 52
decisions within that workflow so it starts there with our web server front-end 53
that is our workflow starter it's our starter actor and that will accept the 54
video URL and that will communicate with Amazon SWF to start the process to start 55
this workflow from there swf will create a task for encoding and it will put that 56
task into a task list and it will sit there until such time as an activity 57
worker is available to do that task when that task is finished it will return the 58
results and those results will be looked at by the decider actor and then the 59
decider will decide or will communicate back to the SWF service and from there 60
if everything is ok it will go on to the next task being the DRM task and again 61
that will go into another task list and when a worker is available then that 62
task will be completed and then we go back the decider will decide that the 63
execution has been completed and that will be the end of that process so 64
that's a very simple application but as you can see SWF 65
takes a lot of the headache out of implementing business processes to 66
implementing workflows in a very systematic way so that the end of that 67
lesson on SWF and I look forward to you in the next ones