arazzo: 1.0.1 info: title: Oracle Integration Abort a Running Instance summary: Find a monitored instance, confirm it is in progress, and abort it. description: >- A monitoring control flow for stopping a stuck or runaway run. The workflow lists monitoring instances filtered by a query, retrieves detail for the first match, and then branches: when the instance is still IN_PROGRESS it is aborted, and when it has already reached a terminal state the flow 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: developerApi url: ../openapi/oracle-integration-developer-api.yaml type: openapi workflows: - workflowId: abort-running-instance summary: Abort the first matching instance when it is still in progress. description: >- Lists monitoring instances by filter, retrieves the first match, and aborts it only when its status is IN_PROGRESS. inputs: type: object properties: query: type: string description: Filter query string used to locate the target instance. limit: type: integer description: Maximum number of monitoring instances to retrieve. default: 10 steps: - stepId: listInstances description: >- Retrieve monitoring instances matching the filter so the target run can be located. operationId: listMonitoringInstances parameters: - name: q in: query value: $inputs.query - name: limit in: query value: $inputs.limit - name: offset in: query value: 0 successCriteria: - condition: $statusCode == 200 outputs: firstInstanceId: $response.body#/items/0/id onSuccess: - name: hasInstance type: goto stepId: getInstance criteria: - context: $response.body condition: $.items.length > 0 type: jsonpath - name: noInstance type: end criteria: - context: $response.body condition: $.items.length == 0 type: jsonpath - stepId: getInstance description: >- Retrieve detail for the first matching instance to inspect its current status before aborting. operationId: getMonitoringInstance parameters: - name: id in: path value: $steps.listInstances.outputs.firstInstanceId successCriteria: - condition: $statusCode == 200 outputs: instanceStatus: $response.body#/status integrationId: $response.body#/integrationId onSuccess: - name: inProgress type: goto stepId: abort criteria: - context: $response.body condition: $.status == "IN_PROGRESS" type: jsonpath - name: alreadyTerminal type: end criteria: - context: $response.body condition: $.status != "IN_PROGRESS" type: jsonpath - stepId: abort description: >- Abort the running integration instance now that it is confirmed to be in progress. operationId: abortMonitoringInstance parameters: - name: id in: path value: $steps.listInstances.outputs.firstInstanceId successCriteria: - condition: $statusCode == 200 outputs: abortedInstanceId: $steps.listInstances.outputs.firstInstanceId integrationId: $steps.getInstance.outputs.integrationId