Metail Scanatar Service

In ADR 12 we note that the Metail Scanatar Creation service will be invoked by starting an AWS Step Function execution.

The StartExecution API endpoint is documented here. The parameters of interest are:

Field Description
input JSON input data for the execution
name The name of the execution (a random UUID)
stateMachineArn ARN of the step function - will be known once the endpoint is in place


The step function input JSON (serialized to a string in the input field above) must conform to the following schema:

    "$schema": "",
    "$id": "",
    "title": "Metail Scanatar Service",
    "description": "Step function input for Metail Scanatar creation",
    "type": "object",
    "properties": {
        "inputScan": {
            "description": "Presigned GET URL for the Quantacorp scan in Google Cloud Storage",
            "type": "string",
            "format": "uri"
        "outputAvatar": {
            "description": "Presigned PUT URL for the output scanatar in Google Cloud Storage",
            "type": "string",
            "format": "uri"
        "outputError": {
            "description": "Presigned PUT URL for pipeline error metadata in Google Cloud Storage",
            "type": "string",
            "format": "uri"
        "gender": {
            "description": "Gender of the subject",
            "type": "string",
            "enum": ["male", "female"]
    "required": ["inputScan", "outputAvatar", "outputError", "gender"],
    "examples": [
	        "inputScan": "",
            "outputAvatar": "",
            "outputError": "",
            "gender": "female"

Error Handling

If the pipeline fails with an error, a JSON payload is written to the outputError URL (a pre-signed PUT URL in the input) with an error message and the id of the failed Step Function execution. For example:

    "Message":"Mesh pipeline failed"

Note on implementation

Developers rarely need to be concerned with the underlying REST API for AWS services - it is much more common to use one of the AWS SDKs. For example, to invoke the scanatar step function from a Python program you would use the boto3 step function client and your code would look something like:

import json
import uuid
import boto3

SFN_ARN = 'arn:aws:states:{region}:{accountId}:stateMachine:etryon-scanatar-creation'

client = boto3.client('stepfunctions')
response = client.start_execution(
	    "inputScan": INPUT_URL,
        "outputAvatar": OUTPUT_URL,
        "outputError": ERROR_URL,
        "gender": "female"
print(f'Started execution {response["executionArn"]}')