5 min readUpdated Mar 2, 2026

ForecastTile Documentation

Overview

The ForecastTile component is an AI-powered visualization tool that generates forecasts based on historical data. It employs machine learning models to predict future values and provides an interactive interface for users to view and analyze these predictions. The ForecastTile is designed to dynamically update its data based on user configuration and cached results, ensuring efficient data retrieval and visualization.

Purpose

The primary purpose of the ForecastTile is to provide users with a clear and insightful graphical representation of potential future trends based on existing data. This feature is particularly useful for businesses needing to anticipate market shifts, financial forecasts, resource allocation, etc.

Settings

Title

Subtitle

FooterText

FooterColor

Config Properties

WorkflowId

ForecastPrompt

ChartType

ForecastModel

ConfidenceLevel

SourceDataSnapshot

SkipAnimation

How It Works

The ForecastTile component operates in the following manner:

  1. Data Retrieval:

    • On initial load, it checks if forecast data exists in the session cache.
    • If not found, it fetches new forecast data based on settings provided in the configuration.
  2. AI Integration:

    • The component fetches forecast data asynchronously from an API endpoint (/api/ai/forecast), which accepts parameters such as workflowId, forecastPrompt, existingData, and model.
  3. Data Display:

    • Once forecast data is available, the component renders it using either a line graph or a bar chart based on user preferences. It also shows confidence intervals as needed.
  4. Caching:

    • The component persists generated forecasts in a session-level cache (forecastCache), enabling fast access during tab switches without needing to refetch.
  5. Error Handling:

    • It includes provisions for handling loading states and errors during data fetching, providing users with informative messages and retry options.

Use Cases & Examples

Use Case 1: Financial Forecasting

A financial analyst uses the ForecastTile to analyze market trends based on historical sales data. By configuring the facility to forecast potential revenue for the next six months, they leverage AI to understand possible outcomes under different economic scenarios.

Use Case 2: Resource Allocation in Supply Chain

A supply chain manager utilizes the ForecastTile to predict inventory needs for the upcoming quarter. Adjusting the forecastPrompt to focus on seasonal demand can help optimize stock levels, reducing both surplus and shortages.

Detailed Example Configuration

To implement a resource allocation use case, the configuration data could be set as follows:

json
{
  "title": "Quarterly Inventory Forecast",
  "subtitle": "Predicting inventory needs for Q4 based on historical data",
  "config": {
    "workflowId": "inventory-workflow-2023Q4",
    "forecastPrompt": "Forecast inventory requirements based on past sales data from Q1 to Q3.",
    "chartType": "bar",
    "forecastModel": "auto",
    "confidenceLevel": "90",
    "sourceDataSnapshot": [
      { "label": "January", "value": 120, "isForecast": false },
      { "label": "February", "value": 135, "isForecast": false },
      { "label": "March", "value": 150, "isForecast": false }
    ]
  }
}

In this example configuration, the ForecastTile is tailored to forecast inventory based on historical sales, utilizing various settings that prepare the tile for effective data visualization.