Skip to content

Workflow output

Default output

A workflow can consist of a single flow, branched and complex as desired, or of several independent flows.

In the case of a single flow, the overall output of the workflow coincides with that of the final block of the flow, while with multiple flows the output is the concatenation of the output of all the flows, more precisely a JSON object with a key for each of the flows, corresponding to the output of the last block of each flow. The key is the block identifier.

For example, if a workflow has two flows and the last blocks of the two flows have these IDs, respectively:

04b57400_d73b_4c99_1545_d9fdf3fe7ac7
e65954e7_3fc8_4fd2_cfbe_2225c1a3da2c

the overall JSON output of the workflow will look like this:

{
    "04b57400_d73b_4c99_1545_d9fdf3fe7ac7": {
        block output
    },
    "e65954e7_3fc8_4fd2_cfbe_2225c1a3da2c": {
        block output
    }
}

In this reference section of the manual you will find the description of the output of the models and of all the processors, while a Javascript operator can produce any output.

Error output

In case of errors, the workflow output is an object with this structure:

{
    "errors": []
}

where errors is an array of objects, each describing an error and having these properties:

  • message: error message`
  • node: ID of the block that returned the error

Verbose output

NL FLow can produce a more verbose output which provides information that allows looking at the outputs and possible errors of each block. This information is useful both in the design of the workflow and for any troubleshooting.

Verbose output is achieved in two ways:

  1. In interactive workflow tests, by enabling workflow debug.
  2. Requesting the document analysis API resource with the verboseErrorOutput=true query string parameter.

In the second case, the verbose output is returned only in case of an error, otherwise the output is the default one.

Verbose output is a JSON object containing two keys:

componentsData
workflowData

componentsData is an object with a property for each block of these types:

Each property is an object which name coincides with the block ID and has these properties:

  • executed: a boolean that is true if the block has been executed, false otherwise.
  • (if the block was executed) statistics: an object containing time statistics in these properties:

    • startTime: execution start timestamp
    • endTime: end of execution timestamp
    • latencyMs: duration of execution in milliseconds
  • (if the block was executed without errors) output: block output

  • (if the block was executed with errors) errors: an array of objects describing block errors, such as the one returned by the workflow in case of errors

workflowData is an object with this structure:

{
    "input": {},
    "output": {},
    "statistics": {}
}

where input is the input to the workflow, output is the default output of the workflow and statistics is analogous to the homonymous objects of componentsData, but here refers to the entire workflow and not to the single block.