Bubble · Arazzo Workflow

Bubble Get Then Replace a Thing

Version 1.0.0

Read a record by id to confirm it exists, then fully replace it with a new object.

1 workflow 1 source API 1 provider
View Spec View on GitHub No-CodeApplication PlatformDatabaseWorkflow AutomationPluginsArazzoWorkflows

Provider

bubble

Workflows

get-then-replace-thing
Confirm a record exists by id, then fully replace it.
Reads a record by id, captures its prior state, and then replaces the entire record with the supplied object.
2 steps inputs: object, typename, uid outputs: priorState, replacedId
1
getThing
getThing
Retrieve the record by its unique id to confirm it exists and to capture its current state before overwriting.
2
replaceThing
replaceThing
Fully replace the record with the supplied object. Every field is overwritten by the request body.

Source API Descriptions

Arazzo Workflow Specification

bubble-get-then-replace-thing-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Bubble Get Then Replace a Thing
  summary: Read a record by id to confirm it exists, then fully replace it with a new object.
  description: >-
    A safe full-replacement pattern for the Bubble Data API. The workflow first
    fetches a record by its unique id to confirm it exists and to capture its
    current state, then issues a PUT to fully replace that record with the
    supplied object. Unlike a partial modify, a replace overwrites every field,
    so reading first lets a caller capture the prior values before overwriting.
    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: bubbleDataApi
  url: ../openapi/bubble-data-api-openapi.yml
  type: openapi
workflows:
- workflowId: get-then-replace-thing
  summary: Confirm a record exists by id, then fully replace it.
  description: >-
    Reads a record by id, captures its prior state, and then replaces the entire
    record with the supplied object.
  inputs:
    type: object
    required:
    - typename
    - uid
    - object
    properties:
      typename:
        type: string
        description: Data type name in lowercase with spaces removed.
      uid:
        type: string
        description: Unique id of the record to read and replace.
      object:
        type: object
        description: The complete object to replace the record with.
  steps:
  - stepId: getThing
    description: >-
      Retrieve the record by its unique id to confirm it exists and to capture
      its current state before overwriting.
    operationId: getThing
    parameters:
    - name: typename
      in: path
      value: $inputs.typename
    - name: uid
      in: path
      value: $inputs.uid
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      priorState: $response.body#/response
  - stepId: replaceThing
    description: >-
      Fully replace the record with the supplied object. Every field is
      overwritten by the request body.
    operationId: replaceThing
    parameters:
    - name: typename
      in: path
      value: $inputs.typename
    - name: uid
      in: path
      value: $inputs.uid
    requestBody:
      contentType: application/json
      payload: $inputs.object
    successCriteria:
    - condition: $statusCode == 204
    outputs:
      replacedId: $inputs.uid
  outputs:
    priorState: $steps.getThing.outputs.priorState
    replacedId: $steps.replaceThing.outputs.replacedId