Workflow test
The Test tab
To test a workflow, use the Test tab of the workflow workspace. In order to be tested, the workflow must have been published.
Enter the input
The document to be analyzed with the workflow is specified in the Test Input panel. This panel's contents automatically adapt to the first block of the workflow, the one that determines the input to the entire workflow.
- If the first block accepts text as input (i.e. it is a model block), in the Test Input panel you will find the Text editor tab and the JSON input tab.
- If the first block is either the Tika Converter or the Extract Converter processor, in the panel you will find the Upload and the JSON input tabs.
- If the first block is the URL Converter processor, in the panel you will only find the JSON input tab enabled.
To input a text, when allowed:
- To use text written on the fly, select Text editor in the Test Input panel and enter or paste a text in the text area.
- To use a text file, select Text editor in the Test Input panel, then select Browse files to search and open the file.
Once the file is opened, its contents are visible in the text area and can be edited as desired.
To replace the file with another one, select Replace file, then find and open the other file.
To use a binary file as input, when allowed:
-
Select Upload in the Test Input panel, then select Browse files to search and open the file.
To replace the file with another one, select Replace file, then find and open the other file.Note
The Extract Converter processor only accepts PDF files, while the Tika Converter processor can accept a variety of file formats, including plain-text files.
To use a JSON object emulating a request submitted to the NL Flow API:
- Select JSON input in the Test Input panel and use the built-in code editor to write or paste the JSON object. Read the NL Flow API manual for the description of the JSON object syntax.
Run the test and examine the result
To run the test, select Test workflow at the bottom of the Test Input panel.
Note
The Test workflow button will be disabled, if the workflow is not published.
The result is displayed in the JSON Viewer panel in the form of a JSON object.
To expand or collapse the sections of the JSON object, use the down-arrow or the right-arrow buttons.
To expand or collapse all the sections of the JSON object at once, select Expand all or Collapse all .
To save the result to file, select Download result on the toolbar of the JSON Viewer panel.
To clean the result, select Clear result on the toolbar of the JSON Viewer panel.
Download the Postman collection
To download a Postman collection with which you can test the workflow through the Workflow API, select the ellipsis then Download Postman collection in the Test tab.
Once you have imported the collection into Postman, for each request you must set the X-API-KEY
header with the value of the API key associated with the workflow.