[Free Module] Use Groq AI to filter spam emails and form submissions!

In this example, we are using Groq AI (free), to parse content and determine whether it is spam.

Example Output

Module Export

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.

  3. Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.

Click to Expand Module Export Code

JSON - Copy and Paste this directly in the scenario editor

{
  "subflows": [
    {
      "flow": [
        {
          "id": 1,
          "module": "groq:createJSONChatCompletion",
          "version": 1,
          "mapper": {
            "model": "llama-3.1-70b-versatile",
            "systemPrompt": "Classify the provided email as spam or not spam. Consider factors such as language, grammar, urgency, suspicious links, and requested actions. Provide a confidence score and a concise reason for the classification.\n\nThe JSON should look like this:\n\n{\n  \"is_spam\": true,\n  \"confidence_score\": 0.98,\n  \"reason\": \"The content contains a suspicious link and keywords not typically found in a form submission.\",\n  \"suspicious_keywords\": [ \"p0rn\", \"pu$y\", \"loli\", \"sex\", \"weight loss\", \"casino\", \"gamble\", \"seo\" ],\n  \"suspicious_links\": [ \"https://bit.ly/example\" ]\n}",
            "userMessage": "",
            "temperature": "0.15"
          },
          "metadata": {
            "designer": {
              "x": 0,
              "y": 0,
              "name": "AI Spam Filter"
            }
          }
        }
      ]
    }
  ],
  "metadata": {
    "version": 1
  }
}

Where to get a free Groq AI API key

  1. Go to https://console.groq.com/keys

  2. Register for a free account

  3. Click on “Create API Key”

— @samliew

5 Likes
Getting started into make
How to use AI to analyze salesforce case, then fill the lookup relationship field on the Case?
YouTube search automation: how to avoid duplicates and get a limited number of videos
Expert advice required and ideally contact
From iterare to pdfmonkey
Error Handling BAD combo: Sequential Processing + Incomplete Executions
Using Make
How to get a spreadsheet ID from a file I'm uploading in the same scenario?
Web Archive
How to merge results from multiple YouTube search iterations into one array?
Adding an item to a Pipedrive array without overwriting the original values
More operations then expected in HTML extraction
Recipe Card Automation
How to create a full Webflow CMS RSS feed using Make.com?
Use Custom GPTs (Team account) to create outlook drafts
SUM values of Make modules (Increment and variable)
Telegram bot watch update module missing?
New to Make and Social Media Automation
How to Connect Acuity "New Appointments" Contact details to Google Contacts?
How to fetch text from a bundle
How to loop over an array and generate HTML with native functions?
How to combine 2 scenarios?
Etsy - Gmail - Dropshipping Order Fulfillment Automation
Automated Follow-Up Emails After No Reply
Filter bundles based on the presence of a value in an array of objects
Working with dates inside an array
Data Enrichment - Make.com Automation Scenario
Can OpenAI in Make actually read PDFs directly (via file upload)?
Google Calendar Set current week date
Help with a Json Scenario
Meta integration with Clickup
Guided product creation assistant
Google Workspace Admin module configuration
:house_with_garden: Make Community Roundup: July 2024 [CR]
Integration of Planyo with Lexware
I want to append page content into a database page from another database page content
Problem Capturing the First line from Facebook Post
How can I continue the execution of a router when the output of the first module is empty?

2025 Update

Hello everyone who has been using this module, and for those who want to test this module out:

Since my last post above in 2024, Groq has deprecated the ilama-3.1-70b-versatile model, and also the example words in the prompt used above may trip Groq’s “unsafe” filters. Hence, an update to this module is due.

Here’s a screenshot of the new settings with the latest model, improved prompt:

Get the module below —

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":2,"module":"groq:createJSONChatCompletion","version":1,"parameters":{"__IMTCONN__":1},"mapper":{"model":"llama-3.3-70b-versatile","systemPrompt":"Analyse the provided content. Consider factors such as language, grammar, urgency, suspicious links, and requested actions. Provide a score ranging from 0.00 for legitimate to 1.00 for definitely spam, and a concise reason for the classification. If the content is not in English, then provide a translation.\n\nIf the content is similar to \"hello I want to know your price\" and has a link from a link shortener or suspicious TLDs (like .ru), then it is likely spam.\n\nYour response must strictly follow the following example JSON object format and property types. Never wrap the JSON output with codefences, markup, or explanations.\n\n{\n  \"is_spam\": true,\n  \"score\": 0.74,\n  \"reason\": \"The content contains a suspicious link and keywords.\",\n  \"suspicious_keywords\": [ \"click\" ],\n  \"suspicious_links\": [ \"https://bit.ly/example\" ],\n  \"translation\": null\n}","userMessage":"{{join(map(toArray(1.data); \"value\"); newline)}}","temperature":"0.10"},"metadata":{"designer":{"x":300,"y":600,"name":"AI Spam Filter"},"parameters":[{"name":"__IMTCONN__","type":"account:groq","label":"Connection","required":true}]}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope you continue to find this module useful!

— @samliew

2 Likes