Database

Create Graphs

Category
Database / Visualization
Node Type
Chart / Graph Generation Node

Overview

The Create Graphs Node lets you turn your database queries into visual charts — such as line graphs, bar graphs, pie charts, scatter plots, and area graphs — directly inside a no-code workflow.

It’s designed for users who want to visualize data without writing code, for use in dashboards, reports, or automated email updates.

Description

Generate visual charts from your data.

This node connects to your database, runs a query (either a manual query or one written in plain language), and returns a visual chart representing your results. You can choose which table to query, what filters to apply, and what type of chart to generate.

Line Graph

Best for showing trends over time (e.g., sales growth).

Bar Graph

Best for comparing categories (e.g., users per region).

Pie Chart

Best for showing proportions (e.g., market share).

After execution, the node provides the queried data and a link to the generated chart image (chartUrl).

Input Parameters

The Create Graphs node accepts settings for querying data and configuring the chart.

selectQueryTypestringRequired
Choose between 'Query Data' (structured) or 'Natural Language Query'.
Example
"Query Data"
tableNamestringRequired
The name of the database table or collection. Format: 'environment:tableName'.
Example
"production:sales"
chartTypestringRequired
The type of chart to generate: 'Line Graph', 'Bar Graph', 'Pie Chart', 'Scatter Plot', or 'Area Graph'.
Example
"Bar Graph"
xFieldstringRequired
The field to use for the X-axis (categories or time).
Example
"month"
yFieldstringRequired
The field to use for the Y-axis (values).
Example
"total_sales"
Query FieldsarrayOptional
List of filters for structured queries.
Example
[{"field": "status", "operator": "=", "value": "completed"}]
naturalLanguagestringOptional
Plain text query instruction (if using Natural Language Query).
Example
"Show total sales per month"
aggregationstringOptional
How to aggregate values: 'sum', 'average', 'count', 'min', 'max'.
Example
"sum"

Output Parameters

The node returns a JSON object containing the chart URL and data.

tableNamestringOptional
The full name of the queried table.
Example
"production:sales"
queryIdstringOptional
A unique identifier for this execution.
Example
"23c92010-..."
chartUrlstringOptional
The direct link to the generated chart image.
Example
"https://.../chart.png"
imagestringOptional
Alias for chartUrl.
Example
"https://.../chart.png"
dataarrayOptional
The raw data records used to generate the chart.
Example
[{"month": "Jan", "sales": 100}, ...]
messagestringOptional
A summary of the operation.
Example
"Successfully fetched 12 records and generated chart"
statusstringOptional
Indicates success or failure.
Example
"success"
Accessing the Chart

Use the chart image in subsequent nodes:

{{create-graphs.output.chartUrl}}

Output Type

Output Type: JSON

The output is a JSON object that includes both the query results and metadata about the generated chart. This JSON can be used by other workflow nodes to display, share, or store the chart.

Example Usage

Example 1: Line Graph from Query Data

Visualize user growth over time.

{  "selectQueryType": "Query Data",  "tableName": "production:users",  "chartType": "Line Graph",  "xField": "created_at",  "yField": "count",  "aggregation": "count",  "groupBy": "created_at"}
{  "tableName": "production:users",  "queryId": "23c92010-...",  "data": [    { "created_at": "2023-01", "count": 50 },    { "created_at": "2023-02", "count": 75 }  ],  "message": "Successfully fetched 2 records and generated chart",  "status": "success",  "chartUrl": "https://s3.amazonaws.com/.../chart.png",  "image": "https://s3.amazonaws.com/.../chart.png"}

Example 2: Bar Graph from Natural Language

Show sales by region using plain English.

{  "selectQueryType": "Natural Language Query",  "tableName": "production:sales",  "naturalLanguage": "Show total sales per region for the last quarter",  "chartType": "Bar Graph",  "xField": "region",  "yField": "sales"}
{  "tableName": "production:sales",  "queryId": "xxxxxxxx-...",  "data": [    { "region": "North", "sales": 12000 },    { "region": "South", "sales": 8500 }  ],  "message": "Successfully fetched 2 records and generated chart",  "status": "success",  "chartUrl": "https://.../sales-by-region.png",  "image": "https://.../sales-by-region.png"}

How to Use in a No-Code Workflow

1

Add the Node

Add the Create Graphs node to your workflow.

2

Configure Query

Select Query Type and Table Name. Define filters or type your natural language query.

3

Configure Chart

Select Chart Type (e.g., Bar Graph). Set xField (category) and yField (value).

4

Run Workflow

Save and run. The node will generate the chart URL.

5

Use Chart

Pass the chartUrl to an Email node or Display node.

Best Practices

  • Always apply a limit to avoid overly large datasets.
  • For time-based charts, make sure the xField is a date or timestamp.
  • Use numeric fields for yField so charts can render correctly.

Do / Don’t

Do
  • ✔️ Use Aggregation (sum, count) when grouping data.
  • ✔️ Keep Pie Chart categories to a minimum (max 5-7) for readability.
  • ✔️ Store the chartUrl if you need to reference it later.
Don’t
  • ❌ Don’t use text fields for the Y-axis (values must be numbers).
  • ❌ Don’t fetch thousands of records without aggregation; it will slow down generation.
  • ❌ Don’t ignore empty chart results; check your query filters.

Common Errors

No data returnedWarningOptional
Query filters matched no records. Broaden your search.
Chart not generatedErrorOptional
Invalid fields selected for X or Y axes (e.g., non-numeric Y).
Empty chartWarningOptional
Only one data point fetched. Increase limit or use aggregation.
Permission deniedErrorOptional
Table not accessible or doesn't exist.

Example Workflow Integration

Use Case 1: Weekly Sales Report

Email a sales chart to the team every Monday.

  1. Schedule Trigger: Every Monday at 9 AM.
  2. Create Graphs Node: Query production:sales for last week's data, group by day, sum amount. Generate Line Graph.
  3. Email Node: Send email with chartUrl embedded.

Workflow Data Flow:

{{schedule.last_week}} →  {{createGraphs.filters.date}}
{{createGraphs.chartUrl}} →  {{emailNode.body.image}}

Use Case 2: User Growth Dashboard

Display current user count by plan.

  1. Trigger: Dashboard load.
  2. Create Graphs Node: Query production:users, group by plan, count IDs. Generate Pie Chart.
  3. Display Node: Show the pie chart on the dashboard.

Workflow Data Flow:

{{createGraphs.chartUrl}} →  {{displayNode.image}}