WorkflowWrapper Documentation
Purpose
The WorkflowWrapper component is a central hub for managing workflows within the Vantage analytics & data platform. It provides users with tools to create, edit, and save visual workflows through an intuitive interface. The component leverages various workflows, nodes, and edges for organizing complex data processing tasks while integrating seamlessly with other platform features, such as modal dialogs for loading and deleting workflows.
Settings
The WorkflowWrapper accepts several settings, each playing a crucial role in how the component behaves and interacts with users. Below is a detailed overview of each setting:
1. registryEndpoint
- Input Type: String
- Description: This is the endpoint URL for the workflow registry. It is utilized for loading available services and node types within the component. Changing this setting updates the source from which node data and configurations are retrieved.
- Default Value:
null
2. title
- Input Type: String
- Description: This is the main title displayed at the top of the workflow interface. It helps the user identify the current workflow they are building or editing. Adjusting this value changes the title presented to the user, which is especially helpful in distinguishing multiple workflows.
- Default Value:
"Workflow Builder"
3. description
- Input Type: String
- Description: This optional field provides additional context or instructions related to the workflow. It aids users in understanding the purpose of the workflow at a glance. Modifying it impacts the displayed subtitle in the UI.
- Default Value:
null
4. apiBasePath
- Input Type: String
- Description: This indicates the base path where API requests are routed for managing workflows. It is crucial for operations such as loading, saving, or deleting workflows. Changing this affects all related API calls within the component.
- Default Value:
"/api/workflow"
5. workflowId
- Input Type: String or null
- Description: The unique identifier for a specific workflow that is being edited. If provided, it loads the existing workflow, allowing users to continue from where they left off. If null, it initiates an empty workflow. Adjusting this affects whether an existing or new workflow is rendered.
- Default Value:
null
How It Works
WorkflowWrapper operates through a combination of hooks and context APIs, primarily to manage the workflow state. Upon initialization, it:
- Sets the
registryEndpointfor fetching node data. - Loads the workflow based on the
workflowIdif available. - Responds to responsiveness changes, adjusting UI layouts and state accordingly.
The component listens for changes in the workflow context and updates the UI to reflect the current state of the workflow, including nodes and their connections. The use of various effects ensures that the workflow is dynamically adjusted according to user actions, such as selecting or editing a node.
Data Expectations
WorkflowWrapper expects the following data structures:
- An array of
nodeswherein each node is represented as an object with properties likeid,data, andtype. - An array of
edges, which defines the connections between nodes. - A
workflowIdto identify existing workflows.
The component does not enforce strict validation on node structures but expects them to conform to a certain format to render correctly.
AI Integrations
The WorkflowWrapper is integrated with the platform's AI assistant through the setPageContext function. This integration allows for reporting detailed information about workflows, nodes, and connections to enhance user interaction via AI suggestions. By providing details like workflow context and node configurations, the AI can assist users with optimized suggestions and error handling.
Billing Impacts
Utilization of the WorkflowWrapper in terms of billing may depend on how workflows are processed and saved. Depending on the project subscription tier, elements such as the number of nodes processed and data encapsulated within workflows may influence costs. Frequent saving and loading of large workflows can lead to increased data transfer fees. Always refer to the relevant billing documentation to understand the potential implications based on usage patterns.
Use Cases & Examples
Use Cases
-
Data Workflow Automation: A retail company may use
WorkflowWrapperto automate the data flow from their e-commerce platform through various data transformation nodes to ultimately visualize sales analytics for better decision-making. -
Integration with Third-Party Services: A marketing team could use the workflow builder to connect with analytics APIs to fetch user data for targeted campaign analysis, consolidating various data sources into one coherent workflow.
-
Custom Data Processing: A data engineer can design a customized workflow for cleaning and transforming large datasets before sending them to reporting tools, using the drag-and-drop interface to simplify the task.
Example Configuration
To create a new data transformation workflow, a data engineer could configure the WorkflowWrapper with the following settings:
{
"registryEndpoint": "https://example.com/registry",
"title": "Sales Data Transformation",
"description": "Workflow for transforming raw sales data for analysis.",
"apiBasePath": "/api/v1/workflow",
"workflowId": null
}In practice, they might initiate this through their application front-end, which then reflects the new workflow in the UI, allowing them to add nodes such as data cleaning, transformation steps, and visualization connections to complete the data processing task.