Open Beta

Execute the choreography

AMPLIFY Choreography text-based command line interface (CLI) is used to execute the choreography. Choreography allows the publishing service to execute the service and publish the output without having to be aware of the subscribing services.

Before you start

Create the choreography. See Create the choreography using the CLI.

Objectives

  • Use CLI commands to execute a choreography
  • Use a metadata.json file to pass key / value pairs to the services in the choreography

Execute the choreography

You must know the name of the choreography you are executing.

The choreography run command executes the choreography.

Note   You can also use choreo as a shortcut for choreography.

$ amplify ace choreography run <name> [options]

name = the name of the choreography to run.

To pass an optional file containing a payload. Note In the next three examples, filepath must be the path that is accessible by the business service. For example, an Amazon S3 bucket, a file on Git hub, a file on an FTP server, etc.

$ amplify ace choreography run <name> --f=<filePath>

To pass an optional reference to a file containing the payload:

$ amplify ace choreography run <name> --ref=<filePath>

To pass an optional file containing metadata (JSON format):

$ amplify ace choreography run <name> --meta=<filePath>

Metadata provides a way to send specific key / value pairs to the services in the choreography that contain specific data values needed by those services.

Sample metadata.json sample format:

{
"metadataitem1": "my_specific_value",
"metadataitem2": "another value"        
}

The following run example executes the choreography with optional payload and optional metadata:

$ amplify ace choreo run mychoreo --f=%PAYLOAD_FILE% --meta=%METADATA_FILE%

You can also enter amplify ace choreography run -h for help.

Related Links