Assess Bitcoin AML risk with Groq and log results to Google Sheets

Go to Workflow
0 views
Built by Vamsi Krishna Gali Vamsi Krishna Gali
Created on September 09, 2026

Description

Quick overview
This workflow fetches recent unconfirmed Bitcoin transactions from Blockchain.com, applies rule-based AML risk scoring, generates a one-line analyst note using Groq’s LLM, and logs the results to Google Sheets.

How it works
Runs manually when you click Execute workflow.
Requests the latest unconfirmed transactions from blockchain.info and extracts key fields such as hash, amount (BTC), fee, outputs count, and a receiver address.
Detects possible structuring by counting how many transactions in the batch send to the same receiver address and flags addresses with 3+ occurrences.
Applies rule-based AML heuristics (amount thresholds, high fees, many outputs, dust amounts, and structuring flag) to assign a LOW/MEDIUM/HIGH risk level with reasons.
Limits processing to the first 10 scored transactions.
Sends each transaction and its rule-based risk signals to a Groq chat model to produce a single-line analyst explanation and suggested next action.
Appends the transaction details, risk level, and AI analysis as a new row in a Google Sheets spreadsheet.

Setup
Add a Groq API credential and select the model you want to use in the Groq chat model step.
Add a Google Sheets OAuth2 credential with access to the target spreadsheet.
Create (or update) a Google Sheet with columns for hash, total_btc, fee, num_outputs, risk_level, and ai_analysis, and set the correct Spreadsheet ID and sheet tab in the Google Sheets append step.
(Optional) Enable and adjust the risk filter so only non-LOW transactions are sent to the LLM and written to Google Sheets.

Nodes Used (5)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Google Sheets
n8n-nodes-base.googleSheets
Groq Chat Model
@n8n/n8n-nodes-langchain.lmChatGroq
HTTP Request
n8n-nodes-base.httpRequest