Workflow definitions

Update a workflow

Changed on

Pushes a new version of the definition. The body can be the bare definition or { definition, mode }, where mode controls versioning:

  • auto (default): overwrites the latest revision, unless an active alias points at it, in which case a new revision is created. Safe by default: you never rewrite something that is live.
  • new-revision: always create a new revision.
  • overwrite: always rewrite the latest revision.

If the {id} in the URL is a key that doesn't exist yet, the workflow is created instead and the response is 201: PUT doubles as an upsert, so a git repository of definitions can push them without knowing which ones already exist.

put/workflows/definitions/{id}

Request

  • Base URL
    https://api.nullplatform.com
  • URL
    https://api.nullplatform.com/workflows/definitions/{id}
  • Auth
    HTTP bearer

Path parameters

idstring required

Workflow reference: a server-minted id (wf_...) or the workflow's client-chosen key (lowercase slug, unique per organization).

Request body

mode'auto' | 'overwrite' | 'new-revision'

Example request

{
  "definition": {
    "name": "AMI drift scanner",
    "key": "ami-drift-scanner",
    "description": "Scans deployed scopes for outdated AMIs.",
    "path": "/action-items/ami-drift",
    "semanticVersion": "1.2.0"
  }
}

Response

The definition was updated. mode says whether the latest revision was overwritten or a new one created.

mode'created' | 'overwritten' | 'new-revision'

How the write was applied (update responses only).

Example response

{
  "workflow": {
    "id": "wf_ifWBbWfpug0n",
    "key": "ami-drift-scanner",
    "name": "AMI drift scanner",
    "path": "/action-items/ami-drift"
  },
  "revision": {
    "workflowId": "wf_ifWBbWfpug0n",
    "revision": 3
  },
  "latestAlias": {
    "workflowId": "wf_ifWBbWfpug0n",
    "name": "live",
    "revision": 3
  },
  "warnings": [
    {
      "name": "NP_API_KEY"
    }
  ]
}

Changes