capabilities.work

Submit And Conditionally Cancel

A 4-step recipe with fal. We can help you get access.

Recipe · 4 steps

Submit And Conditionally Cancel

with fal · Artificial Intelligence Management
Works with AI assistants

Submit a job and cancel it if it is still running, otherwise return its result.

  1. Submit the inference request and capture the request_id for later status and cancellation calls.
  2. Read the current status of the submitted request once to decide whether to cancel it or fetch its result.
  3. Cancel the in-queue or in-progress request to return its reserved GPU capacity to the pool.
  4. Retrieve the final inference output when the job had already completed by the time it was checked.
What you'll need to have ready
  • modelOwner: Owning organization of the model (e.g. "fal-ai").
  • modelName: Model identifier (e.g. "kling-2.5/text-to-video").
  • input: Model-specific JSON input (prompt, image_url, seed, etc.).
For your developer

Arazzo workflow fal-ai:submit-and-cancel, 4 operations: submitRequest → getRequestStatus → cancelRequest → getRequestResult. Specs on APIs.io.