Reply to LinkedIn leads with Aimfox, OpenAI GPT-4.1-mini, and Slack

Go to Workflow
0 views
Built by n8n Lab n8n Lab
Created on June 10, 2026

Description

Quick overview
This workflow receives first-reply LinkedIn webhook events from Aimfox, fetches the full conversation for context, uses OpenAI to classify lead intent and draft a short reply for interested leads, sends the reply back via Aimfox, and posts outcome notifications to Slack.

How it works
Receives a POST webhook from Aimfox when a prospect sends their first reply in a LinkedIn campaign.
Extracts key event fields and fetches the full conversation thread from the Aimfox API.
Reorders and aggregates the conversation messages into a single context string for the AI.
Uses OpenAI to classify the latest prospect reply as INTERESTED, NOT_INTERESTED, or NEEDS_REVIEW.
If INTERESTED, waits a random 3–15 minutes, then uses OpenAI to generate a concise, human-sounding LinkedIn reply using the full conversation context.
Sends the generated reply to the prospect through the Aimfox API and posts a confirmation to a Slack channel with the message and LinkedIn profile link.
If NOT_INTERESTED or NEEDS_REVIEW, posts the prospect’s reply to Slack so the team can close out or handle the conversation manually.

Setup
Create an Aimfox webhook that triggers on first reply and paste the n8n webhook URL into Aimfox.
Add an Aimfox API credential (HTTP Header Auth) and confirm the account/recipient ID and conversation URN fields in the Aimfox API request URLs match your Aimfox payload.
Add an OpenAI API key and review both OpenAI prompts to match your business, offer, and tone.
Add Slack credentials and select the channel where you want “sent”, “not interested”, and “needs review” notifications posted.

Nodes Used (5)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Slack
n8n-nodes-base.slack