Scheduled Analysis: Building Post-Test Reports

Overview

This guide demonstrates how to build a webhook-triggered automation that eliminates manual data collation, providing instant post-test analysis the moment an experiment ends.

The workflow triggers when an Intelligems test ends, fetches the results, generates an AI-powered CRO analysis with strategic insights, and posts everything to a threaded Slack message where your team can discuss next steps.

triangle-exclamation

Softwares Used

To build this automated reporting pipeline, you will need the following tools:

  • n8narrow-up-right: The primary workflow automation platform used to connect APIs and schedule tasks.

  • Groqarrow-up-right: A high-speed AI inference engine used to process test data and generate natural language reports.

    • Note: You can swap this for OpenAI or Anthropic if preferred, but this guide uses Groq for its free API tier.

  • Slackarrow-up-right: The final destination where the AI-generated health checks and reports will be posted.

How to Create Your Final Test Results & Learning Report:

Step 1: Get Your API Keys

Groq API Key (Or your AI of Choice)

  • Sign up for free (no credit card needed)

  • Click "API Keys" on the top nav

  • Click "Create API Key"

  • Name the key & press submit

  • Copy and save the key (starts with gsk_)

Intelligems API Key(s)

To request access and receive your API key, contact our support teamarrow-up-right.

Step 2: Create the Workflow in n8n

Node 1: Schedule Trigger

  1. Click the "+" button to add a node

  2. Search for "On webhook Call"

  3. Set the "HTTP Method" to "POST"

  4. Grab the Production URL

  5. Back In Intelligems > Settings > Webhooks, create a webhook with the n8n production URL where the action type is "end experience". If an agency, do this for all your client accounts.

Node 2: Return API Key to Use Based Upon Organization ID

  1. Add "Code" node

  2. Select "Code in JavaScript"

  3. Select "Run Once for All Items"

  4. Update the below code so that org-id maps to match the Intelligems organization IDs of your clients (you can find these in Intelligems under Settings > General > Organization Settings), the name value is display name for your clients, and the api-key value is the Intelligems API Key for those clients. Then paste this code into the Code section in n8n.

Node 3: Get Test Analytics Data

  1. Add "HTTP Request" node

  2. Configure:

    • Method: GET

    • URL: https://api.intelligems.io/v25-10-beta/analytics/resource/{{ $json.experienceId }}

    • Authentication: None

    • Enable Send Headers

      • Name: intelligems-access-token

      • Value: {{ $json.apiKey }}

Node 4: Send to AI Agent

  1. Click the "+" button after your analytics HTTP Request node

  2. Search for "AI Agent" or look under "AI Nodes"

  3. Click "AI Agent"

Configure the AI Agent:

  1. Under "Chat Model" section:

    • Click "Select model"

    • Choose "Groq" from the list (Or swap in your AI of choice)

    • Click "Create New Credential"

    • Paste your Groq API key (the one starting with gsk_)

    • Select Model: "llama-3.3-70b-versatile" (best free model) or "mixtral-8x7b-32768"

  2. Back under the main AI Agent Screen:

    • Under "Source for Prompt" set it to Define below

    • Under "Prompt" section:

      • In the text area, paste the below prompt. You can customize this prompt to meet your specific needs.

Node 5: Send to Slack (Notification)

  1. Add "Slack" node where the action is "Send a message"

  2. Authentication:

    • Click "Create New Credential"

    • Click "Connect my account" and follow the prompts

  3. Channel/Use:

    • Under "Send Message To" configure where you want this slack message to appear

  4. Message:

    • in "Message Text" input:

Node 6: Send to Slack (Report)

  1. Add "Slack" node where the action is "Send a message"

  2. Set the same channel as your 8th Node.

  3. In "Message Text" input:

  1. Under Options, add a "Reply to a message" option.

  2. For "Message Timestamp to Reply To" input {{ $json.message_timestamp }}

Step 3: Activate the Workflow

  1. Once everything works, click "publish" at the top to make this workflow go live!

  2. Your workflow will listen for tests that end in Intelligems, analyze them, and give you a notification in slack with the analysis!

Last updated