arazzo: 1.0.1 info: title: WakaTime Data Dump Export summary: Check for existing data exports, create a new dump when none exist, then re-list to confirm. description: >- Orchestrates a self-service data export. It lists the user's existing data dumps and branches: when an export already exists it ends, and when none exist it triggers a new export job and re-lists the dumps to confirm the job was registered with its processing status. Every step spells out its request inline, including HTTP Basic authentication with the WakaTime API key as the username, so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: wakatimeApi url: ../openapi/wakatime-api-v1-openapi.yml type: openapi workflows: - workflowId: data-dump-export summary: List dumps, create one if absent, then re-list to confirm the new job. description: >- Lists existing data dumps and, when none are present, creates a new export job and re-lists the dumps to confirm it was registered. inputs: type: object required: - apiKeyBasicAuth properties: apiKeyBasicAuth: type: string description: Base64 of ":" for HTTP Basic auth (WakaTime API key as username). dumpType: type: string description: The export type to create (heartbeats or daily). default: heartbeats emailWhenFinished: type: boolean description: Whether to email the user when the export finishes. default: true steps: - stepId: listDataDumps description: List the user's existing data exports. operationId: listDataDumps parameters: - name: Authorization in: header value: Basic $inputs.apiKeyBasicAuth successCriteria: - condition: $statusCode == 200 outputs: dumps: $response.body#/data onSuccess: - name: dumpExists type: end criteria: - context: $response.body condition: $.data.length > 0 type: jsonpath - name: noDump type: goto stepId: createDataDump criteria: - context: $response.body condition: $.data.length == 0 type: jsonpath - stepId: createDataDump description: Trigger generation of a new data export. operationId: createDataDump parameters: - name: Authorization in: header value: Basic $inputs.apiKeyBasicAuth requestBody: contentType: application/json payload: type: $inputs.dumpType email_when_finished: $inputs.emailWhenFinished successCriteria: - condition: $statusCode == 201 outputs: newDumpId: $response.body#/data/id newDumpStatus: $response.body#/data/status - stepId: confirmDataDumps description: Re-list the data dumps to confirm the new export job was registered. operationId: listDataDumps parameters: - name: Authorization in: header value: Basic $inputs.apiKeyBasicAuth successCriteria: - condition: $statusCode == 200 outputs: dumps: $response.body#/data outputs: newDumpId: $steps.createDataDump.outputs.newDumpId newDumpStatus: $steps.createDataDump.outputs.newDumpStatus dumps: $steps.confirmDataDumps.outputs.dumps