# Answer legal questions with Groq and CanLII: n8n workflow

> Started by someone submitting a form. It calls services over plain HTTP rather than through connectors. It hands the judgement calls to Groq.

Source: https://millionrounds.com/workflow/answer-legal-questions-with-groq-and-canlii (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Customer support](https://millionrounds.com/workflows?category=Customer+support#library)

# Answer legal questions with Groq and CanLII

Started by someone submitting a form. It calls services over plain HTTP rather than through connectors. It hands the judgement calls to Groq. 15 steps, 1 branch: a working afternoon to understand properly.

Medium Calls a model: Groq

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanswer-legal-questions-with-groq-and-canlii)

**15 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**0** Loops or waits

**0** Services by connector: it calls them over plain HTTP

## The flow

Starts it 1 Model 4 Logic 5 Service 5

The steps in the order they run, from what starts it.

- 1 **Submit a legal question** Form trigger *Starts it*
- 2 **Groq Chat Model** Lm Chat Groq *Model*
- 3 **Citation parser fixer model** Lm Chat Groq *Model*
- 4 **Set research configuration** Set *Logic*
- 5 **Answer grounded in retrieved sources** Chain Llm *Model*
- 6 **Structured citation parser** Output Parser Structured *Model*
- 7 **Route by source database** Switch *Logic*
- 8 **Verify citations and render result** Code *Logic*
- 9 **Search CourtListener case law** Http Request *Service*
- 10 **Fetch CanLII case metadata** Http Request *Service*
- 11 **Return result** Form *Service*
- 12 **Fetch CourtListener opinion text** Http Request *Service*
- 13 **Build error result** Code *Logic*
- 14 **Fetch CanLII citator cases** Http Request *Service*
- 15 **Build grounding context** Code *Logic*

## How it's built

- **Starts on:** Someone submitting a form
- **Steps:** 15, with 1 branch
- **Size:** Medium: a working afternoon
- **Connects to:** Nothing by connector; it calls services over plain HTTP
- **Model:** Groq

## Questions

What does it need to run?

An n8n account, and a key for Groq. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone submitting a form.

Does it use AI?

Yes. It calls Groq. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 15 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 15 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanswer-legal-questions-with-groq-and-canlii)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Workflows like it

Also customer support, with the same services where possible, closest in size first.

- [**Answer Slack knowledge base questions with Notion and Pinecone** 15 steps · calls a model · Notion, Pinecone](https://millionrounds.com/workflow/answer-slack-knowledge-base-questions-with-notion-and-pineco)
- [**Answer customer questions on WhatsApp with OpenAI and Gmail** 15 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/answer-customer-questions-on-whatsapp-with-openai-and-gmail)
- [**Answer document questions with OpenAI and Pinecone** 15 steps · calls a model · Google Drive, Pinecone](https://millionrounds.com/workflow/answer-document-questions-with-openai-and-pinecone)
- [**Automate IT support with Telegram and Whisper** 15 steps · calls a model · Google Drive, Jira](https://millionrounds.com/workflow/automate-it-support-with-telegram-and-whisper)
- [**Automate customer support with Gmail and Google Sheets** 15 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/automate-customer-support-with-gmail-and-google-sheets)
- [**Classify and route DevOps support messages with Slack** 15 steps · calls a model · Qdrant, Slack](https://millionrounds.com/workflow/classify-and-route-devops-support-messages-with-slack)
