Docs

Update Workflow Step Output

Save a sample output for a step in the workflow's draft without running it, as Edit Step Output in the editor does. Later steps learn its fields and their tests read it, so you can build and test what comes after a step whose run has side effects. It replaces the saved sample. Saving it changes the draft's revision: use meta.revision on your next change.

PUT

Path

Path parameters
stringrequired

The workflow's id, from List Workflows.

stringrequired

The step's id, from List Workflow Steps or Get Workflow Definition.

Headers

Optional headers
string

Optional. The id of a child organization of your API key's company to act on. Leave it out to act on the key's own company. See Child organizations.

Body

Arguments
arrayrequired

The sample records.

The sample: an array of records, as the step would answer them.

Response fields

statusstring

succeeded or failed: how the run that saved the sample ended (a sample set by hand counts as succeeded). none: the step has no sample yet.

  • succeeded
  • failed
  • none
outputobject

The first records of the output (a JSON array as the step answered it), capped at 200 records and about 60 KB. Empty when there is no sample.

totalnumber

How many records the output had in all. Null when there is no sample.

outputFieldsarray of objects

The fields of the output records, learned from the sample and offered to later steps.

  • keystring

    The field's path in each record: dotted, with [] marking an array (lines[].sku). Reference it as {{ steps.<stepId>.output[0].<key> }}.

  • typestring

    Its type as seen in the sample: string, number, boolean, object, date, a type with [] for an array, or mixed.

errorobject

Why the run failed. Null unless status is failed.

  • codestring

    The runtime's error code (ARGUMENTS_MISSING, 401_UNAUTHORIZED, DEFAULT, ...).

  • messagestring

    What the code means, for a person. What the app answered, if anything, is in output.

  • statusnumber

    The HTTP status the app answered, when it answered one.

savedOndate

When the sample was saved. Null when there is none.

revisionstring

The draft's revision after the sample was saved (a sample is part of the step): send it in If-Match on your next change to the draft.