arazzo: 1.0.1 info: title: Amazon Forecast Group Then Train summary: Create a dataset group, wait until ACTIVE, then train a predictor on it. description: >- Bridges dataset-group provisioning into model training. The workflow creates a dataset group from existing dataset ARNs, polls the dataset group listing until the group reports an ACTIVE status, and then creates a predictor whose input data configuration trains against that group. Because the Forecast description only exposes a describe operation for datasets, dataset group status is read from listDatasetGroups. 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: group-then-train summary: Create a dataset group, wait until ACTIVE, then train a predictor. description: >- Creates a dataset group from supplied dataset ARNs, polls listDatasetGroups until the group is ACTIVE, and then creates a predictor trained on it. inputs: type: object required: - datasetGroupName - domain - datasetArns - predictorName - forecastHorizon - inputDataConfig - featurizationConfig properties: datasetGroupName: type: string description: A name for the dataset group. domain: type: string description: The domain associated with the dataset group. datasetArns: type: array description: The dataset ARNs to include in the group. items: type: string predictorName: type: string description: A name for the predictor. forecastHorizon: type: integer description: The number of time-steps to predict. inputDataConfig: type: object description: The training input configuration referencing the dataset group. featurizationConfig: type: object description: The featurization configuration for the predictor. steps: - stepId: createDatasetGroup description: >- Create the dataset group from the supplied dataset ARNs. operationId: createDatasetGroup requestBody: contentType: application/json payload: DatasetGroupName: $inputs.datasetGroupName Domain: $inputs.domain DatasetArns: $inputs.datasetArns successCriteria: - condition: $statusCode == 200 outputs: datasetGroupArn: $response.body#/DatasetGroupArn - stepId: waitForGroupActive description: >- List dataset groups and confirm the newly created group has reached the ACTIVE status. Repeat this step while the group is still being created. operationId: listDatasetGroups successCriteria: - condition: $statusCode == 200 - context: $response.body condition: $.DatasetGroups[?(@.DatasetGroupArn == "$steps.createDatasetGroup.outputs.datasetGroupArn")].Status contains "ACTIVE" type: jsonpath onSuccess: - name: groupActive type: goto stepId: createPredictor criteria: - context: $response.body condition: $.DatasetGroups[?(@.DatasetGroupArn == "$steps.createDatasetGroup.outputs.datasetGroupArn")].Status contains "ACTIVE" type: jsonpath onFailure: - name: stillCreating type: retry retryAfter: 30 retryLimit: 20 criteria: - condition: $statusCode == 200 outputs: datasetGroups: $response.body#/DatasetGroups - stepId: createPredictor description: >- Train a predictor against the now-ACTIVE dataset group. operationId: createPredictor requestBody: contentType: application/json payload: PredictorName: $inputs.predictorName ForecastHorizon: $inputs.forecastHorizon InputDataConfig: $inputs.inputDataConfig FeaturizationConfig: $inputs.featurizationConfig successCriteria: - condition: $statusCode == 200 outputs: predictorArn: $response.body#/PredictorArn outputs: datasetGroupArn: $steps.createDatasetGroup.outputs.datasetGroupArn predictorArn: $steps.createPredictor.outputs.predictorArn