Amazon Forecast · Arazzo Workflow

Amazon Forecast Provision Dataset

Version 1.0.0

Create a dataset, poll until it becomes ACTIVE, and tag it.

1 workflow 1 source API 1 provider
View Spec View on GitHub ForecastingMachine LearningPredictive AnalyticsTime SeriesArazzoWorkflows

Provider

amazon-forecast

Workflows

provision-dataset
Create an Amazon Forecast dataset and wait until it is ACTIVE.
Creates a dataset, polls describeDataset until the dataset status is ACTIVE, and then associates the supplied tags with the dataset.
3 steps inputs: dataFrequency, datasetName, datasetType, domain, schema, tags outputs: datasetArn, status
1
createDataset
createDataset
Create the Amazon Forecast dataset using the supplied name, domain, type and schema.
2
waitForActive
describeDataset
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.
3
tagDataset
tagResource
Apply the supplied metadata tags to the now-ACTIVE dataset.

Source API Descriptions

Arazzo Workflow Specification

amazon-forecast-provision-dataset-workflow.yml Raw ↑
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