Skip to content
FlowHubFluxonLab
B
AI Automationfree

Answer legal questions with Groq using CanLII and CourtListener

by Kevin Yuadapted from n8n official workflow galleryUpdated Aug 2026
RequiresBBasic LLM ChainCCodeGroq Chat ModelGroq Chat ModelHTTP RequestHTTP RequestStructured Output ParserStructured Output Parser
Share Post Share
FoSubmit a legal questionSubmit a legal …SeSet research configurationSet research co…SwRoute by source databaseRoute by source…HRSearch CourtListener case lawSearch CourtLis…HRFetch CourtListener opinion textFetch CourtList…HRFetch CanLII case metadataFetch CanLII ca…HRFetch CanLII citator casesFetch CanLII ci…CoBuild grounding contextBuild grounding…CoBuild error resultBuild error res…Groq Chat ModelCitation parser fixer modelCitation parser…OPStructured citation parserStructured cita…CLAnswer grounded in retrieved sourcesAnswer grounded…CoVerify citations and render resultVerify citation…FoReturn result12345678910111213141516171819
1/5
STEPS · 19
Starts on an incoming request

Quick overview This workflow collects a legal question via an n8n form, retrieves supporting authorities from CourtListener or CanLII, and uses a Groq-hosted Llama model to produce an answer grounded only in the retrieved text with verified, non-hallucinated citations. How it works Receives a legal question through an n8n form and captures the selected source database (CourtListener or CanLII) plus optional CanLII database and case IDs. Routes the request to CourtListener full-text search or to CanLII case metadata and citator endpoints based on the selected database. For CourtListener, pulls the top search results and fetches the full text of the top-ranked opinion; for CanLII, loads the selected case and a list of related cases from the CanLII citator. Normalizes the retrieved items into a single numbered “sources” block with excerpts that the model can cite. Sends the question and sources to a Groq Chat Model (Llama 3.3 70B) and parses the response into a structured format containing an answer, a supported flag, and a list of citations.

Tags

n8nreference-onlychain-llmlm-chat-groqoutput-parser-structured
Connects
BBasic LLM ChainCCodegroqchatmodelGroq Chat ModelWHTTP RequeststructuredoutputparserStructured Output Parser
CategoryAI Automation
Triggermanual
Complexitycomplex
Nodes15
AddedJul 3, 2026

Related workflows

See all AI Automation
BCsheetsgroqchatmodel
free

Confirm and log WhatsApp restaurant orders with Groq and Google Sheets

Quick Overview This workflow triggers on incoming WhatsApp orders, uses Groq to extract items and quantities, validates them against a live Google Sheets menu, logs the result to an orders sheet, and replies to the customer with either a clarification request or a priced confirmation (with optional VIP owner alerts). How it works Triggers when a new WhatsApp message is received on your WhatsApp Business Cloud number. Sends the message text to Groq (Llama 3.3) to extract a structured list of ordered items and quantities. Reads the latest menu (item name, price, availability) from a Google Sheets “Menu” tab. Matches extracted items to the menu, checks availability, calculates line subtotals and the total price, and compiles any validation issues. If there are issues, replies to the customer on WhatsApp asking for a corrected order and appends a “needs_clarification” entry to the Google Sheets “Orders” tab. If the order is valid, appends a “confirmed” entry to the Google Sheets “Orders” tab and sends a WhatsApp confirmation with the item summary and total. If the confirmed total meets or exceeds the VIP threshold, sends a separate WhatsApp notification to the owner number. Setup Conne

by Kanishka Shrivastava
ACWopenaichatmodel
free

Manage Google and Trustpilot reviews with OpenAI and Slack

Quick overview This workflow runs hourly to fetch new Google Business Profile and Trustpilot reviews, deduplicates them, uses OpenAI via a LangChain agent to draft sentiment-aware replies, escalates negative reviews in Slack, and routes positive replies to Slack for approval before posting the reply back to Trustpilot. How it works Runs every hour on a schedule. Fetches the latest reviews from the Google Business Profile API and the Trustpilot API and combines the results. Deduplicates reviews by tracking previously seen review IDs in workflow static data and stops if there are no new reviews. Processes each new review and uses OpenAI (via a LangChain agent) to generate structured JSON containing sentiment, a draft reply, and an optional suggested resolution. Sends negative reviews to a Slack channel for the owner along with the suggested resolution. Sends positive draft replies to Slack for one-tap approval (with a 24-hour timeout) and, if approved, publishes the reply to the Trustpilot API. Sends a Slack alert to the ops channel if the workflow errors. Setup Configure authentication and replace placeholders for the Google Business Profile reviews endpoint (account and location) i

by Redowan Ahmed Farhan
autofixingoutputparserBopenaichatmodelstructuredoutputparser
free

Force AI to use a specific output format

This workflow is for anyone looking to automatically fetch, validate, and parse complex language-based queries into a structured format. Its unique capability lies in not only processing language but also fixing invalid outputs before structuring them. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team