forked from aws-samples/amazon-transcribe-comprehend-podcast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpodcast-state-definition.json
103 lines (103 loc) · 2.59 KB
/
podcast-state-definition.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"StartAt": "IsDryRun",
"States": {
"IsDryRun": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.dryrun",
"StringEquals": "TRUE",
"Next": "Complete"
}
],
"Default": "Download Podcast"
},
"Download Podcast": {
"Type": "Task",
"Resource": "${downloadPodcast.Arn}",
"ResultPath": "$.audioS3Location",
"Next": "Start Transcribe"
},
"Start Transcribe": {
"Type": "Task",
"Resource": "${podcastTranscribe.Arn}",
"InputPath": "$",
"ResultPath": "$.transcribe",
"Next": "Check Transcribe Status",
"Retry": [
{
"ErrorEquals": [ "ThrottlingException" ],
"IntervalSeconds": 120,
"BackoffRate": 2,
"MaxAttempts": 5
},
{
"ErrorEquals": [ "States.ALL" ],
"IntervalSeconds": 60,
"BackoffRate": 2,
"MaxAttempts": 3
}
]
},
"Check Transcribe Status": {
"Type": "Task",
"Resource": "${checkTranscribe.Arn}",
"InputPath": "$.transcribe",
"ResultPath": "$.transcribeStatus",
"Next": "Is Transcribe Completed?"
},
"Wait for Transcribe Completion": {
"Type": "Wait",
"Seconds": 60,
"Next": "Check Transcribe Status"
},
"Is Transcribe Completed?": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.transcribeStatus.status",
"StringEquals": "COMPLETED",
"Next": "Process Transcription"
}
],
"Default": "Wait for Transcribe Completion"
},
"Process Transcription": {
"Type": "Parallel",
"Branches": [
{
"StartAt": "Process Transcript by Paragraph",
"States": {
"Process Transcript by Paragraph": {
"Type": "Task",
"Resource": "${processTranscriptionParagraph.Arn}",
"End": true
}
}
},
{
"StartAt": "Generate Full Text Transcript",
"States": {
"Generate Full Text Transcript": {
"Type": "Task",
"Resource": "${processTranscriptionFullText.Arn}",
"End": true
}
}
}
],
"ResultPath": "$.processedTranscription",
"Next": "uploadToElasticsearch"
},
"uploadToElasticsearch": {
"Type": "Task",
"Resource": "${uploadToElasticsearch.Arn}",
"InputPath": "$",
"ResultPath": "$.elasticsearchResult",
"Next": "Complete"
},
"Complete": {
"Type": "Succeed"
}
}
}