Docs

Validate Workflow Definition

Check a body for Set Workflow Definition without saving anything: it runs the same steps in a transaction that is always rolled back, so it finds every problem the write would, each with its JSON Pointer into the body. Code the configurations bring is checked as the write checks it. The ids in refs and the keys in inputKeys belong to this check, which keeps nothing: the real write gives new ids, so read them from Set Workflow Definition's answer.

POST

Path

Path parameters
stringrequired

The workflow's id.

Headers

Optional headers
string

Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See Organizations.

Body

Arguments
array of objectrequired

Every trigger, as you want it.

Every trigger the draft should have: { id } for one it has, { ref, app, action? } for a new one, each with name, isDisabled and configuration as you want them. A trigger left out is removed.

array of objectrequired

Every step, as a tree.

Every step the draft should have, as a tree in execution order: { id } for one it has, { ref, app, action? } for a new one, each with name, isDisabled and configuration, holding its steps in body (a loop, folder or batch step) or then and else (an If/Else). A step left out is removed with the steps it holds.

string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored unless it names another workflow. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

boolean

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

array of string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

number

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

string

Read-only: Get Workflow Definition answers it, and it is accepted so a read can be sent back, then ignored. Change the workflow itself with Update Workflow.

Read-only: change the workflow itself with Update Workflow.

Response fields

validboolean

True when Set Workflow Definition would accept this body as it is now.

revisionstring

The revision of the draft it was checked against.

issuesarray of objects

Valid: Validate Workflow's check of the draft as it would be written (path points into definition). Not valid: every problem with the body (path points into the body).

  • severitystring

    error blocks publishing; warning does not.

    • error
    • warning
  • codestring

    What is wrong, UPPER_SNAKE (SCHEDULE_INCOMPLETE, STEP_NOT_CONFIGURED, MISSING_GRAPH_REFERENCE, ...).

  • messagestring

    What is wrong, for a person.

  • stepIdstring

    The step or trigger it is about. Null for the workflow as a whole.

  • pathstring

    Where that step sits in Get Workflow Definition, as a JSON Pointer (/steps/1/body/0). Null for the workflow as a whole.

refsobject

The id each new step and trigger got in this check, by its ref. These ids are not kept: Set Workflow Definition gives new ones.

inputKeysarray of objects

For each step this check created that a Map step reads: the name its code would read it by, input['<key>'], as in Set Workflow Definition's answer. It ends in the last four characters of the step's id, in capitals, so the key from this check is not the one the real write gives; use Set Workflow Definition's inputKeys.

  • mapStepIdstring

    The Map step.

  • stepIdstring

    The new step it reads.

  • refstring

    The new step's ref in the body.

  • keystring

    The name the Map step's code reads it by: input['<key>'].

definitionobject

The definition as Set Workflow Definition would write it, as Get Workflow Definition answers it. Null when not valid.

  • idstring

    The workflow's id.

  • namestring

    The workflow's name.

  • typestring

    workflow, or function for a workflow other workflows call.

  • isActiveboolean

    Whether the published version runs on its triggers.

  • environmentIdstring

    The environment the workflow runs in. Null for the default environment.

  • tagsarray

    Ids of the tags on the workflow.

  • versionstring

    The version this answer describes: draft, or the saved version label.

  • publishedVersionstring

    The version that runs. Null when the workflow was never published.

  • changesSincePublishnumber

    How many draft edits are not published yet.

  • revisionstring

    The draft's revision: send it in If-Match on your next change to the draft. The response's ETag header is the same value. Null when reading a saved version, which never changes.

  • triggersarray

    What starts the workflow. A workflow can have several.

    • idstring

      The trigger's id.

    • namestring

      The trigger's display name.

    • appSlugstring

      What starts the workflow: schedule, webhook, runWorkflow (when another workflow calls it), or the app whose event does.

    • appVersionstring

      The app version the trigger is pinned to. For a built-in trigger (Schedule, Webhook, When called), the version of the built-in app it was added with, "0" or "0.0.1" (some older ones hold "draft" or null); it does not change what the trigger does.

    • actionIdstring

      The app event the trigger listens for. Null for a built-in trigger.

    • isDisabledboolean

      True when the trigger is turned off.

    • isConfiguredboolean

      Whether the trigger passed the editor's validation. Null when it was never validated.

  • stepsarray

    The steps, top level first, in execution order. A step that holds others carries them in body (a loop, folder or batch step) or then and else (an If/Else).

    • idstring

      The step's id. Stable across edits; never positional.

    • numbernumber

      The number the editor shows for this step, in execution order. Null for a folder, which the editor does not number.

    • namestring

      The step's display name.

    • appSlugstring

      The app the step runs, or the built-in step type (iterate, ifElse, map, ...).

    • appVersionstring

      The app version the step is pinned to. For a built-in step (If, Loop, Map, ...), the version of the built-in app it was added with, "0" or "0.0.1" (some older ones hold "draft" or null); it does not change what the step does.

    • actionIdstring

      The app action the step runs. Null for a built-in step type.

    • functionIdstring

      The function this step calls, for a function call step.

    • parentStepIdstring

      The step this one sits inside (a loop, group, folder or if/else). Null at the top level.

    • slotstring

      Where the step sits in its parent: steps (the top level), body (a loop, group or folder), then or else (an if/else lane).

      • steps
      • body
      • then
      • else
    • depthnumber

      How deeply the step is nested. 0 at the top level.

    • isDisabledboolean

      True when the step is turned off and runs skip it.

    • isConfiguredboolean

      Whether the step passed the editor's validation (required values set, connection chosen). Null when it was never validated.

    • bodyarray

      Steps nested inside this one, in order. Present when it has any; each has the same keys.

    • thenarray

      Steps nested inside this one, in order. Present when it has any; each has the same keys.

    • elsearray

      Steps nested inside this one, in order. Present when it has any; each has the same keys.