As you probably already know, an EasyMorph workflow can calculate and return a tabular dataset (the final state of the workflow’s result table). That’s what EasyMorph workflows do on the most basic level. However, depending on use case, EasyMorph workflows can be used to calculate results of two more types. Therefore, workflows can be used to calculate 3 result types:
- Tabular datasets
- Scalar values
OK, you know about the first one, tabular datasets, such as the one below.
What are the remaining two?
When a workflow’s result is a scalar value, it means that only one value (cell) is actually needed from the workflow. If the workflow returns a dataset with more than 1 value, only the 1st (topmost) value in the 1st (leftmost) column is consumed (the column’s name doesn’t matter). The rest are ignored.
Where a scalar result can be used? Currently, they are used in the actionable Data Catalog when a Catalog item retrieves a computed file path or a URL. A file path or a URL is a single (scalar) value. So a workflow is used to calculate it.
In the screenshot above the scalar result is a file path.
When a workflow’s result is a record, it means that only one row is actually needed from the workflow. If the workflow returns a dataset with more than 1 row, only the 1st (topmost) row is consumed. The rest are ignored.
A record is a set of named values. For instance, a record can contain multiple values, and to distinguish the values from each other, each value has a unique name. A dataset with 1 row is effectively a record because the 1st row contains values, and the column names are the names of the values. Therefore, column names do matter for a record.
In the screenshot above, the record has 3 named values.
As of writing this, records are not used in EasyMorph yet. However, it will change soon. Records, as workflow results, will be used in Custom API Server. Records are convenient for processing HTTP requests because technically, any HTTP request as well as any HTTP response can be represented (with minor limitations) as sets of named values, i.e. records. Therefore an incoming HTTP request can be represented as a single-row table (dataset). EasyMorph already does it when processing real-time webhooks. Similarly, if a workflow computes a correctly formatted record it can be used to compose an HTTP response, thus making it possible to operate custom API endpoints with visual workflows.
Also, the Data Catalog will soon have a new item type called “Details” that will also compute records.