Adafruit IO · Arazzo Workflow

Adafruit IO Build Dashboard with Block

Version 1.0.0

Create a dashboard, add a visualization block to it, then read the block back.

1 workflow 1 source API 1 provider
View Spec View on GitHub IoTInternet of ThingsMQTTMakerHobbyistCircuitPythonArduinoESP32FeatherDashboardsTime SeriesArazzoWorkflows

Provider

adafruit-io

Workflows

build-dashboard-with-block
Create a dashboard, add a block to it, and read the block back.
Provisions a dashboard, creates a visualization block on it bound to a feed, and fetches the block to verify placement.
3 steps inputs: aioKey, blockName, dashboardDescription, dashboardName, feedId, username, visualType outputs: blockId, dashboardId, dashboardKey
1
createDashboard
createDashboard
Create the dashboard that will hold the visualization block.
2
addBlock
createBlock
Create a block on the dashboard, binding it to the supplied feed id and using the requested visualization type.
3
readBlock
getBlock
Read the block back from the dashboard to confirm it was created and placed.

Source API Descriptions

Arazzo Workflow Specification

adafruit-io-build-dashboard-with-block-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Adafruit IO Build Dashboard with Block
  summary: Create a dashboard, add a visualization block to it, then read the block back.
  description: >-
    Assembles a live dashboard for visualizing feed data. The workflow creates a
    dashboard, adds a block (such as a gauge or line chart) bound to one or more
    feeds, and reads the block back to confirm it was placed. Every step spells
    out its request inline — including the username path parameter and the
    X-AIO-Key authentication header. Note: the Dashboard response schema in the
    OpenAPI description documents only name, description, key, and blocks, but
    the dashboard `id` returned by the create call is required as the
    dashboard_id path parameter for block operations, so it is captured here from
    the response body. The same applies to the block `id` returned by the create
    block call, which is required as the block id path parameter on read.
  version: 1.0.0
sourceDescriptions:
- name: adafruitIoApi
  url: ../openapi/adafruit-io-rest-api-openapi.yml
  type: openapi
workflows:
- workflowId: build-dashboard-with-block
  summary: Create a dashboard, add a block to it, and read the block back.
  description: >-
    Provisions a dashboard, creates a visualization block on it bound to a feed,
    and fetches the block to verify placement.
  inputs:
    type: object
    required:
    - username
    - aioKey
    - dashboardName
    - blockName
    - visualType
    properties:
      username:
        type: string
        description: A valid Adafruit IO username.
      aioKey:
        type: string
        description: The Adafruit IO API key, sent in the X-AIO-Key header.
      dashboardName:
        type: string
        description: Display name for the new dashboard.
      dashboardDescription:
        type: string
        description: Optional description for the dashboard.
      blockName:
        type: string
        description: Display name for the block added to the dashboard.
      visualType:
        type: string
        description: The block visualization type (e.g. "line_chart", "gauge", "text").
      feedId:
        type: string
        description: Optional feed id to bind the block to (used as block_feeds.feed_id).
  steps:
  - stepId: createDashboard
    description: >-
      Create the dashboard that will hold the visualization block.
    operationId: createDashboard
    parameters:
    - name: username
      in: path
      value: $inputs.username
    - name: X-AIO-Key
      in: header
      value: $inputs.aioKey
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.dashboardName
        description: $inputs.dashboardDescription
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      dashboardId: $response.body#/id
      dashboardKey: $response.body#/key
  - stepId: addBlock
    description: >-
      Create a block on the dashboard, binding it to the supplied feed id and
      using the requested visualization type.
    operationId: createBlock
    parameters:
    - name: username
      in: path
      value: $inputs.username
    - name: dashboard_id
      in: path
      value: $steps.createDashboard.outputs.dashboardId
    - name: X-AIO-Key
      in: header
      value: $inputs.aioKey
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.blockName
        visual_type: $inputs.visualType
        block_feeds:
        - feed_id: $inputs.feedId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      blockId: $response.body#/id
      blockKey: $response.body#/key
  - stepId: readBlock
    description: >-
      Read the block back from the dashboard to confirm it was created and
      placed.
    operationId: getBlock
    parameters:
    - name: username
      in: path
      value: $inputs.username
    - name: dashboard_id
      in: path
      value: $steps.createDashboard.outputs.dashboardId
    - name: id
      in: path
      value: $steps.addBlock.outputs.blockId
    - name: X-AIO-Key
      in: header
      value: $inputs.aioKey
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      visualType: $response.body#/visual_type
      blockName: $response.body#/name
  outputs:
    dashboardId: $steps.createDashboard.outputs.dashboardId
    dashboardKey: $steps.createDashboard.outputs.dashboardKey
    blockId: $steps.addBlock.outputs.blockId