arazzo: 1.0.1
info:
title: Civitai Query and Cancel a Running Workflow
summary: List active workflows, inspect the first one, cancel it, and confirm the canceled state.
description: >-
Operational housekeeping for the Orchestration API. The workflow queries the
consumer's workflows filtered to a processing status, inspects the first
returned workflow, issues an update that sets its status to canceled, and
re-reads the workflow to confirm cancellation took effect. 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
x-realizes-capability-ids:
- BC-610.60
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-610.60
capability_name: Artificial Intelligence Management
spec: civitai-workflows-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: workflowsApi
url: ../openapi/civitai-workflows-api-openapi.yml
type: openapi
workflows:
- workflowId: workflow-query-cancel
summary: Find a processing workflow, cancel it, and confirm the canceled state.
description: >-
Queries workflows by status, inspects the first match, updates it to
canceled, and re-reads it to confirm.
inputs:
type: object
required:
- apiKey
properties:
apiKey:
type: string
description: Civitai personal API token used as a Bearer credential.
status:
type: string
description: Status filter for the query (e.g. processing, preparing).
take:
type: integer
description: Maximum number of workflows to return.
steps:
- stepId: queryRunning
description: >-
Query the consumer's workflows filtered by status and capture the first
workflow id.
operationId: queryWorkflows
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiKey
- name: status
in: query
value: $inputs.status
- name: take
in: query
value: $inputs.take
successCriteria:
- condition: $statusCode == 200
outputs:
firstWorkflowId: $response.body#/items/0/id
nextCursor: $response.body#/nextCursor
- stepId: inspectWorkflow
description: >-
Inspect the first returned workflow to confirm its current status before
canceling.
operationId: getWorkflow
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiKey
- name: workflowId
in: path
value: $steps.queryRunning.outputs.firstWorkflowId
successCriteria:
- condition: $statusCode == 200
outputs:
currentStatus: $response.body#/status
- stepId: cancelWorkflow
description: >-
Update the workflow, setting its status to canceled.
operationId: updateWorkflow
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiKey
- name: workflowId
in: path
value: $steps.queryRunning.outputs.firstWorkflowId
requestBody:
contentType: application/json
payload:
status: canceled
successCriteria:
- condition: $statusCode == 200
outputs:
statusAfterUpdate: $response.body#/status
- stepId: confirmCanceled
description: >-
Re-read the workflow to confirm it reports a canceled status.
operationId: getWorkflow
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiKey
- name: workflowId
in: path
value: $steps.queryRunning.outputs.firstWorkflowId
successCriteria:
- condition: $statusCode == 200
outputs:
finalStatus: $response.body#/status
outputs:
workflowId: $steps.queryRunning.outputs.firstWorkflowId
finalStatus: $steps.confirmCanceled.outputs.finalStatus
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.