This workflow corresponds to n8n.io template #8606 — we link there as the canonical source.
This workflow follows the Agent → HTTP Request Tool recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "9aTix0CxjipAFy56",
"name": "Coinbase AI Agent v1.02",
"tags": [],
"nodes": [
{
"id": "a55bf961-08ec-4b57-bc79-5d61f25fd56d",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-1264,
736
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "a6a4ee3a-efe9-4ab0-a201-bb98780f9d0b",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-1008,
240
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "5b32884d-b376-4775-a47c-07bec03191b9",
"name": "User Authentication (Replace Telegram ID)",
"type": "n8n-nodes-base.code",
"position": [
-688,
240
],
"parameters": {
"jsCode": "if ($input.first().json.message.from.id !== <<Replace>>) { // Replace with your actual ID\n return {unauthorized: true};\n} else {\n // Return the original data when authorized\n return $input.all();\n}"
},
"typeVersion": 2
},
{
"id": "75eb688d-d8b7-4498-be72-73f2f31ac8aa",
"name": "Adds \"SessionId\"",
"type": "n8n-nodes-base.set",
"position": [
-416,
240
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "47598bf1-e55f-4cc0-ae75-272085e7ce02",
"name": "=sessionId",
"type": "string",
"value": "={{ $json.message.chat.id }}"
},
{
"id": "daa49d74-e55e-47bc-ac52-8686d591ab83",
"name": "message",
"type": "string",
"value": "={{ $json.message.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "d1e44ee5-6f45-4cca-9b0c-e0d1ce43a65a",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
896,
240
],
"parameters": {
"text": "={{ $json.message }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "302330a2-2f5f-44a3-b1b5-18979ae3681a",
"name": "Splits message is more than 4000 characters",
"type": "n8n-nodes-base.code",
"position": [
464,
240
],
"parameters": {
"jsCode": "// Input: assumes incoming message in `item.json.message`\nconst input = $json.output;\nconst chunkSize = 4000;\n\n// Function to split text\nfunction splitMessage(text, size) {\n const result = [];\n for (let i = 0; i < text.length; i += size) {\n result.push(text.substring(i, i + size));\n }\n return result;\n}\n\n// Logic\nif (input.length <= chunkSize) {\n return [{ json: { message: input } }];\n} else {\n const chunks = splitMessage(input, chunkSize);\n return chunks.map(chunk => ({ json: { message: chunk } }));\n}"
},
"typeVersion": 2
},
{
"id": "4b9e1661-7200-41fd-a832-1105989dec6d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1072,
-32
],
"parameters": {
"color": 4,
"height": 460,
"content": "## Trigger Incoming Telegram Command\nNode: Telegram Trigger\n**Listens for new Telegram messages** from users.\nTriggers the full agent process and passes raw user input downstream."
},
"typeVersion": 1
},
{
"id": "1ab48202-ada4-44c7-b8f8-767bdcc63a55",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-752,
-32
],
"parameters": {
"color": 2,
"height": 460,
"content": "## Validate User Access\nNode: User **Authentication\nChecks incoming Telegram ID** against the approved user list."
},
"typeVersion": 1
},
{
"id": "cdbe47f8-2fd9-4532-8f0b-b326f269197f",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-464,
-32
],
"parameters": {
"color": 5,
"height": 460,
"content": "## Generate Session Metadata\nNode: Add S**essionId\nCreates a sessionId using the Telegram chat_id**.\nThis is passed into all downstream tools for memory and workflow routing."
},
"typeVersion": 1
},
{
"id": "4b9e5cdb-f05c-4554-9c89-42ad66fb4955",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-192,
-368
],
"parameters": {
"color": 7,
"width": 480,
"height": 804,
"content": "## Main AI Agent: Data Fetcher\n\n**Node: Coinbase Data Agent**\nThis is the **core orchestrator**. It uses OpenAI only to **format and present raw Coinbase market data**, not to analyze or generate strategies.\n\nIt has direct **HTTP request access** to the Coinbase Exchange REST API and retrieves:\n\n* **Live price** (`/products/{product_id}/ticker`)\n* **24h ticker stats** (`/products/{product_id}/stats`)\n* **Order book depth** (`/products/{product_id}/book?level=2`)\n* **Best bid/ask** (`/products/{product_id}/book?level=1`)\n* **Klines/candlesticks** (`/products/{product_id}/candles`)\n* **Recent trades** (`/products/{product_id}/trades`)\n* **Average price (derived)** \u2192 midpoint from best bid/ask\n\nThe agent calls these endpoints in parallel for the requested `product_id` (e.g., `BTC-USD`), validates results, and then **presents the data in clean Telegram HTML format**.\n\nIt does **not**:\n\n* Perform technical analysis\n* Generate strategies or predictions\n* Fetch sentiment or news\n"
},
"typeVersion": 1
},
{
"id": "8543d31f-9681-4cf9-9d45-fd243075c83e",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
384,
-32
],
"parameters": {
"color": 5,
"width": 260,
"height": 460,
"content": "## Handle Telegram Message Limits\nNode: Code (split logic)\nChecks if the **GPT output exceeds 4000 characters**.\nIf so, it splits the message into safe chunks and passes them on sequentially."
},
"typeVersion": 1
},
{
"id": "6030ece9-6513-45ae-8680-4d38e792eee4",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
832,
-32
],
"parameters": {
"color": 4,
"height": 460,
"content": "## Send Final Report to Telegram\nNode: Telegram sendMessage\nSends **formatted HTML report (or split chunks)** directly to the authenticated user via Telegram bot."
},
"typeVersion": 1
},
{
"id": "89de4e6a-21c6-4b57-9297-ea03e424c2fe",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1344,
640
],
"parameters": {
"height": 540,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## GPT Model for Reasoning\nNode: OpenAI Chat Model\nModel: **gpt-4o-mini**\nUsed to:\n\nInterpret signal values\n\nGenerate structured HTML\n\n**Recommend spot and leverage trades**\n\n"
},
"typeVersion": 1
},
{
"id": "0a5588cc-2ad7-4b40-b595-3e2045103bca",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-480,
512
],
"parameters": {
"color": 6,
"height": 980,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Order Book Depth**\n\n**Endpoint:** `GET /products/{product_id}/book?level=2`\n**What it does:** Returns the **order book** for a product. Use `level=1` for best bid/ask (L1) or `level=2` for aggregated depth (L2).\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format `BASE-QUOTE` (e.g., BTC-USD)\n* `level` (INT, optional) \u2192 `1` (top of book) or `2` (aggregated depth). Default: `2`.\n\n**Returns (L2):** `bids: [[price, size], ...]`, `asks: [[price, size], ...]` plus metadata.\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlevel = $fromAI('level', 2, 'number')\n```\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/book"
},
"typeVersion": 1
},
{
"id": "661bcfce-269d-40b3-9a1d-1ae0e0300cea",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
128,
512
],
"parameters": {
"color": 6,
"height": 916,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Best Bid/Ask (Book Ticker)**\n\n**Endpoint:** `GET /products/{product_id}/book?level=1`\n**What it does:** Returns the best **bid/ask** with sizes for the product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `level` (INT, fixed = 1)\n\n**Returns:** `{ \"bids\": [[price, size]], \"asks\": [[price, size]], \"sequence\": ... }`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlevel = 1\n```\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/book"
},
"typeVersion": 1
},
{
"id": "1a6f0427-35f1-4799-889a-9ec534caacbe",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1072,
640
],
"parameters": {
"color": 3,
"height": 540,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Short-Term Memory Module\nNode: **Simple Memory\nStores the sessionId**, symbol, and other state data.\nUseful for:\n\nMulti-turn Telegram interactions\n\nTracking indicator agreement across timeframes\n\n"
},
"typeVersion": 1
},
{
"id": "1600fc25-60f5-495e-8aad-93e9632a9cf3",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-992,
736
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "cdb20aa4-7b22-40e6-95b4-4a480a819064",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
-784,
512
],
"parameters": {
"color": 6,
"height": 852,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **24h Stats**\n\n**Endpoint:** `GET /products/{product_id}/stats`\n**What it does:** 24-hour rolling window stats: **open/high/low/last**, **volume**.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n\n**Returns (FULL):** open, high, low, last, volume (24h).\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\n```\n\nhttps://api.exchange.coinbase.com/products/{{$fromAI('product_id','BTC-USD','string')}}/stats"
},
"typeVersion": 1
},
{
"id": "8f91da18-3d8e-4788-bf8e-a33b6addceb4",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
-192,
512
],
"parameters": {
"color": 6,
"height": 884,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Price (Latest)**\n\n**Endpoint:** `GET /products/{product_id}/ticker`\n**What it does:** Returns the **latest trade price** plus best bid/ask and volume for a product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n\n**Returns:** `{ \"trade_id\": ..., \"price\": \"...\", \"size\": \"...\", \"bid\": \"...\", \"ask\": \"...\", \"volume\": \"...\", \"time\": \"...\" }`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\n```\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/ticker"
},
"typeVersion": 1
},
{
"id": "76abe339-9456-472f-b3f0-11b37f3950e8",
"name": "Sticky Note12",
"type": "n8n-nodes-base.stickyNote",
"position": [
464,
512
],
"parameters": {
"color": 6,
"height": 964,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Klines (Candles)**\n\n**Endpoint:** `GET /products/{product_id}/candles`\n**What it does:** Candlestick (OHLCV) data for a product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `granularity` (INT, required) \u2192 supported: 60, 300, 900, 3600, 21600, 86400 (1m, 5m, 15m, 1h, 6h, 1d)\n* `start`, `end` (ISO8601, optional)\n\n**Returns (array per candle):** `[ time, low, high, open, close, volume ]`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\ngranularity = $fromAI('granularity', 900, 'number') # 900 = 15m default\n```\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/candles"
},
"typeVersion": 1
},
{
"id": "2ef6ad08-14c2-417b-8dc3-e09bb653203c",
"name": "Sticky Note13",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
512
],
"parameters": {
"color": 6,
"height": 1044,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Average Price (Derived)**\n\n**Endpoint:** `GET /products/{product_id}/book?level=1`\n**What it does:** Coinbase does not provide a direct average price endpoint. This tool fetches the **best bid/ask** and you can derive a midpoint average `(bid + ask)/2`.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `level` (INT, fixed = 1)\n\n**Returns:** `{ \"bids\": [[price, size]], \"asks\": [[price, size]] }`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlevel = 1\n```\n\n**Notes:** Use Calculator node to compute midpoint from bid/ask.\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/book"
},
"typeVersion": 1
},
{
"id": "ff624f1e-6101-4d93-9c6d-c0194edbedef",
"name": "Sticky Note14",
"type": "n8n-nodes-base.stickyNote",
"position": [
1136,
512
],
"parameters": {
"color": 6,
"height": 1092,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Recent Trades**\n\n**Endpoint:** `GET /products/{product_id}/trades`\n**What it does:** Returns the **most recent trades** for a Coinbase product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `limit` (INT, optional) \u2192 number of trades to return (defaults ~100)\n\n**Returns (array):** `[ { \"time\": \"...\", \"trade_id\": 123, \"price\": \"...\", \"size\": \"...\", \"side\": \"buy|sell\" }, ... ]`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlimit = $fromAI('limit', 100, 'number')\n```\n\n**Notes:** Endpoint supports pagination via `before` / `after` cursors if you later need historical pages.\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/trades"
},
"typeVersion": 1
},
{
"id": "00e14a00-38db-455a-b771-30585e0a8570",
"name": "Calculator",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
1520,
592
],
"parameters": {},
"typeVersion": 1
},
{
"id": "89546696-8844-4378-b8ed-36c5431ca957",
"name": "Think",
"type": "@n8n/n8n-nodes-langchain.toolThink",
"position": [
1808,
592
],
"parameters": {
"description": "### \ud83c\udff7 Tool: **Think**\n\n**Purpose:**\n\n* Lightweight **reasoning helper**.\n* Lets the AI Agent process intermediate logic, format outputs, or decide how to combine multiple API results before sending the final report.\n* Does not fetch data itself.\n\n**Use cases:**\n\n* Clean/reshape JSON from Binance endpoints\n* Extract only the needed fields (e.g., `lastPrice`, `volume`)\n* Help prepare data for Telegram message formatting\n\n**n8n setup notes:**\n\n* No API call, just an **AI Tool** node.\n* Connect upstream API results \u2192 Think \u2192 Report Agent."
},
"typeVersion": 1.1
},
{
"id": "077de91e-f21c-4fa7-984c-3604ae546082",
"name": "Sticky Note15",
"type": "n8n-nodes-base.stickyNote",
"position": [
1440,
512
],
"parameters": {
"color": 6,
"height": 836,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Calculator**\n\n**Purpose:**\n\n* Perform **math operations** inside the workflow.\n* Supports add/subtract/multiply/divide, percentages, rounding, etc.\n\n**Use cases:**\n\n* Calculate spreads (ask \u2013 bid)\n* Compute % changes from open vs. last price\n* Normalize volumes or confidence scores\n\n**n8n setup notes:**\n\n* Node: `Calculator` (n8n built-in)\n* Input fields can come from Binance API JSON\n* Output can be chained into Think \u2192 Final Report\n"
},
"typeVersion": 1
},
{
"id": "b84095a1-b007-4ba2-8ec5-544d64156925",
"name": "Sticky Note16",
"type": "n8n-nodes-base.stickyNote",
"position": [
1728,
512
],
"parameters": {
"color": 6,
"height": 932,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Think**\n\n**Purpose:**\n\n* Lightweight **reasoning helper**.\n* Lets the AI Agent process intermediate logic, format outputs, or decide how to combine multiple API results before sending the final report.\n* Does not fetch data itself.\n\n**Use cases:**\n\n* Clean/reshape JSON from Binance endpoints\n* Extract only the needed fields (e.g., `lastPrice`, `volume`)\n* Help prepare data for Telegram message formatting\n\n**n8n setup notes:**\n\n* No API call, just an **AI Tool** node.\n* Connect upstream API results \u2192 Think \u2192 Report Agent."
},
"typeVersion": 1
},
{
"id": "a52823fe-fc0a-4612-ae21-67748ad38c33",
"name": "Coinbase AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-96,
240
],
"parameters": {
"text": "={{ $json.message }}",
"options": {
"systemMessage": "You are the **Coinbase Spot Market Data Agent**.\n\nYou have **HTTP request access** to the official **Coinbase Exchange REST API** to retrieve market data for any requested Coinbase spot trading pair.\nYour job is to **fetch and present data only**. You do **not** analyze, predict, or recommend.\n\n---\n\n## \ud83d\udd17 API Access\n\n**Base endpoint (primary default):** `https://api.exchange.coinbase.com` :contentReference[oaicite:0]{index=0} \n**Format rules:**\n- All requests are **HTTP GET**; responses are **JSON**:contentReference[oaicite:1]{index=1}.\n- `product_id` format is `BASE-QUOTE` (e.g., `BTC-USD`) and **lowercase URLs** are required:contentReference[oaicite:2]{index=2}.\n- Public endpoints don\u2019t require auth; private endpoints do (signed headers):contentReference[oaicite:3]{index=3}.\n- Public REST rate limit: **10 rps per IP** (burst up to 15). Private: **15 rps per profile** (burst up to 30). Exceeding returns **429**:contentReference[oaicite:4]{index=4}.\n\n---\n\n## \ud83d\udccc Available Market Data Endpoints (Public REST)\n\n1) **Order Book Depth** \n `GET /products/{product_id}/book?level=2` \u2192 top-of-book depth (aggregated):contentReference[oaicite:5]{index=5} \n - Use `level=1` for best bid/ask only (L1). \n - Use `level=2` for aggregated L2 (recommended over L3 via REST).\n\n2) **Recent Trades** \n `GET /products/{product_id}/trades` \u2192 latest trades (price, size, side, time):contentReference[oaicite:6]{index=6} \n\n3) **Aggregate Trades** \n **Not provided** as a REST endpoint on Coinbase. Use **Recent Trades** or simulate aggregation in workflow (optional). \n\n4) **Klines / Candles** \n `GET /products/{product_id}/candles?granularity=900` \u2192 OHLCV arrays:contentReference[oaicite:7]{index=7} \n - Supported `granularity` (seconds): **60, 300, 900, 3600, 21600, 86400** (1m, 5m, 15m, 1h, 6h, 1d).\n\n5) **Current Average Price** \n **Not provided** as a REST endpoint. Optionally derive from midpoint of `/book?level=1` ( (bid+ask)/2 ) in your Calculator node.\n\n6) **24h Ticker Price Change Statistics** \n `GET /products/{product_id}/stats` \u2192 24h open, high, low, last, volume:contentReference[oaicite:8]{index=8} \n\n7) **Latest Symbol Price** \n `GET /products/{product_id}/ticker` \u2192 last price, best bid/ask, volume:contentReference[oaicite:9]{index=9} \n\n8) **Order Book Best Bid/Ask** \n `GET /products/{product_id}/book?level=1` \u2192 best bid/ask only (L1):contentReference[oaicite:10]{index=10} \n\n---\n\n## \ud83e\udde9 Utility Tools\n- **Calculator** \u2192 simple math (e.g., spread, pct change, midpoint). \n- **Think** \u2192 reshape JSON, pick fields, and prepare the Telegram HTML.\n\n---\n\n## \ud83d\udce4 Output Format (Telegram HTML)\n\nStart with:\n```html\n<b>{{PRODUCT_ID}} \u2014 Coinbase Spot Data</b>\n````\n\nThen group:\n\n```html\n<b>Price</b>\n\u2022 Last: {{lastPrice}}\n\u2022 Mid (derived): {{midPrice}} <!-- optional: (best_bid+best_ask)/2 -->\n\u2022 Change (24h): {{pctChange}}%\n\n<b>24h Stats</b>\n\u2022 Open: {{open}} \u2022 High: {{high}} \u2022 Low: {{low}} \u2022 Last: {{last}}\n\u2022 Volume: {{baseVol}}\n\n<b>Order Book (Top 5)</b>\n\u2022 Bids: [price x size] \u2026\n\u2022 Asks: [price x size] \u2026\n\n<b>Candles (latest N)</b>\n\u2022 Interval: {{interval}} (O/H/L/C per candle)\n```\n\n---\n\n## \u26a0\ufe0f Rules\n\n* Always **call the correct Coinbase endpoint** for the requested data.\n* Do **not** fabricate or compute indicators; only basic formatting/derivations (e.g., midpoint) are allowed.\n* Do **not** provide advice, sentiment, or predictions.\n* Do **not** dump raw JSON; present clean, human-readable values.\n* If a request fails or a field is missing, show `N/A` and continue with available data.\n\n---\n\n## \ud83d\udd27 n8n parameter bindings (suggested)\n\nFor each HTTP Request node:\n\n* `product_id` \u2192 `={{ /*n8n-auto-generated-fromAI*/ $fromAI('product_id', 'BTC-USD', 'string') }}`\n* `granularity` \u2192 `={{ $fromAI('granularity', 900, 'number') }}` <!-- 15m default -->\n* `limit` (if you add pagination elsewhere) \u2192 `={{ $fromAI('limit', 100, 'number') }}`\n\nExample URL for **Ticker**:\n\n```\nhttps://api.exchange.coinbase.com/products/={{$fromAI('product_id','BTC-USD','string')}}/ticker\n```\n\n```\n\n"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "52aee742-d806-4d15-82fe-4a6eba03deed",
"name": "24h Stats1",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
-704,
592
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `BTC-USD`, 'string') }}",
"options": {},
"toolDescription": "### \ud83c\udff7 Tool: **24h Stats**\n\n**Endpoint:** `GET /products/{product_id}/stats`\n**What it does:** 24-hour rolling window stats: **open/high/low/last**, **volume**.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n\n**Returns (FULL):** open, high, low, last, volume (24h).\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\n```\n\nhttps://api.exchange.coinbase.com/products/{{$fromAI('product_id','BTC-USD','string')}}/stats"
},
"typeVersion": 4.2
},
{
"id": "fce2f2ac-c799-4c6c-8402-8ff6f49e6a0d",
"name": "Order Book Depth1",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
-400,
592
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `BTC-USD`, 'string') }}",
"options": {},
"toolDescription": "### \ud83c\udff7 Tool: **Order Book Depth**\n\n**Endpoint:** `GET /products/{product_id}/book?level=2`\n**What it does:** Returns the **order book** for a product. Use `level=1` for best bid/ask (L1) or `level=2` for aggregated depth (L2).\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format `BASE-QUOTE` (e.g., BTC-USD)\n* `level` (INT, optional) \u2192 `1` (top of book) or `2` (aggregated depth). Default: `2`.\n\n**Returns (L2):** `bids: [[price, size], ...]`, `asks: [[price, size], ...]` plus metadata.\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlevel = $fromAI('level', 2, 'number')\n```\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/book"
},
"typeVersion": 4.2
},
{
"id": "84fd5218-005b-44eb-b4bf-c307267a29f1",
"name": "Price (Latest)1",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
-112,
592
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `BTC-USD`, 'string') }}",
"options": {},
"toolDescription": "### \ud83c\udff7 Tool: **Price (Latest)**\n\n**Endpoint:** `GET /products/{product_id}/ticker`\n**What it does:** Returns the **latest trade price** plus best bid/ask and volume for a product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n\n**Returns:** `{ \"trade_id\": ..., \"price\": \"...\", \"size\": \"...\", \"bid\": \"...\", \"ask\": \"...\", \"volume\": \"...\", \"time\": \"...\" }`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\n```\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/ticker"
},
"typeVersion": 4.2
},
{
"id": "89182a5b-03c0-453e-b0d9-974ec3e7edda",
"name": "Best Bid/Ask1",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
208,
592
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `BTC-USD`, 'string') }}",
"options": {},
"toolDescription": "### \ud83c\udff7 Tool: **Best Bid/Ask (Book Ticker)**\n\n**Endpoint:** `GET /products/{product_id}/book?level=1`\n**What it does:** Returns the best **bid/ask** with sizes for the product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `level` (INT, fixed = 1)\n\n**Returns:** `{ \"bids\": [[price, size]], \"asks\": [[price, size]], \"sequence\": ... }`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlevel = 1\n```\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/book"
},
"typeVersion": 4.2
},
{
"id": "33a2447c-1026-40ff-bdf0-b18a4c1a1ee2",
"name": "Klines (Candles)1",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
528,
592
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `BTC-USD`, 'string') }}",
"options": {},
"toolDescription": "### \ud83c\udff7 Tool: **Klines (Candles)**\n\n**Endpoint:** `GET /products/{product_id}/candles`\n**What it does:** Candlestick (OHLCV) data for a product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `granularity` (INT, required) \u2192 supported: 60, 300, 900, 3600, 21600, 86400 (1m, 5m, 15m, 1h, 6h, 1d)\n* `start`, `end` (ISO8601, optional)\n\n**Returns (array per candle):** `[ time, low, high, open, close, volume ]`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\ngranularity = $fromAI('granularity', 900, 'number') # 900 = 15m default\n```\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/candles"
},
"typeVersion": 4.2
},
{
"id": "a1b19454-5272-4122-a1be-95eff5923847",
"name": "Average Price (Derived)",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
880,
592
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `BTC-USD`, 'string') }}",
"options": {},
"toolDescription": "### \ud83c\udff7 Tool: **Average Price (Derived)**\n\n**Endpoint:** `GET /products/{product_id}/book?level=1`\n**What it does:** Coinbase does not provide a direct average price endpoint. This tool fetches the **best bid/ask** and you can derive a midpoint average `(bid + ask)/2`.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `level` (INT, fixed = 1)\n\n**Returns:** `{ \"bids\": [[price, size]], \"asks\": [[price, size]] }`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlevel = 1\n```\n\n**Notes:** Use Calculator node to compute midpoint from bid/ask.\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/book"
},
"typeVersion": 4.2
},
{
"id": "9c5657f8-1c31-46f3-8146-93f36fa25e49",
"name": "Recent Trades1",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1200,
592
],
"parameters": {
"url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `BTC-USD`, 'string') }}",
"options": {},
"toolDescription": "### \ud83c\udff7 Tool: **Recent Trades**\n\n**Endpoint:** `GET /products/{product_id}/trades`\n**What it does:** Returns the **most recent trades** for a Coinbase product.\n**Params:**\n\n* `product_id` (STRING, required) \u2192 format: `BASE-QUOTE` (e.g., BTC-USD)\n* `limit` (INT, optional) \u2192 number of trades to return (defaults ~100)\n\n**Returns (array):** `[ { \"time\": \"...\", \"trade_id\": 123, \"price\": \"...\", \"size\": \"...\", \"side\": \"buy|sell\" }, ... ]`\n\n**n8n query mapping:**\n\n```txt\nproduct_id = $fromAI('product_id', 'BTC-USD', 'string')\nlimit = $fromAI('limit', 100, 'number')\n```\n\n**Notes:** Endpoint supports pagination via `before` / `after` cursors if you later need historical pages.\n\nhttps://api.exchange.coinbase.com/products/{{ $fromAI('product_id','BTC-USD','string') }}/trades"
},
"typeVersion": 4.2
},
{
"id": "4e47f927-47c3-4f73-a790-4d44606ce7a5",
"name": "Sticky Note17",
"type": "n8n-nodes-base.stickyNote",
"position": [
2128,
-496
],
"parameters": {
"width": 1664,
"height": 2016,
"content": "# \ud83e\udde0 Coinbase Spot Market Quant AI Agent \u2013 Full System Documentation\n\nA professional-grade AI automation system for **spot market trading insights** on **Coinbase**. \nIt analyzes **price data**, **order book depth**, **candlestick (OHLCV) data**, and **trade history**, then delivers structured outputs for trading decisions.\n\n---\n\n## \ud83e\udde9 Included Workflows\n\nYou must install and activate **all of the following workflows** for the system to function correctly:\n\n| \u2705 Workflow Name | \ud83d\udccc Function Description |\n| --------------------------- | -------------------------------------------------------------------------------- |\n| Coinbase AI Agent | Final AI orchestrator. Parses user prompts and generates structured outputs. |\n| Coinbase Price Tool | Returns the latest trade price for any symbol. |\n| Coinbase Order Book Tool | Returns live order book depth (bids/asks up to configured limit). |\n| Coinbase Candles Tool | Pulls candlestick OHLCV data across multiple intervals (AI chooses timeframe). |\n| Coinbase Trades Tool | Returns most recent trade history for a symbol. |\n\n---\n\n## \u2699\ufe0f Installation Instructions\n\n### Step 1: Import Workflows\n* Open your **n8n Editor UI** \n* Import each workflow JSON file one by one \n* Activate them or ensure they're called via `Execute Workflow` \n\n### Step 2: Set Credentials\n* **OpenAI API Credential** \u2192 Required (for agent reasoning & orchestration) \n* **Coinbase Price Data** \u2192 Public endpoints (no authentication required) \n\n### Step 3: Configure Webhooks (if applicable)\n* Ensure your webhook endpoints are deployed and accessible if you integrate with external bots or dashboards \n\n### Step 4: Optional Integrations\n* Telegram, Discord, or Slack can be connected for message delivery \n* Update recipient IDs or channels inside n8n nodes if required \n\n---\n\n## \ud83d\udda5\ufe0f System Workflow Overview\n\n```\n\n\\[User Prompt / Trigger]\n\u2192 \\[Coinbase AI Agent Orchestrator]\n\u2192 \\[Price Tool]\n\u2192 \\[Order Book Tool]\n\u2192 \\[Candles Tool]\n\u2192 \\[Trades Tool]\n\u2192 \\[Reasoning + Signal Formatting]\n\u2192 \\[Final Output to Messaging/Report]\n\n````\n\n---\n\n## \ud83d\udcca Example Output\n\n```html\n<b>COIN-USD Market Report</b>\n\n<b>Spot Strategy</b> \n\u2022 Action: Buy \n\u2022 Entry: $245.30 | SL: $240.00 | TP: $252.00 \n\u2022 Reason: \n\u2003- Strong bid support at $245 \n\u2003- RSI Rebound on 1h Candles \n\u2003- Trade history shows accumulation \n\n<b>Leverage Strategy</b> \n\u2022 Position: Long 3x \n\u2022 Entry: $245.30 \n\u2022 SL/TP zones same as above \n\n<b>Market Sentiment:</b> Neutral-Bullish \n\u2022 Recent trades show buyers dominating order flow \n````\n\n---\n\n## \ud83d\ude80 Support & Licensing\n\n\ud83d\udd17 **Don Jayamaha \u2013 LinkedIn**\n[linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n\u00a9 2025 Treasurium Capital Limited Company.\nAll rights reserved. This system architecture, prompts, and workflow structure are proprietary and protected by **U.S. copyright law**.\nReuse or resale prohibited without license.\n"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "6d33dd3b-6ec0-4fca-86cd-0387726696d9",
"connections": {
"Think": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"24h Stats1": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Best Bid/Ask1": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Recent Trades1": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Price (Latest)1": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Adds \"SessionId\"": {
"main": [
[
{
"node": "Coinbase AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "User Authentication (Replace Telegram ID)",
"type": "main",
"index": 0
}
]
]
},
"Klines (Candles)1": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Order Book Depth1": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Coinbase AI Agent": {
"main": [
[
{
"node": "Splits message is more than 4000 characters",
"type": "main",
"index": 0
}
]
]
},
"Average Price (Derived)": {
"ai_tool": [
[
{
"node": "Coinbase AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"User Authentication (Replace Telegram ID)": {
"main": [
[
{
"node": "Adds \"SessionId\"",
"type": "main",
"index": 0
}
]
]
},
"Splits message is more than 4000 characters": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
openAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Coinbase AI Agent instantly fetches real-time market data directly in Telegram!
Source: https://n8n.io/workflows/8606/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Jarvis is a powerful multi-agent productivity assistant built in n8n. It works directly from Telegram and can understand both text messages and voice notes.
This multi-agent n8n workflow delivers an automated, intelligent trading analysis system for the WEEX Spot Market. It uses GPT-4o to interpret user prompts, route them to the correct sub-agent tools,
AI-powered Telegram bot for effortless expense tracking. Send receipts, voice messages, or text - the bot automatically extracts and categorizes your expenses. 📸 Receipt & Invoice OCR - Send photos of
This template is designed for anyone who wants to use Telegram as a personal AI assistant hub. If you often juggle tasks, emails, calendars, and expenses across multiple tools, this workflow consolida
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.