Quick Overview
This workflow ingests chat messages via a webhook or a 15-minute schedule, filters out low-signal content, uses Anthropic Claude to extract entities and relationships, and stores the resulting knowledge graph in Neo4j while appending an audit log row to Google Sheets.
How it works
- Receives a chat message via an n8n webhook or runs every 15 minutes to process polled Slack data.
- Normalizes the incoming payload into consistent fields like channel, sender, timestamp, and message text.
- Uses a Python script to tag message signals (questions, decisions, action items) and filter out noise such as greetings, bots, and very short messages.
- Sends each relevant message to Anthropic Claude to extract entities, relationships, a summary, message type, and importance.
- Sends the extracted graph to Anthropic Claude again to add implicit relationships, weights, decision-chain metadata, and a thread category.
- Merges both AI passes into a single nodes-and-edges knowledge graph, validates references and edge weights, and drops invalid graphs.
- Upserts the graph into Neo4j via its transactional HTTP endpoint, appends an audit row to Google Sheets, and returns a JSON success response to the webhook caller.
Setup
- Add an Anthropic API credential and select the Claude model used by the two AI steps.
- Configure Neo4j access by replacing the Neo4j HTTP endpoint URL and setting up HTTP Basic Auth credentials for your Neo4j instance.
- Configure Google Sheets OAuth2 credentials and replace the placeholder Google Sheet ID, sheet tab name/range (KnowledgeGraph), and any required API permissions.
- If using the webhook ingest path, copy the production webhook URL from n8n and configure your Slack/app integration to POST message payloads to
/chat-ingest with the expected fields (text, channel, sender, timestamps).