---
id: workflow-execution-cancel
title: "Cancel an execution"
description: "Cancels a running execution."
sidebar_label: "Cancel an execution"
hide_title: true
hide_table_of_contents: true
api: eJztWEuPGzcS/isFXmJrW48kNhLoNvbaWO8CyWA8hgNMBhbVLEnMdJMdVrU0WqH/+6LIVksadTRBkMMePJdp8VEvVn3FjzvFeklqeqc++/CwKPwG8BHzmq13pO4zZZDyYCv5rabqrXY5FgQaQu2cdcvD6pHKlK8waPnxwaip2rQSh92aaR73q0xVOugSGYPo3ikrwivNK5Upp0tUU2WNylTA32sb0KgphxozRfkKS62mO8XbSlYRB+uWqnlq6O0KD6aBNWIdPuqyKmSXzHz5cfG9/nb+Xf7KvEbV3CdlSPzGm61oyL1jdCyfuqoKm0fPxr+RKNidm+Lnv2HO4luQOLBFktmAut1xavKxPVRXGAgNGphvQYPDDQYJsWriX6YI8zpY3sZozVEHDFc1r9T07j6ZTpV3lDR+N5nIv/OApOgX0Q/YaAKd51gxxuj8Te52QY9LLUf/3nWD2dn2wxHfpTPfp82HlABrS2kjseaaVKasq2qmNBIYzZWIqSuj0/f9U5OsuRz9nmw4seLi5s3ii118fjP/vKjq5cTJ1s7mw0brGJcYjnd+32RKF1bTTzHfL+ko7Dra5MNSO/vfrsJ6qiD3IWA64f/gtk/sk4IuLDoe5itP6OABt1ATGmAPrMMSGfikkDaWV0B26XRBI9FnDZaVZ3T5tldf051bn4euLuXYK3QmjbSoEtNRnGeUJFhoW8SPNoHjN9sSzRdfs7pvupzoSc9Tf29qB2ntCN4GNOjY6mIomGPEfQIdEEpND2jAOwioTfLU19yvosnUWger5wX2z2IIPhyXw0fG6l0cvFwOuTeoMlUikV7ieWLH+YuZ86/b2+svrycTMWMvph88Wdui3/yAHLbi3dHs3PsCdYSniOXouKvx/oo5PYbrgISOJcJUz4eb894TY54kS7j+IN1LZG009+BScwwPPfYsfCg1q6kS2BhKMsmWA4r86S1dov75TRK0PfT2BLUrDOl59/sO8OqXX85RPZUvxAwbgWD83JstkN4SbFaaYSPT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b2X7YePbe1GT7HVeRJl1ce38Ehdc/f7wVrGmf8MpIkFXQG2HWepOM9FWKsWCMjO1Uod2yjviskszI0E6B7QmQRa96w7DbpRW3/gFd03RRYfktgWma/wHZsX8h
sidebar_class_name: "post api-method"
info_path: docs/api/workflows
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Cancel an execution"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/workflows/executions/{id}/cancel"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Cancels a running execution.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"The execution id.","example":"exec_8f3a1b2c4d5e"}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","example":"superseded by a newer run"}}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The cancellation was accepted.","content":{"application/json":{"schema":{"type":"object","properties":{"execution":{"title":"Execution","type":"object","required":["id","workflowId","revision","status","inputs","startedAt","updatedAt"],"properties":{"id":{"type":"string","example":"exec_8f3a1b2c4d5e"},"workflowId":{"type":"string","example":"wf_ifWBbWfpug0n"},"revision":{"type":"integer","example":3},"aliasName":{"type":"string","example":"live"},"organizationId":{"type":"string"},"correlationKey":{"type":"string","description":"Client-chosen key used to target the execution with signals."},"idempotencyKey":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","cancelled","timed_out"]},"inputs":{"type":"object","description":"Run inputs. Credential-named keys are masked on reads."},"outputs":{"type":"object"},"variables":{"type":"object"},"error":{"title":"StepError","type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"HTTP_500"},"message":{"type":"string"},"details":{"type":"object"},"retryable":{"type":"boolean"}}},"parentExecutionId":{"type":"string","description":"Present on sub-workflow executions."},"parentStepId":{"type":"string"},"metadata":{"type":"object"},"startedAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"}}},"accepted":{"type":"boolean","enum":[true]}}}}}},"4XX":{"description":"Client error. The body says what went wrong: an error `type`, a human-readable `detail`, and, on validation failures, one entry per offending field.","content":{"application/problem+json":{"schema":{"title":"Problem","type":"object","description":"The standard error body (RFC 7807 problem details, served as `application/problem+json`).","properties":{"type":{"type":"string","description":"Error type URI, e.g. `https://workflow-system.dev/errors/workflow-not-found`.","example":"https://workflow-system.dev/errors/workflow-not-found"},"title":{"type":"string","example":"Not found"},"status":{"type":"integer","example":404},"detail":{"type":"string","example":"No workflow with id wf_ifWBbWfpug0n exists"},"instance":{"type":"string","example":"/workflows/definitions/wf_ifWBbWfpug0n"},"errors":{"type":"array","description":"Present on validation failures: one entry per offending field.","items":{"type":"object","properties":{"path":{"type":"string","example":"/steps/scan/config"},"message":{"type":"string","example":"must have required property 'code'"}}}}}}}}},"5XX":{"description":"Unexpected server error.","content":{"application/problem+json":{"schema":{"title":"Problem","type":"object","description":"The standard error body (RFC 7807 problem details, served as `application/problem+json`).","properties":{"type":{"type":"string","description":"Error type URI, e.g. `https://workflow-system.dev/errors/workflow-not-found`.","example":"https://workflow-system.dev/errors/workflow-not-found"},"title":{"type":"string","example":"Not found"},"status":{"type":"integer","example":404},"detail":{"type":"string","example":"No workflow with id wf_ifWBbWfpug0n exists"},"instance":{"type":"string","example":"/workflows/definitions/wf_ifWBbWfpug0n"},"errors":{"type":"array","description":"Present on validation failures: one entry per offending field.","items":{"type":"object","properties":{"path":{"type":"string","example":"/steps/scan/config"},"message":{"type":"string","example":"must have required property 'code'"}}}}}}}}}}}
>
  
</StatusCodes>


      