arazzo: 1.0.1 info: title: Google Cloud Platform Rename Folder and Poll Operation summary: Read a folder, patch its display name, poll the operation, then confirm the new name. description: >- Updates the display name of an existing folder. Folder updates are asynchronous, so the patch call returns a long-running Operation whose name is polled with operations.get until done, after which the folder is re-read to confirm the new display name. 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: cloudResourceManagerApi url: ../openapi/cloud-resource-manager-openapi.yml type: openapi workflows: - workflowId: rename-folder-and-poll summary: Rename a Google Cloud folder and wait for the operation to complete. description: >- Reads the current display name, patches the folder, polls the operation until done, then re-reads to confirm. inputs: type: object required: - folderId - displayName properties: folderId: type: string description: The folder resource id to rename (e.g. 500123). displayName: type: string description: The new display name to set on the folder. steps: - stepId: getBefore description: >- Read the folder to capture the current display name before the change. operationId: cloudresourcemanager.folders.get parameters: - name: folderId in: path value: $inputs.folderId successCriteria: - condition: $statusCode == 200 outputs: previousName: $response.body#/displayName - stepId: patchFolder description: >- Patch the folder display name with an update mask scoped to displayName. Returns a long-running Operation whose name is used to poll. operationId: cloudresourcemanager.folders.patch parameters: - name: folderId in: path value: $inputs.folderId - name: updateMask in: query value: displayName requestBody: contentType: application/json payload: displayName: $inputs.displayName successCriteria: - condition: $statusCode == 200 outputs: operationName: $response.body#/name - stepId: pollOperation description: >- Poll the patch operation by name until the done flag is true. operationId: cloudresourcemanager.operations.get parameters: - name: name in: path value: $steps.patchFolder.outputs.operationName successCriteria: - condition: $statusCode == 200 outputs: done: $response.body#/done onSuccess: - name: operationComplete type: goto stepId: getAfter criteria: - context: $response.body condition: $.done == true type: jsonpath - name: stillRunning type: goto stepId: pollOperation criteria: - context: $response.body condition: $.done == false type: jsonpath - stepId: getAfter description: >- Re-read the folder to confirm the new display name took effect. operationId: cloudresourcemanager.folders.get parameters: - name: folderId in: path value: $inputs.folderId successCriteria: - condition: $statusCode == 200 outputs: newName: $response.body#/displayName outputs: previousName: $steps.getBefore.outputs.previousName newName: $steps.getAfter.outputs.newName operationName: $steps.patchFolder.outputs.operationName