Assembly.ai will asynchronously dispatch webhook events which we will subscribe to that will tell us the current state of the transcribe job.
Add the infrastructure to expose a HTTP api gateway endpoint that triggers a lambda function responsible for handling a completed or failed transcription job.
Create CDK resources to expose /webhook that triggers assembly webhook lambda
Update Assembly.AI calls to include generated API gateway endpoint so events can be returned to it
Lambda logic
Upon receiving async events from Assembly.AI determine the success or failure of the job
If failed mark video state as failed
If success then fetch the transcription output SRT file from Assembly.AI and store in S3 transcriptions bucket prefixed with the video ID for easy look up
Update the video to hold the transcriptionKey so it can be looked up by the encoding lambda when it will use the subtitles to encode onto a video
Assembly.ai will asynchronously dispatch webhook events which we will subscribe to that will tell us the current state of the transcribe job.
Add the infrastructure to expose a HTTP api gateway endpoint that triggers a lambda function responsible for handling a completed or failed transcription job.
Lambda logic