← Back to blog

Forecast Daily Sales with Timestral and n8n

Build idea, not a verified tutorial. This was drafted by an automation Daniel built. Tool interfaces change often — check the current docs before relying on the steps.

Every morning an ops team stares at last week's numbers and guesses whether today will be busy or slow. Time-series forecasting — predicting a future number from a sequence of past numbers — used to require a data scientist. Mistral's Timestral model, released October 15 2026, runs that forecast on an ordinary laptop CPU in under a second, with no GPU and no ML background needed.

TRIGGERORCHESTRATEAI / ENRICHOUTPUTSchedule Trigger(every morning 7 am)Google Sheets Readsales columnTimestral localserver forecast nextGoogle Sheets Writeprediction row
How it flows
1

Install Timestral and wrap it in a tiny local server

Timestral is a Python library — a package you install with the `pip` command. It downloads Mistral's forecasting model weights to your machine. You then write a 20-line Python file that turns it into a local HTTP server (a mini web service running on your own computer at port 8000) so that n8n can talk to it like any other API. Open a terminal and run the two commands shown below, then paste the server code into a file called `server.py`.

Terminal · install and serve Timestral
1 Step 1 — install the library (requires Python 3.10+)
pip install git+https://github.com/mistralai/timestral.gitCopy
2 Step 2 — paste this into server.py and run it with: python server.py
from http.server import BaseHTTPRequestHandler, HTTPServer import json, numpy as np from timestral import TimestralForecaster forecaster = TimestralForecaster.from_pretrained('mistralai/Timestral-5M') class Handler(BaseHTTPRequestHandler): def do_POST(self): body = json.loads(self.rfile.read(int(self.headers['Content-Length']))) values = np.array(body['values'], dtype=np.float32).reshape(1, -1, 1) pred = forecaster.predict(values, horizon=1) result = {'forecast': float(pred['median'][0, 0, 0])} self.send_response(200) self.send_header('Content-Type','application/json') self.end_headers() self.wfile.write(json.dumps(result).encode()) HTTPServer(('localhost', 8000), Handler).serve_forever()Copy
3 Keep this terminal window open while n8n runs
The server must be running for n8n to reach it. On a team machine, run it as a background service. The 5M model is only 21 MB and loads in a second. Timestral GitHub README →
2

Set up your Google Sheet with a sales column

Create a Google Sheet with one column labelled Date (column A) and one labelled Sales (column B). Add at least 30 rows of past daily sales figures — the model needs historical context to forecast. Leave one empty row at the bottom: that is where n8n will write today's prediction.

Google Sheets · sheet layout
1 Sheet structure (the header row)
A1Date
B1Sales
C1Forecast
Add a Forecast column so predictions land in column C
2 Copy the sheet URL — you'll need it in n8n
The URL looks like https://docs.google.com/spreadsheets/d/SHEET_ID/edit. Copy the whole thing. Google Sheets →
3

Create the n8n workflow and add a Schedule Trigger

n8n is a visual automation tool where each step is a block called a node. A trigger node is the first node — it decides *when* the workflow starts. You want it to fire every morning before the team arrives. In n8n, click + New Workflow in the left sidebar to open a blank canvas, then add your trigger.

n8n · new workflow canvas
1 Open a blank workflow
+ New Workflow
2 Search for and add the Schedule Trigger
3 Configure the Schedule Trigger node
Trigger IntervalDays
Days Between Triggers1
Trigger at Hour7
Trigger at Minute0
This fires the workflow every day at 7:00 AM
4

Read the sales column from Google Sheets

Click the + connector on the right side of the Schedule Trigger to add the next node. Search for Google Sheets and choose the Get Many Rows operation. This node will pull all the rows from your sheet so n8n can pass the numbers to Timestral. You need to connect your Google account the first time — n8n will walk you through a standard Google sign-in pop-up.

n8n · Google Sheets node
1 Add a Google Sheets node
2 Configure the node
CredentialSign in with Google (first time only)
OperationGet Many Rows
SpreadsheetPaste your sheet URL here
Sheet NameSheet1
Return All RowsEnabled
Enable 'Return All Rows' so every historical value is included
3 Click 'Execute node' to test it now
You should see your sales rows appear in the output panel at the bottom. If you see an error, check that you shared the sheet with the Google account you connected. n8n Google Sheets docs →
5

Send the numbers to Timestral with an HTTP Request node

Now add an HTTP Request node — n8n's all-purpose tool for calling any web address. You'll use a Code node first to reshape the Google Sheets rows into a plain list of numbers, then pass them to your local Timestral server. The Code node lets you write a tiny snippet of JavaScript; don't worry, you can copy it exactly as shown.

n8n · Code node + HTTP Request node
1 Add a Code node after Google Sheets
2 Paste this JavaScript into the Code node — it pulls just the Sales column
const rows = $input.all(); const values = rows .map(r => parseFloat(r.json.Sales)) .filter(v => !isNaN(v)); return [{ json: { values } }];Copy
3 Add an HTTP Request node after the Code node
4 Configure the HTTP Request node
MethodPOST
URLhttp://localhost:8000
Body Content TypeJSON
Body{{ $json }}
The URL points to your local Timestral server running on port 8000
6

Write the forecast back to Google Sheets

Add one more Google Sheets node. This time use the Append Row operation to write a new row containing today's date and Timestral's predicted value. The predicted value lives at `{{ $json.forecast }}` in n8n's expression language — that double-curly syntax just means 'pull this field from the previous step's output'.

n8n · Google Sheets node (write back)
1 Add a second Google Sheets node
2 Configure the Append Row operation
OperationAppend Row
SpreadsheetSame sheet URL as before
Sheet NameSheet1
Column C value (Forecast){{ $json.forecast }}
You can also add a Date column: {{ $now.toFormat('yyyy-MM-dd') }}
3 What a written row looks like
New forecast rowWritten by n8n
Date2026-10-20
Sales(blank — historical rows only)
Forecast4182.7
7

Activate the workflow and watch the first run

You have built the full pipeline. Now flip it on. In n8n, click the Inactive toggle at the top-right of the canvas — it turns green and says Active. From this point on, the workflow fires automatically every morning at 7 am. You can also click Execute Workflow right now to run it immediately and confirm the forecast lands in your sheet.

n8n · workflow canvas toolbar
1 Toggle the workflow live
Inactive → Active
2 Or test it right now
Execute Workflow
3 Check the Executions panel if something looks wrong
Click the clock icon in the left sidebar to open Execution History. Click any run to see exactly what data each node received and sent — this is how you debug. n8n Execution History docs →

What you get

Every morning at 7 am, n8n reads your Google Sheet, runs the last 30+ days of sales through Timestral's 5M-parameter forecasting model on your local CPU, and appends the predicted value for the next day. Your team opens the sheet and sees tomorrow's forecast already waiting — no manual work, no cloud GPU bill. Rough effort: ~2–3 hours first time; free (Timestral weights are free under Modified MIT, n8n Community Edition is free, Google Sheets is free). You need a machine that can run Python — a standard laptop is fine..

Sources