Detect Stripe payment anomalies with Groq, Supabase, Slack, and Google Sheets
Quick overview This workflow runs hourly to read Stripe transaction logs from Google Sheets, normalize and load them into Supabase, then uses Groq (OpenAI-compatible chat completions) to detect anomalies and, when found, records incidents in Supabase and posts an alert to Slack while logging errors back to Google Sheets.
How it works Runs every hour on a schedule. Reads raw Stripe-like transaction rows from a Google Sheets worksheet and normalizes fields (for example converting cents to USD and parsing risk scores). Inserts the cleaned transactions into a Supabase table for analytics. Sends the inserted transaction data to Groq’s chat completions API with a prompt to return an anomaly result as strict JSON. Parses the Groq response into structured fields and checks whether an anomaly is flagged. If an anomaly is true, writes an incident record to a Supabase incident_logs table and posts an alert message to a Slack channel. If Supabase, Groq, or Slack steps error, appends an error entry (including node name, severity, and transaction_id) to an error_logs sheet in Google Sheets.
Setup Connect Google Sheets OAuth2 credentials and set the spreadsheet and worksheet IDs for the raw input sheet and the error_logs sheet. Connect Supabase credentials and ensure the analytics_data and incident_logs tables exist with columns matching the fields used (for example transaction_id, amount, risk_score, anomaly_type, severity, ai_label, and record_id). Add your Groq API key (or replace the Authorization header) and confirm the model name and endpoint URL are correct for your Groq account. Connect Slack OAuth2 credentials and select the target channel for anomaly alerts.
Related Templates
Send structured logs to BetterStack from any workflow using HTTP Request
Send structured logs to BetterStack from any workflow using HTTP Request Who is this for? This workflow is perfect for...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments