---
id: workflow-execute
title: Execute a workflow
description: >-
  Starts an execution of the revision resolved by `alias` (default `latest`) or
  `revision`. With an `idempotencyKey`, retries return the original execution
  with 200 and `deduplicated: true`.
sidebar_label: Execute a workflow
hide_title: true
hide_table_of_contents: true
api: >-
  eJztWW1v2zgS/isEvzTFybKbTbELfcv2urhegV6QpsgCgRGPxZHNjUSqJGVHa+i/H4aUJb8oTts7HPaA9EMqS3yZGT7Pw+Fwwx0sLE/u+K02D1mu1wwfMa2c1MryacQF2tTIkn7zhH92YJxloPpWTGfMLZEZXElLvw1ana9QsHnNZpBLsDN2JjCDKndsloND62avmTZstu0zi9mtdEsadyYFFqV2qNL6I9aziBl0RqKl/yuj/FzayIVUkO9Ysab+55MJAyXYTKCoylym4FAkzJkKZzGPuC7RADX/IHjC163HSRgFecRLMFCgQ0Mh2XBJPpfgljziCgrkCZeCR9zg10oaFDyhoSNu0yUWwJMNd3VJrawzUi14cxi/LsgGMzSoUkwYMItmhWZUSOVQMCnY2Wyd3cdxHMJEHm9tfWVZmktUbpQutUXFHrBmZ7leo0nBIrN5tYhYpeTXClmJhmmzACX/9F6/phjgIxRlTkaus3uZ3f46v83KajFRvIlaj79WaOreZb+G/Du8vK7UPiTcUlrmh2GllooQ5GL294AJy5zucLFvYS5X+KRZ29GHLKNILtA8ZZq0vW2qKuZomFTWIQhCM6hga8ybaVhrtO5XLWqaINXKoXL0CGWAmNRq/Iel4TfHluj5H5g6gpYh9DmJlr5KVVbODrU7tje0jVgBLl1KtTgEhMA0B0PI8Q33QrjhosJ7AbXlyZuLpol4qo3B3Fv9Eevj1Ty04CPWLCMUglmgC9NLe8g8KxcKcstoGU1Mcd/n8fPzfOkxu/UtZtct9/0c5LaFAj3mT6pBzBv/L+IW08pIV3s6zxEMmsvKLXlyNw2La0utbFiT88nEB2zPrEt16Kp3/1CmGOQGQdQMH6UNa/BfQko3u28qnSfG++5ldNS9F6e7oFbbcH4I0tWzxoGriNgtGP0b41Bc0jBVKSA8T4/AK4aW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TTyJJ7wjGP+04za7vPrg00ptXQFe5Nr6e0hekUHHi0M47lTL/99vjto1dfjoxmUO0pPSA2ZLhrvu+Gt9HDrI8Ygn/pC+Rd004kuCanLHN5s5WPxi8qah1+GGg7AopKVMVPAkg9ziicD+h5ctg449eMhs731WkFfUxt/EfK9h33rVctKSnYpGb8y0P0N+Z8jOrltdec3+Ahdyg35vVV7Vuz5v4yEFb+gEv0QQaLz34cO74OPohrr3HY+KU7SSocelL22dbDvd0dirf32+IQlrb8MKf5rmBoj79NcbqcsA/GQT3m14DmpReeHnYUwSPNjXywN99F4NhmGzCS1u9AOqpumi4ug3BaZp/g3evcnU
sidebar_class_name: post api-method
info_path: docs/api/nullplatform-api
custom_edit_url: null
canonical: 'https://docs.nullplatform.com/docs/api/workflow-execute'
---
<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Execute a workflow"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/workflows/definitions/{id}/execute"}
  context={"endpoint"}
>

</MethodEndpoint>

Starts an execution of the revision resolved by `alias` (default `latest`) or `revision`. With an `idempotencyKey`, retries return the original execution with 200 and `deduplicated: true`.

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

<ParamsDetails
  parameters={[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Workflow reference: a server-minted id (`wf_...`) or the workflow's client-chosen key (lowercase slug, unique per organization).","example":"wf_ifWBbWfpug0n"},{"in":"query","name":"alias","schema":{"type":"string"},"description":"Run the revision this alias points at. Defaults to `latest`.","example":"live"},{"in":"query","name":"revision","schema":{"type":"integer"},"description":"Run this revision number instead of an alias."}]}
>

</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"type":"object","properties":{"inputs":{"type":"object","description":"Run inputs, matching the workflow's declared inputs.","example":{"due_days":14}},"correlationKey":{"type":"string","description":"Key for targeting this execution with signals later."},"idempotencyKey":{"type":"string","description":"Unique per workflow. Retries with the same key return the original execution."}}}}}}}
>

</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"An execution with this `idempotencyKey` already exists.","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"}}},"deduplicated":{"type":"boolean","enum":[true]}}}}}},"202":{"description":"The execution was accepted and started.","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"}}}}}}}},"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>

