arazzo: 1.0.1 info: title: Amazon Neptune Analytics Cancel Import Task summary: Inspect a Neptune Analytics import task and cancel it only if it is still running. description: >- A guarded cancellation flow for Neptune Analytics import tasks. The workflow reads the current status of an import task, and then branches: when the task is still in a running state it cancels the task, and when the task has already reached a terminal state it ends without action. 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: neptuneAnalyticsApi url: ../openapi/amazon-neptune-analytics-openapi.yml type: openapi workflows: - workflowId: analytics-cancel-import-task summary: Cancel an import task only when it is still running. description: >- Reads an import task's status and cancels it only when the status is not a terminal SUCCEEDED, FAILED, or CANCELLED. inputs: type: object required: - taskIdentifier properties: taskIdentifier: type: string description: The unique identifier of the import task to inspect and cancel. steps: - stepId: getTask description: >- Read the current status and progress of the import task so the cancel decision can be made. operationId: getImportTask parameters: - name: taskIdentifier in: path value: $inputs.taskIdentifier successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/status progressPercentage: $response.body#/importTaskDetails/progressPercentage onSuccess: - name: stillRunning type: goto stepId: cancelTask criteria: - context: $response.body condition: $.status != "SUCCEEDED" && $.status != "FAILED" && $.status != "CANCELLED" type: jsonpath - name: alreadyTerminal type: end criteria: - context: $response.body condition: $.status == "SUCCEEDED" || $.status == "FAILED" || $.status == "CANCELLED" type: jsonpath - stepId: cancelTask description: >- Cancel the running import task by its identifier. operationId: cancelImportTask parameters: - name: taskIdentifier in: path value: $inputs.taskIdentifier successCriteria: - condition: $statusCode == 200 outputs: cancelStatus: $statusCode outputs: status: $steps.getTask.outputs.status cancelStatus: $steps.cancelTask.outputs.cancelStatus