Workflow definitions

Create a workflow

Changed on

Creates a workflow. The request body is the definition document itself, not wrapped in any envelope.

  • The workflow starts at revision 1, with the auto-maintained latest alias pointing at it.
  • Nothing runs yet: triggers only register when you activate an alias.
  • Referencing secrets or variables that have no value yet is fine: creation succeeds and the response lists them under warnings so you can set them afterwards.
post/workflows/definitions

Request

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

Request body

namestring required

Human-readable workflow name.

keystring

Client-chosen slug (^[a-z0-9][a-z0-9-]{0,62}$), unique per organization and immutable. Enables GitOps-style upserts via PUT /workflows/definitions/{key}.

descriptionstring
pathstring

Folder in the workflows tree. Defaults to /.

nrnstring

The nullplatform resource name the workflow is scoped to. Defaults to the caller's organization.

stepsobject required

Map of step id to step definition. Step ids are alphanumeric (no hyphens).

connectionsobject[]

Edges between steps.

variablesobject

Per-run variables with optional initialValue.

metadataobject
semanticVersionstring

Optional version label stored on the revision.

Example request

{
  "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 workflow was 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