1
00:00:00,120 --> 00:00:07,440
In this video, we are going to learn a step function core concepts which are the state machine states

2
00:00:07,440 --> 00:00:12,360
task space, weight, choice, parallel, succeed and fail.

3
00:00:12,720 --> 00:00:14,370
So let me start with the state mission.

4
00:00:14,370 --> 00:00:17,130
You can see the all caucus state in this list.

5
00:00:17,250 --> 00:00:21,060
I'm going to start explaining state mission in computer science.

6
00:00:21,090 --> 00:00:26,670
A state mission is defined as a type of computational device that is able to store various status values

7
00:00:26,670 --> 00:00:29,400
and update them based on the inputs.

8
00:00:29,880 --> 00:00:35,640
So it's a function which with this concept and use the state machine to refer to an application workflow.

9
00:00:35,970 --> 00:00:42,180
Developers can build a state machine in state functions with JSON files by using the Amazon State language.

10
00:00:42,360 --> 00:00:48,900
We can choose a standard workflow for processing that are long running tasks and also include the required

11
00:00:48,900 --> 00:00:50,190
human intervention.

12
00:00:50,370 --> 00:00:56,460
And also we can choose express workflows or suite for short running and high volume processes.

13
00:00:56,940 --> 00:00:58,930
So let me continue with the state.

14
00:00:58,950 --> 00:01:03,120
What is the state, state or element in our state machines?

15
00:01:03,150 --> 00:01:08,780
A state is referred by its name, which can be anything but which must be unique within the scope of

16
00:01:08,790 --> 00:01:10,230
the entire state machine.

17
00:01:11,180 --> 00:01:17,450
So individual states can make these decisions based on their input, perform actions and test output

18
00:01:17,450 --> 00:01:18,620
to other states.

19
00:01:18,650 --> 00:01:21,500
In step functions, we define our workflows.

20
00:01:21,500 --> 00:01:27,110
In the Amazon State language, the state functions console provide a graphical representation of that

21
00:01:27,110 --> 00:01:30,080
state machine to help visualize our application logic.

22
00:01:30,650 --> 00:01:36,950
So a state represent a step in our workflow so states can perform a variety of functions.

23
00:01:36,950 --> 00:01:42,500
You can think that all below items are state and these are the state options.

24
00:01:42,500 --> 00:01:50,390
For example, the state perform work in the state machine, which we call the task state and or we can

25
00:01:50,390 --> 00:01:53,030
chose between different parts in a workflow.

26
00:01:53,060 --> 00:01:56,630
This is the choice state or it is a stop the workflow.

27
00:01:56,660 --> 00:02:03,850
With the failure or success, we can give an example of fail or success state or this will be passed

28
00:02:03,860 --> 00:02:06,440
output or some fixed data to another state.

29
00:02:06,470 --> 00:02:13,070
It is a test state or it is a path to workflow for a specific amount of time.

30
00:02:13,070 --> 00:02:18,650
This is the way it state or we can begin parallel branches of execution.

31
00:02:18,650 --> 00:02:23,960
This is the parallel state or it can repeat execution for each item in the input.

32
00:02:23,960 --> 00:02:25,370
This is the map state.

33
00:02:25,550 --> 00:02:32,720
So the state that we decide to include in our state machine and the relation between our states form

34
00:02:32,720 --> 00:02:35,270
the core of our step function workflows.

35
00:02:35,270 --> 00:02:39,170
So now let me elaborate the task state tasks.

36
00:02:39,170 --> 00:02:44,090
State can be divided by two, which will be the activity task and the service task.

37
00:02:44,360 --> 00:02:46,370
It may explain the task state.

38
00:02:46,520 --> 00:02:53,690
A task state within your state machine is used to complete a single into a work task can be used to

39
00:02:53,690 --> 00:02:57,740
call the API actions of over the 200 Amazon services.

40
00:02:57,740 --> 00:03:01,760
Or we can perform another task which perform the complete operations.

41
00:03:01,850 --> 00:03:05,300
So there are two types of task can be included in our workflows.

42
00:03:05,300 --> 00:03:08,630
One is the activity task, the another is the service tasks.

43
00:03:08,660 --> 00:03:10,610
Let me explain activity tasks.

44
00:03:10,660 --> 00:03:17,480
Activity tasks basically connect a step in our workflow to batch code that is running elsewhere.

45
00:03:17,510 --> 00:03:23,240
This external batch of code called an activity worker post the step function for work and asynchronous

46
00:03:23,240 --> 00:03:26,810
to complete the work using our code and return the result.

47
00:03:26,840 --> 00:03:32,270
This is the Activity Task and activity task are common with the asynchronous workflow in which some

48
00:03:32,270 --> 00:03:33,890
human intervention is required.

49
00:03:33,890 --> 00:03:38,060
So these are the activity tasks that we can perform in the task state.

50
00:03:38,060 --> 00:03:42,290
And another task in the task state is service task.

51
00:03:42,380 --> 00:03:48,950
A service task let you connect steps in our workflow to specific services, set functions, send requests

52
00:03:48,950 --> 00:03:54,290
to other services, wait for the task to complete and then continues to next step in the workload.

53
00:03:54,320 --> 00:03:59,240
They can be used easily for automated steps, for example, executing lambda function.

54
00:03:59,240 --> 00:04:01,400
These are the service tasks.

55
00:04:01,640 --> 00:04:08,120
So basically within our console we are able to visualize and validate our set mission with using the

56
00:04:08,140 --> 00:04:09,020
step functions.

57
00:04:09,020 --> 00:04:16,010
So step functions provide the visualize and create our workflows very efficiently and very easily.

58
00:04:16,160 --> 00:04:18,800
So you can see this slide in the image here.

59
00:04:18,800 --> 00:04:26,210
You can see the for example, state name is a work delegate that performs a natively lambda function.

60
00:04:26,210 --> 00:04:28,490
You can see an example state in here.

61
00:04:28,490 --> 00:04:34,850
The name of the state is Helloworld and this is basically perform the helloworld lambda function.

62
00:04:34,850 --> 00:04:36,350
You can see the type as a task.

63
00:04:36,350 --> 00:04:37,940
The source is a lambda function.

64
00:04:37,940 --> 00:04:43,400
So this is the service task and you can see the next state and the command of this state.

65
00:04:43,640 --> 00:04:46,550
So basically state shares many common features.

66
00:04:46,580 --> 00:04:51,110
Each state must have a type field indicating what type of the state is.

67
00:04:51,230 --> 00:04:56,630
And also each state can have an optional command field that basically understand from the humans.

68
00:04:57,640 --> 00:05:03,010
And also each state requires a next field if it is not a succeed or failed state.

69
00:05:03,040 --> 00:05:04,900
That should be a next step.

70
00:05:05,020 --> 00:05:09,520
And alternatively, we can become a terminal state or by specifying the unfilled.
