workflowOutput Component Documentation
Overview
The workflowOutput component is designed to serve as a terminator node within Vantage's workflow system, facilitating the passage of data from one workflow to another with minimal transformation. Its primary role is to manage the output of data, utilizing a specified name (config.outputName) as metadata that can be leveraged by downstream selectors in the analytics pipeline. This is crucial in developing a smooth flow of information between interconnected workflows.
Purpose
The main purpose of workflowOutput is to ensure that data is passed through correctly and effectively from a preceding workflow to a subsequent workflow, maintaining metadata integrity for downstream processing. The component analyzes its input, and if appropriate data patterns are detected, it decomposes and retrieves the relevant data along with its metadata for further use.
Settings
The workflowOutput component includes a configuration setting named config.outputName. Below are the detailed explanations for this setting.
1. Setting: outputName
- Input Type: String
- Description: The
outputNamesetting is intended for specifying a label for the output data. This name serves as metadata used by downstream components and selectors. When properly configured, it helps downstream workflows identify and reference the data being passed, improving clarity and organization in complex workflows. - Impact of Changes: Changing the
outputNamemodifies what downstream components will reference. It is essential for maintaining clarity, especially in scenarios where multipleworkflowOutputcomponents are involved. A more descriptive name improves the understanding of the data being handled. - Default Value: The default value for
outputNamewhen not specified is an empty string. Users should always provide a meaningful name to ensure effective data management.
How It Works
When workflowOutput is invoked, it accepts an input encapsulated in the inputs object, particularly looking for inputs.input1. The logic flow is as follows:
-
Input Validation: The function initially checks if
rawData(the value ofinputs.input1) is present. If it is absent, the function returns an empty dataset (data: []) and null metadata. -
Data Handling:
- If
rawDatais an object, the function checks for specific structures:- If the structure matches
{ data: [...], metadata: {...} }, it extracts thedataandmetadata. - If it follows the
{ output1: { data: [...] } }pattern, it similarly extractsdataandmetadatafromrawData.output1.
- If the structure matches
- If
rawDatais an array or meets the above conditions, the function returns the corresponding datasets.
- If
-
Outputs: Finally, the function returns the
dataalongside themetadata, ready for subsequent processing in the analytics pipeline.
Expected Data
The workflowOutput component expects inputs.input1 to be structured in one of the following ways:
-
Direct Data Array:
json[1, 2, 3, 4] -
Object with Data and Metadata:
json{ "data": [1, 2, 3, 4], "metadata": {"description": "Sample data"} } -
Nested Object Structure:
json{ "output1": { "data": [1, 2, 3, 4], "metadata": {"description": "Nested output"} } }
In the absence of a valid structure, the component will return an empty data output.
Use Cases & Examples
Use Cases
-
Data Passing Between Workflows: A common scenario where multiple workflows are interconnected, necessitating seamless data transfer while preserving metadata for downstream processing.
-
Dynamic Analytics Reporting: In an analytics dashboard, the report may require data from several workflows, necessitating the
workflowOutputto standardize the data format for visualization components. -
Data Validation Prior to Final Output: Before finalizing a dataset for delivery,
workflowOutputcan serve as the last checkpoint to ensure the integrity and structure of the data being passed along.
Example Configuration
Consider a scenario where a company processes customer transactions in one workflow, and the outputs need to be sent to another reporting workflow. The configuration could be as follows:
{
"inputs": {
"input1": {
"data": [
{"id": 1, "amount": 150},
{"id": 2, "amount": 200}
],
"metadata": {
"source": "transaction_service",
"time_period": "Q1_2023"
}
}
},
"config": {
"outputName": "CustomerTransactions"
}
}In this example:
inputs.input1contains structured transaction data along with metadata identifying the source and time period.- The
outputNameis set to "CustomerTransactions", allowing downstream selectors to accurately identify and reference this specific dataset.
Using workflowOutput, this configuration will ensure a smooth transition of transaction data between workflows within Vantage, retaining the necessary metadata for further processing or reporting.