Amazon Polly · Arazzo Workflow

Amazon Polly Store Lexicon and Synthesize With It

Version 1.0.0

Store a pronunciation lexicon, confirm it, then synthesize speech applying it.

1 workflow 1 source API 1 provider
View Spec View on GitHub AIMachine LearningSpeech SynthesisText-To-SpeechTTSVoiceSSMLNeural EngineGenerative AIArazzoWorkflows

Provider

amazon-polly

Workflows

put-lexicon-synthesize
Store a lexicon, verify it, and synthesize speech that applies it.
Stores a PLS lexicon under the supplied name, confirms it is retrievable, and synthesizes the input text with that lexicon applied during synthesis.
3 steps inputs: amzDate, authorization, content, contentSha256, lexiconName, outputFormat, securityToken, text, voiceId outputs: lexiconName, requestCharacters
1
putLexicon
PutLexicon
Store the PLS lexicon under the supplied name, overwriting any existing lexicon with the same name in the region.
2
getLexicon
GetLexicon
Read the lexicon back to confirm it was stored and is available for synthesis before applying it.
3
synthesizeWithLexicon
SynthesizeSpeech
Synthesize the supplied text, applying the stored lexicon so the audio reflects the custom pronunciations.

Source API Descriptions

Arazzo Workflow Specification

amazon-polly-put-lexicon-synthesize-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Amazon Polly Store Lexicon and Synthesize With It
  summary: Store a pronunciation lexicon, confirm it, then synthesize speech applying it.
  description: >-
    Demonstrates the custom pronunciation flow in Amazon Polly. The workflow
    stores a PLS pronunciation lexicon with PutLexicon, reads it back with
    GetLexicon to confirm it landed, and then calls SynthesizeSpeech with the
    lexicon name applied so the synthesized audio honors the custom
    pronunciations. Each step spells out its request inline, including the AWS
    Signature Version 4 signing headers, so the flow can be read and executed
    without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: pollyApi
  url: ../openapi/amazon-polly-openapi-original.yaml
  type: openapi
workflows:
- workflowId: put-lexicon-synthesize
  summary: Store a lexicon, verify it, and synthesize speech that applies it.
  description: >-
    Stores a PLS lexicon under the supplied name, confirms it is retrievable,
    and synthesizes the input text with that lexicon applied during synthesis.
  inputs:
    type: object
    required:
    - lexiconName
    - content
    - amzDate
    - authorization
    - text
    - outputFormat
    - voiceId
    properties:
      lexiconName:
        type: string
        description: Case-sensitive alphanumeric lexicon name (1-20 chars).
      content:
        type: string
        description: The PLS lexicon content as a string.
      amzDate:
        type: string
        description: The X-Amz-Date timestamp used to sign the requests.
      authorization:
        type: string
        description: The full SigV4 Authorization header value for the request.
      contentSha256:
        type: string
        description: The X-Amz-Content-Sha256 hex digest of the request payload.
      securityToken:
        type: string
        description: Optional X-Amz-Security-Token for temporary credentials.
      text:
        type: string
        description: The input text (plain text or SSML) to synthesize.
      outputFormat:
        type: string
        description: The audio output format (mp3, ogg_vorbis, pcm, or json).
      voiceId:
        type: string
        description: Voice ID to use for the synthesis (e.g. Joanna).
  steps:
  - stepId: putLexicon
    description: >-
      Store the PLS lexicon under the supplied name, overwriting any existing
      lexicon with the same name in the region.
    operationId: PutLexicon
    parameters:
    - name: LexiconName
      in: path
      value: $inputs.lexiconName
    - name: X-Amz-Date
      in: header
      value: $inputs.amzDate
    - name: Authorization
      in: header
      value: $inputs.authorization
    - name: X-Amz-Content-Sha256
      in: header
      value: $inputs.contentSha256
    - name: X-Amz-Security-Token
      in: header
      value: $inputs.securityToken
    requestBody:
      contentType: application/json
      payload:
        Content: $inputs.content
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $statusCode
  - stepId: getLexicon
    description: >-
      Read the lexicon back to confirm it was stored and is available for
      synthesis before applying it.
    operationId: GetLexicon
    parameters:
    - name: LexiconName
      in: path
      value: $inputs.lexiconName
    - name: X-Amz-Date
      in: header
      value: $inputs.amzDate
    - name: Authorization
      in: header
      value: $inputs.authorization
    - name: X-Amz-Content-Sha256
      in: header
      value: $inputs.contentSha256
    - name: X-Amz-Security-Token
      in: header
      value: $inputs.securityToken
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      lexiconName: $response.body#/Lexicon/Name
      lexiconAttributes: $response.body#/LexiconAttributes
  - stepId: synthesizeWithLexicon
    description: >-
      Synthesize the supplied text, applying the stored lexicon so the audio
      reflects the custom pronunciations.
    operationId: SynthesizeSpeech
    parameters:
    - name: X-Amz-Date
      in: header
      value: $inputs.amzDate
    - name: Authorization
      in: header
      value: $inputs.authorization
    - name: X-Amz-Content-Sha256
      in: header
      value: $inputs.contentSha256
    - name: X-Amz-Security-Token
      in: header
      value: $inputs.securityToken
    requestBody:
      contentType: application/json
      payload:
        LexiconNames:
        - $inputs.lexiconName
        OutputFormat: $inputs.outputFormat
        Text: $inputs.text
        VoiceId: $inputs.voiceId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      contentType: $response.body#/ContentType
      requestCharacters: $response.body#/RequestCharacters
  outputs:
    lexiconName: $steps.getLexicon.outputs.lexiconName
    requestCharacters: $steps.synthesizeWithLexicon.outputs.requestCharacters