fal · Arazzo Workflow

fal Submit And Conditionally Cancel

Version 1.0.0

Submit an inference job, check its status once, and cancel it if it has not finished.

1 workflow 1 source API 1 provider
View Spec View on GitHub Artificial IntelligenceGenerative AIGenerative MediaImage-GenerationVideo GenerationAudio GenerationInferenceServerlessGPUMCPArazzoWorkflows

Provider

fal-ai

Workflows

submit-and-cancel
Submit a job and cancel it if it is still running, otherwise return its result.
Submits an inference request, inspects its status, and either cancels the in-flight job to release capacity or retrieves the finished result.
4 steps inputs: input, modelName, modelOwner outputs: cancelStatus, requestId, result
1
submitJob
Submit the inference request and capture the request_id for later status and cancellation calls.
2
checkStatus
Read the current status of the submitted request once to decide whether to cancel it or fetch its result.
3
cancelJob
Cancel the in-queue or in-progress request to return its reserved GPU capacity to the pool.
4
fetchResult
Retrieve the final inference output when the job had already completed by the time it was checked.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: fal Submit And Conditionally Cancel
  summary: Submit an inference job, check its status once, and cancel it if it has not finished.
  description: >-
    A guardrail pattern for runaway or no-longer-needed jobs. The workflow
    submits an inference request, reads the request status a single time, and
    branches: if the job is still IN_QUEUE or IN_PROGRESS it issues a cancel to
    release the GPU capacity, and if it has already COMPLETED it fetches the
    result instead. 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: fal-ai-queue-api-openapi.yml
      confidence: 0.7
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: queueApi
  url: ../openapi/fal-ai-queue-api-openapi.yml
  type: openapi
workflows:
- workflowId: submit-and-cancel
  summary: Submit a job and cancel it if it is still running, otherwise return its result.
  description: >-
    Submits an inference request, inspects its status, and either cancels the
    in-flight job to release capacity or retrieves the finished result.
  inputs:
    type: object
    required:
    - modelOwner
    - modelName
    - input
    properties:
      modelOwner:
        type: string
        description: Owning organization of the model (e.g. "fal-ai").
      modelName:
        type: string
        description: Model identifier (e.g. "kling-2.5/text-to-video").
      input:
        type: object
        description: Model-specific JSON input (prompt, image_url, seed, etc.).
  steps:
  - stepId: submitJob
    description: >-
      Submit the inference request and capture the request_id for later status
      and cancellation calls.
    operationId: submitRequest
    parameters:
    - name: model_owner
      in: path
      value: $inputs.modelOwner
    - name: model_name
      in: path
      value: $inputs.modelName
    requestBody:
      contentType: application/json
      payload: $inputs.input
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      requestId: $response.body#/request_id
  - stepId: checkStatus
    description: >-
      Read the current status of the submitted request once to decide whether
      to cancel it or fetch its result.
    operationId: getRequestStatus
    parameters:
    - name: model_owner
      in: path
      value: $inputs.modelOwner
    - name: model_name
      in: path
      value: $inputs.modelName
    - name: request_id
      in: path
      value: $steps.submitJob.outputs.requestId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
    onSuccess:
    - name: stillRunning
      type: goto
      stepId: cancelJob
      criteria:
      - context: $response.body
        condition: $.status == "IN_QUEUE" || $.status == "IN_PROGRESS"
        type: jsonpath
    - name: alreadyDone
      type: goto
      stepId: fetchResult
      criteria:
      - context: $response.body
        condition: $.status == "COMPLETED"
        type: jsonpath
  - stepId: cancelJob
    description: >-
      Cancel the in-queue or in-progress request to return its reserved GPU
      capacity to the pool.
    operationId: cancelRequest
    parameters:
    - name: model_owner
      in: path
      value: $inputs.modelOwner
    - name: model_name
      in: path
      value: $inputs.modelName
    - name: request_id
      in: path
      value: $steps.submitJob.outputs.requestId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      cancelStatus: $response.body#/status
    onSuccess:
    - name: done
      type: end
  - stepId: fetchResult
    description: >-
      Retrieve the final inference output when the job had already completed by
      the time it was checked.
    operationId: getRequestResult
    parameters:
    - name: model_owner
      in: path
      value: $inputs.modelOwner
    - name: model_name
      in: path
      value: $inputs.modelName
    - name: request_id
      in: path
      value: $steps.submitJob.outputs.requestId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      result: $response.body
  outputs:
    requestId: $steps.submitJob.outputs.requestId
    cancelStatus: $steps.cancelJob.outputs.cancelStatus
    result: $steps.fetchResult.outputs.result

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/fal-ai-submit-and-cancel-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.