Skip to main content

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

Workflow preview

Workflow preview
100%
Reply to LinkedIn leads with Aimfox, OpenAI GPT-4.1-mini, and Slack preview
Open on n8n.io

1. Workflow Overview

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 int...

Best for

  • Lead Nurturing automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.chainllm, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.aggregate, n8n-nodes-base.switch, n8n-nodes-base.wait

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by n8n Lab.

Original n8n.io source

1.1 Workflow description

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

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

  1. Receives a POST webhook from Aimfox when a prospect sends their first reply in a LinkedIn campaign.
  2. Extracts key event fields and fetches the full conversation thread from the Aimfox API.
  3. Reorders and aggregates the conversation messages into a single context string for the AI.
  4. Uses OpenAI to classify the latest prospect reply as INTERESTED, NOT_INTERESTED, or NEEDS_REVIEW.
  5. If INTERESTED, waits a random 3–15 minutes, then uses OpenAI to generate a concise, human-sounding LinkedIn reply using the full conversation context.
  6. 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.
  7. 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

  1. Create an Aimfox webhook that triggers on first reply and paste the n8n webhook URL into Aimfox.
  2. 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.
  3. Add an OpenAI API key and review both OpenAI prompts to match your business, offer, and tone.
  4. Add Slack credentials and select the channel where you want “sent”, “not interested”, and “needs review” notifications posted.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 2 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 3 - AI Message Router

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.9

Block 4 - AI Reply Agent

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.9

Block 5 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Preparing Aimfox Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Setting messages

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Formatting messages

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Aggregating messages

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 10 - Message Routing

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.4

Block 11 - Random number between 3 and 15

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Delay

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 13 - Send message through Aimfox

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 14 - Get a conversation through Aimfox

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 15 - Notify that the message was sent

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 16 - Notify that the lead is not interested

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 17 - Notify that human review is needed

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 18 - Splitting out messages

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 19 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Reply to LinkedIn leads with Aimfox, OpenAI GPT-4.1-mini, and Slack
Complexity advanced
Nodes 26
Categories Lead Nurturing, AI Chatbot
Author n8n Lab
Published 26 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15957/15957.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Reply to LinkedIn leads with Aimfox, OpenAI GPT-4.1-mini, and Slack do?

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 int...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Nurturing, AI Chatbot use case.