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.