arazzo: 1.0.1 info: title: Adafruit IO Provision Feed and Seed Data summary: Create a feed, push an initial data point to it, then read the last value back. description: >- The canonical first run for any Adafruit IO device or integration. The workflow creates a new feed for the current user, writes an initial data point to that feed, and then reads the most recent value back so the caller can confirm the feed is live and accepting data. Every step spells out its request inline — including the username path parameter and the X-AIO-Key authentication header — so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: adafruitIoApi url: ../openapi/adafruit-io-rest-api-openapi.yml type: openapi workflows: - workflowId: provision-feed-and-seed-data summary: Create a feed, write its first data point, and read the latest value back. description: >- Provisions a brand new feed for the user, seeds it with an initial value, and confirms the feed is live by fetching the most recent data point. inputs: type: object required: - username - aioKey - name - value properties: username: type: string description: A valid Adafruit IO username (the account that owns the feed). aioKey: type: string description: The Adafruit IO API key, sent in the X-AIO-Key header. name: type: string description: Human readable name for the new feed (e.g. "Living Room Temp"). key: type: string description: Optional machine key for the feed; generated from the name if omitted. description: type: string description: Optional description for the new feed. value: type: string description: The initial data point value to write to the new feed. steps: - stepId: createFeed description: >- Create a new feed for the user with the supplied name, optional key, and optional description. operationId: createFeed parameters: - name: username in: path value: $inputs.username - name: X-AIO-Key in: header value: $inputs.aioKey requestBody: contentType: application/json payload: name: $inputs.name key: $inputs.key description: $inputs.description successCriteria: - condition: $statusCode == 200 outputs: feedKey: $response.body#/key feedId: $response.body#/id - stepId: seedData description: >- Write the initial data point to the newly created feed using its returned feed key. operationId: createData parameters: - name: username in: path value: $inputs.username - name: feed_key in: path value: $steps.createFeed.outputs.feedKey - name: X-AIO-Key in: header value: $inputs.aioKey requestBody: contentType: application/json payload: value: $inputs.value successCriteria: - condition: $statusCode == 200 outputs: dataId: $response.body#/id - stepId: readLast description: >- Read the most recent data point from the feed to confirm the seed value was stored and the feed is live. operationId: lastData parameters: - name: username in: path value: $inputs.username - name: feed_key in: path value: $steps.createFeed.outputs.feedKey - name: X-AIO-Key in: header value: $inputs.aioKey successCriteria: - condition: $statusCode == 200 outputs: lastValue: $response.body#/value lastDataId: $response.body#/id createdAt: $response.body#/created_at outputs: feedKey: $steps.createFeed.outputs.feedKey feedId: $steps.createFeed.outputs.feedId seededDataId: $steps.seedData.outputs.dataId lastValue: $steps.readLast.outputs.lastValue