Databricks · Arazzo Workflow

Databricks Inspect and Recursively Delete a Directory

Version 1.0.0

List a workspace directory's contents, then recursively delete it.

1 workflow 1 source API 1 provider
View Spec View on GitHub AIAnalyticsApache SparkBig DataClean RoomsCloud ComputingDataData AnalyticsData EngineeringData GovernanceDelta LakeDelta SharingETLIdentity ManagementLakehouseMachine LearningMLflowModel ServingSecuritySQLUnity CatalogVector SearchVisualizeArazzoWorkflows

Provider

databricks

Workflows

cleanup-workspace-directory
List a directory's contents and recursively delete it.
Lists the directory contents for an audit record, then issues a recursive delete to remove the directory and everything inside it.
2 steps inputs: path outputs: deletedObjects, deletedPath
1
listContents
listWorkspaceObjects
List the objects contained in the directory so the caller has a record of what is about to be deleted.
2
deleteDirectory
deleteWorkspaceObject
Recursively delete the directory and all of its contents.

Source API Descriptions

Arazzo Workflow Specification

databricks-cleanup-workspace-directory-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Databricks Inspect and Recursively Delete a Directory
  summary: List a workspace directory's contents, then recursively delete it.
  description: >-
    Audits a Databricks workspace directory by listing its objects so callers
    can capture what will be removed, and then recursively deletes the directory
    and all of its contents in a single cleanup pass. The directory path drives
    both the listing and the recursive delete. 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: databricksApi
  url: ../openapi/databricks-openapi.yml
  type: openapi
workflows:
- workflowId: cleanup-workspace-directory
  summary: List a directory's contents and recursively delete it.
  description: >-
    Lists the directory contents for an audit record, then issues a recursive
    delete to remove the directory and everything inside it.
  inputs:
    type: object
    required:
    - path
    properties:
      path:
        type: string
        description: The absolute directory path to inspect and delete.
  steps:
  - stepId: listContents
    description: >-
      List the objects contained in the directory so the caller has a record of
      what is about to be deleted.
    operationId: listWorkspaceObjects
    parameters:
    - name: path
      in: query
      value: $inputs.path
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      objects: $response.body#/objects
  - stepId: deleteDirectory
    description: >-
      Recursively delete the directory and all of its contents.
    operationId: deleteWorkspaceObject
    requestBody:
      contentType: application/json
      payload:
        path: $inputs.path
        recursive: true
    successCriteria:
    - condition: $statusCode == 200
  outputs:
    deletedPath: $inputs.path
    deletedObjects: $steps.listContents.outputs.objects