> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze Data

> Perform data analysis with AI insights, generate charts & graphs, aggregate data, calculate custom metrics

Perform data analysis with AI insights, generate charts & graphs, aggregate data, calculate custom metrics. You need to provide dataset from other nodes and a prompt, it can return either a markdown response (graphs, tables, etc.) or structured data you provide in schema, structure data can be used in nodes like Google Sheets, Google Slides Table, etc. Note: charts will be returned as image URLs in markdown — no other formats are supported.

|                     |                   |
| ------------------- | ----------------- |
| **App**             | AI                |
| **Operation ID**    | `ai_analyze_data` |
| **Type**            | Action            |
| **Connection**      | None              |
| **Credits per run** | 2                 |
| **Versions**        | 1, 2 (default: 2) |

## Inputs

| Field           | Type                       | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------- | -------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`        | string                     | Yes      | -       | Instructions for analyzing the data. This is a multi-line text area where you can: - Describe what analysis to perform - Ask specific questions about the data - Request insights, trends, or patterns - Use line breaks to structure complex analysis requests - Request charts and visualizations if needed.  IMPORTANT RULES: - NEVER include actual data, datasets, or data content in this prompt field - ALWAYS use the separate 'data' field below for all datasets and data content - This prompt should ONLY contain analysis instructions, questions, and what insights you want - Even if the user provides data in their request, extract it and put it in the 'data' field instead - Charts will be returned as image URLs in markdown — no other formats are supported. - Do NOT request technical details for charts like image resolution or format — just describe the chart you want - When using 'schema\_fields', do not ask the AI to return JSON, it will be returned automatically by default. |
| `model`         | string or SelectableOption | Yes      | -       | The AI model to use for data analysis. Some available options: 'gpt-5.2' - Default, best for data analysis 'gpt-4.1' - Support larger context windows, up to 1m tokens                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `data`          | string                     | Yes      | -       | The data to analyze. This is mainly the output from upstream workflow nodes containing datasets, tables, or structured information. Reference data from other nodes using \{\{nodeId\_\_data}} syntax. Example: \{\{googleSheetsNodeId\_\_data}} For multiple datasets, add the dataset name before, for example: Meta Ads: \{\{metaAdsNodeId\_\_data}} Google Analytics: \{\{googleAnalyticsNodeId\_\_data}}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `schema_fields` | array of SchemaField       | No       | -       | - Defines a LIST of objects, where each object represents a field definition for the structured output. You are explicitly defining the keys of each object in the output schema. - Each object in the list must include:   - name: The key name that will appear in the structured output (e.g., "clicks", "impressions").   - type:  Must be one of: `text`, `number`, `boolean`, `list`. Note that `list` represents a list of strings.   - description – A clear explanation of what this field represents. - The schema fields can be referenced by downstream nodes using: \{\{nodeId\_\_data.field}}. - Use this when you need the analysis results in a consistent format for downstream nodes like Google Sheets, Slides, etc. - Don't use it to generate summary/markdown tables, this should be normal text output using the `prompt` field.                                                                                                                                                               |
| `force_python`  | boolean                    | No       | -       | Force the AI to use Python code for data analysis instead of just text analysis. When enabled, the AI will write and execute Python code to: - Perform statistical calculations - Generate charts and visualizations - Handle complex data manipulations - Provide more precise numerical analysis                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

### SchemaField

| Field         | Type   | Required | Default | Description                                                                         |
| ------------- | ------ | -------- | ------- | ----------------------------------------------------------------------------------- |
| `name`        | string | Yes      | -       | The name of the field. This becomes the key in the output object.                   |
| `type`        | string | Yes      | -       | Allowed values: 'text', 'number', 'boolean', 'list'. The list is a list of strings. |
| `description` | string | Yes      | -       | A clear explanation of what this field represents.                                  |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `str | List[Dict]`

Returns markdown text with analysis/charts. If schema\_fields provided, it returns structured data matching the schema in list\[Dict] format.

**Fields**: dynamic (depend on the inputs)

**Example**:

```json theme={"dark"}
[
  {
    "metric": "sessions",
    "value": 1500
  }
]
```
