arazzo: 1.0.1 info: title: Amazon Forecast Provision Dataset summary: Create a dataset, poll until it becomes ACTIVE, and tag it. description: >- Stands up a single Amazon Forecast dataset that will hold time-series training data. The workflow creates the dataset, then repeatedly describes it until the resource reaches the ACTIVE status, and finally applies metadata tags to the new dataset. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: amazonForecastApi url: ../openapi/amazon-forecast-openapi.yml type: openapi workflows: - workflowId: provision-dataset summary: Create an Amazon Forecast dataset and wait until it is ACTIVE. description: >- Creates a dataset, polls describeDataset until the dataset status is ACTIVE, and then associates the supplied tags with the dataset. inputs: type: object required: - datasetName - domain - datasetType - schema properties: datasetName: type: string description: A name for the dataset. domain: type: string description: The domain associated with the dataset (e.g. RETAIL, CUSTOM). datasetType: type: string description: The dataset type (e.g. TARGET_TIME_SERIES). dataFrequency: type: string description: The frequency of data collection (e.g. D for daily). schema: type: object description: The schema for the dataset describing the data fields. tags: type: array description: The metadata tags to apply once the dataset is ACTIVE. items: type: object steps: - stepId: createDataset description: >- Create the Amazon Forecast dataset using the supplied name, domain, type and schema. operationId: createDataset requestBody: contentType: application/json payload: DatasetName: $inputs.datasetName Domain: $inputs.domain DatasetType: $inputs.datasetType DataFrequency: $inputs.dataFrequency Schema: $inputs.schema successCriteria: - condition: $statusCode == 200 outputs: datasetArn: $response.body#/DatasetArn - stepId: waitForActive description: >- Describe the dataset and confirm it has reached the ACTIVE status before tagging it. Repeat this step while the status is still CREATE_PENDING or CREATE_IN_PROGRESS. operationId: describeDataset parameters: - name: datasetArn in: path value: $steps.createDataset.outputs.datasetArn successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.Status == "ACTIVE" type: jsonpath onSuccess: - name: datasetActive type: goto stepId: tagDataset criteria: - context: $response.body condition: $.Status == "ACTIVE" type: jsonpath onFailure: - name: stillCreating type: retry retryAfter: 30 retryLimit: 20 criteria: - context: $response.body condition: $.Status != "ACTIVE" type: jsonpath outputs: status: $response.body#/Status - stepId: tagDataset description: >- Apply the supplied metadata tags to the now-ACTIVE dataset. operationId: tagResource parameters: - name: resourceArn in: path value: $steps.createDataset.outputs.datasetArn requestBody: contentType: application/json payload: Tags: $inputs.tags successCriteria: - condition: $statusCode == 200 outputs: taggedArn: $steps.createDataset.outputs.datasetArn outputs: datasetArn: $steps.createDataset.outputs.datasetArn status: $steps.waitForActive.outputs.status