AWS TRANSCRIBE - Start Job (Iniciar Transcrição)
O que é esta operação?
A operação startJob do AWS Transcribe é responsável por iniciar um trabalho de transcrição assíncrona de áudio para texto.
Por que esta operação existe?
- Transcrição de Chamadas: Converter gravações de call center em texto
- Legendas Automáticas: Gerar legendas para vídeos
- Análise de Sentimento: Processar áudio para análise posterior
- Documentação: Transcrever reuniões e entrevistas
- Acessibilidade: Criar versões em texto de conteúdo de áudio
Como funciona internamente?
Código (aws-transcribe.executor.ts:66-93):
private async startJob(client: TranscribeClient, data: any, context: ExecutionContext): Promise<any> {
const jobName = this.replaceVariables(data.jobName, context.variables);
const s3Uri = this.replaceVariables(data.s3Uri, context.variables);
const languageCode = data.languageCode || 'en-US';
const mediaFormat = data.mediaFormat || 'mp3';
const command = new StartTranscriptionJobCommand({
TranscriptionJobName: jobName,
LanguageCode: languageCode,
MediaFormat: mediaFormat,
Media: {
MediaFileUri: s3Uri,
},
OutputBucketName: data.outputBucket ? this.replaceVariables(data.outputBucket, context.variables) : undefined,
Settings: data.settings ? {
ShowSpeakerLabels: data.settings.showSpeakerLabels || false,
MaxSpeakerLabels: data.settings.maxSpeakerLabels || 2,
ChannelIdentification: data.settings.channelIdentification || false,
} : undefined,
});
const response = await client.send(command);
return {
transcriptionJob: response.TranscriptionJob,
jobName: response.TranscriptionJob?.TranscriptionJobName,
status: response.TranscriptionJob?.TranscriptionJobStatus,
};
}
Parâmetros
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| operation | string | Sim | "startJob" |
| jobName | string | Sim | Nome único do trabalho |
| s3Uri | string | Sim | URI completa do áudio no S3 (s3://bucket/file.mp3) |
| languageCode | string | Não | Idioma (padrão: "en-US", pt-BR disponível) |
| mediaFormat | string | Não | Formato: mp3, mp4, wav, flac (padrão: mp3) |
| outputBucket | string | Não | Bucket para salvar resultado |
| settings | object | Não | Configurações avançadas (speakers, channels) |
| responseVariable | string | Sim | Variável para armazenar resultado |
Exemplo: Transcrição de Atendimento
{
"name": "Transcrever Chamada de Atendimento",
"nodes": [
{
"id": "start_1",
"type": "start",
"position": { "x": 100, "y": 100 },
"data": { "label": "Início" }
},
{
"id": "input_1",
"type": "input",
"position": { "x": 300, "y": 100 },
"data": {
"label": "ID da Chamada",
"parameters": {
"message": "Digite o ID da chamada para transcrever:",
"variableName": "callId"
}
}
},
{
"id": "transcribe_1",
"type": "aws_transcribe",
"position": { "x": 500, "y": 100 },
"data": {
"label": "Iniciar Transcrição",
"operation": "startJob",
"config": {
"region": "us-east-1",
"accessKeyId": "KEY",
"secretAccessKey": "SECRET"
},
"jobName": "call-{{callId}}-{{timestamp}}",
"s3Uri": "s3://call-recordings/{{callId}}.mp3",
"languageCode": "pt-BR",
"mediaFormat": "mp3",
"settings": {
"showSpeakerLabels": true,
"maxSpeakerLabels": 2
},
"responseVariable": "transcription"
}
},
{
"id": "message_1",
"type": "message",
"position": { "x": 700, "y": 100 },
"data": {
"label": "Confirmação",
"parameters": {
"message": "✅ Transcrição iniciada!\n\nJob: {{transcription.jobName}}\nStatus: {{transcription.status}}\n\n⏳ O processamento pode levar alguns minutos."
}
}
},
{
"id": "end_1",
"type": "end",
"position": { "x": 900, "y": 100 },
"data": { "label": "Fim" }
}
],
"edges": [
{ "source": "start_1", "target": "input_1" },
{ "source": "input_1", "target": "transcribe_1" },
{ "source": "transcribe_1", "target": "message_1" },
{ "source": "message_1", "target": "end_1" }
]
}
Resposta
{
"transcriptionJob": {},
"jobName": "call-12345-20250113",
"status": "IN_PROGRESS"
}
Boas Práticas
✅ Use nomes de job únicos | Configure idioma correto | Use speaker labels para call center | Armazene áudio no S3 previamente
❌ Não reutilize nomes de job | Não esqueça formato correto de s3Uri (s3://) | Não transcreva áudio muito longo sem quebrar
💡 Dica: Status possíveis: QUEUED, IN_PROGRESS, COMPLETED, FAILED. Use getJob para verificar progresso.