n8n

How to Analyze Google Sheets Finance Insights?

Turn your Google Sheets transactions into a chat you can question in plain English. Ask for refunds, sales totals, or product trends without touching formulas. Best for finance and operations teams that need fast answers from live data.

A chat message starts the flow and routes to an AI agent that uses an OpenAI model with low temperature for steady answers. The agent can pull rows by product or status with Google Sheets tools, or run a custom Sheets API query for date ranges. A code step cleans the API response into neat JSON. Results are filtered and aggregated into one item so the AI sees the full picture and runs math with a calculator tool. Short term memory keeps the last five questions for context.

Connect OpenAI and Google Sheets with credentials in n8n Cloud and point the nodes to your copy of the sheet. Expect report prep time to drop and ad hoc questions to move from hours to minutes. Common uses include monthly revenue checks, refund analysis, and quick product performance reviews.

What are the key features?

  • Chat message trigger starts analysis when a user asks a question.
  • AI agent runs on an OpenAI chat model with temperature 0.2 for stable answers.
  • Google Sheets tools fetch all rows, filter by product, or filter by status.
  • Custom HTTP request queries the Google Visualization API to filter by date range.
  • Code node converts the JSONP response into clean JSON objects.
  • Filter and Aggregate steps combine results into one item for complete context.
  • Calculator tool performs sums, averages, and other math during analysis.
  • Buffer memory remembers the last five chat turns for better follow ups.
  • Sub workflow tool returns records by date and optional status using inputs from the AI.

What are the benefits?

  • Reduce manual report work from 2 hours to 5 minutes
  • Automate 90 percent of ad hoc spreadsheet queries
  • Improve accuracy by removing copy and paste steps
  • Connect chat and Google Sheets in one place
  • Answer many different questions without new formulas

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Sheets and OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create an OpenAI credential. Choose OpenAI, click Create new credential, and paste your API key from the OpenAI account page. Save and test the connection.
  4. In the n8n credentials manager, create a Google Sheets OAuth credential. Double click any Google Sheets node, in Credential to connect with choose Create new credential, and follow the on screen steps to grant access to your Google account. Save and test.
  5. Make a copy of the sample spreadsheet in your Google Drive and note the document URL. Confirm the sheet name matches the nodes or update the nodes to your sheet name.
  6. Open each Google Sheets node and set Document ID and Sheet to your copied file. Click Execute Node to confirm rows load with no errors.
  7. Open the HTTP Request node and verify the URL ends with gviz and the tq query uses start_date and end_date. Dates must be in YYYY MM DD format to match the query.
  8. Open the Code node and click Execute Node after running the HTTP Request. Confirm it outputs an array of JSON objects with the expected fields.
  9. Open the AI Agent node and select your OpenAI credential. Check that tools are connected, including Calculator, Google Sheets tools, and the Records by date sub workflow.
  10. Start the chat interface for the chat trigger. Ask a test like How many refunds in January and what was the amount refunded. Confirm a single aggregated result reaches the AI.
  11. Check the Aggregate node settings. It should combine all items into one so the AI receives complete data. If you see multiple items, set it to aggregate all item data and test again.
  12. Troubleshooting tips. If no rows return, check sheet sharing and OAuth scopes. If dates fail, confirm the format. If the AI times out, reduce the date range or check OpenAI rate limits.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.