Temporal · Arazzo Workflow

Temporal Update a Namespace With Optimistic Concurrency

Version 1.0.0

Read a Namespace, update its spec using the current resourceVersion, then confirm the change.

1 workflow 1 source API 1 provider
View Spec View on GitHub ProCode_API_CompositionWorkflowsArazzoWorkflows

Provider

temporal

Workflows

update-namespace
Safely update a Namespace spec using its current resourceVersion.
Chains getNamespace to capture the current resourceVersion, updateNamespace to apply the new spec under that version, and a final getNamespace to verify the update was accepted.
3 steps inputs: bearerToken, namespace, spec outputs: newResourceVersion, previousResourceVersion, state
1
readNamespace
getNamespace
Read the Namespace to capture its current resourceVersion, required to perform an optimistic-concurrency update.
2
applyUpdate
updateNamespace
Submit the new spec carrying the resourceVersion just read so the control plane can reject the change if the Namespace was modified concurrently.
3
confirmUpdate
getNamespace
Re-read the Namespace to confirm the update was applied and surface the new resourceVersion.

Source API Descriptions

Arazzo Workflow Specification

temporal-update-namespace-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Temporal Update a Namespace With Optimistic Concurrency
  summary: Read a Namespace, update its spec using the current resourceVersion, then confirm the change.
  description: >-
    Temporal Cloud Namespace updates use optimistic concurrency: the caller must
    supply the resourceVersion read from the live Namespace. This workflow reads
    the Namespace, submits an update carrying that resourceVersion plus the new
    spec, then re-reads the Namespace to confirm the resourceVersion advanced.
    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: cloudOpsApi
  url: ../openapi/cloud-ops-api.yml
  type: openapi
workflows:
- workflowId: update-namespace
  summary: Safely update a Namespace spec using its current resourceVersion.
  description: >-
    Chains getNamespace to capture the current resourceVersion, updateNamespace
    to apply the new spec under that version, and a final getNamespace to verify
    the update was accepted.
  inputs:
    type: object
    required:
    - bearerToken
    - namespace
    - spec
    properties:
      bearerToken:
        type: string
        description: API key used as the Bearer token for Authorization.
      namespace:
        type: string
        description: The Namespace identifier to update.
      spec:
        type: object
        description: The full replacement Namespace spec object.
  steps:
  - stepId: readNamespace
    description: >-
      Read the Namespace to capture its current resourceVersion, required to
      perform an optimistic-concurrency update.
    operationId: getNamespace
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.bearerToken"
    - name: namespace
      in: path
      value: $inputs.namespace
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      resourceVersion: $response.body#/resourceVersion
      currentState: $response.body#/state
  - stepId: applyUpdate
    description: >-
      Submit the new spec carrying the resourceVersion just read so the control
      plane can reject the change if the Namespace was modified concurrently.
    operationId: updateNamespace
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.bearerToken"
    - name: namespace
      in: path
      value: $inputs.namespace
    requestBody:
      contentType: application/json
      payload:
        resourceVersion: $steps.readNamespace.outputs.resourceVersion
        spec: $inputs.spec
    successCriteria:
    - condition: $statusCode == 200
  - stepId: confirmUpdate
    description: >-
      Re-read the Namespace to confirm the update was applied and surface the new
      resourceVersion.
    operationId: getNamespace
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.bearerToken"
    - name: namespace
      in: path
      value: $inputs.namespace
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      newResourceVersion: $response.body#/resourceVersion
      state: $response.body#/state
  outputs:
    previousResourceVersion: $steps.readNamespace.outputs.resourceVersion
    newResourceVersion: $steps.confirmUpdate.outputs.newResourceVersion
    state: $steps.confirmUpdate.outputs.state