n8n Integration
View as MarkdownConnect PostGrad to your n8n workflows using HTTP Request nodes.
This integration works today using the REST API. No SDK required.
Overview
n8n can connect to PostGrad using the built-in HTTP Request node. This lets you build workflows that search knowledge, react to new entries, and pipe business insights into other tools.
Step 1: Store Your API Key
Before building workflows, store your PostGrad API key as an n8n credential:
- Go to Settings > Credentials > Add Credential
- Choose Header Auth
- Set:
- Name:
PostGrad API - Header Name:
Authorization - Header Value:
Bearer pg_live_YOUR_API_KEY
- Name:
Step 2: Search Knowledge
Add an HTTP Request node to your workflow:
- Method:
GET - URL:
https://postgrad.io/api/v1/knowledge/search - Authentication: Header Auth (select your PostGrad credential)
- Query Parameters:
q:{{ $json.searchQuery }}(or a static string)limit:10
The response body contains:
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "AI agent architecture uses RAG with vector embeddings",
"category": "ai_architecture",
"content": "The AI agent architecture uses retrieval-augmented generation...",
"tags": ["rag", "vector-embeddings"],
"confidence": 0.85,
"reinforcement_count": 3
}
],
"pagination": { "total": 42, "limit": 10, "offset": 0, "has_more": true }
}Step 3: List Categories
Add an HTTP Request node:
- Method:
GET - URL:
https://postgrad.io/api/v1/knowledge/categories - Authentication: Header Auth (PostGrad credential)
No query parameters needed. Returns all categories with entry counts.
Step 4: Get Usage Stats
Monitor your API consumption within workflows:
- Method:
GET - URL:
https://postgrad.io/api/v1/usage - Authentication: Header Auth (PostGrad credential)
Example: Daily Knowledge Digest
Build a workflow that sends a daily Slack summary of new knowledge:
- Schedule Trigger -- Run daily at 9:00 AM
- HTTP Request --
GET /api/v1/knowledge?limit=5&sort=created_at:descwith PostGrad auth - Code Node -- Format entries into a Slack message:
const entries = $input.all().map(item => item.json);
const lines = entries.map(e =>
`*${e.title}* (${e.category}, confidence: ${e.confidence})\n${e.content.substring(0, 200)}...`
);
return [{
json: {
text: `*PostGrad Daily Digest*\n\n${lines.join('\n\n')}`
}
}];- Slack Node -- Send message to your team channel
Example: Knowledge-Enriched Lead Scoring
Combine PostGrad insights with CRM data:
- Webhook Trigger -- Receive new lead from CRM
- HTTP Request -- Search PostGrad for insights about the lead's industry:
GET /api/v1/knowledge/search?q={{ $json.industry }}&categories=deal_evaluation,sales_process
- Code Node -- Score the lead based on available knowledge
- HTTP Request -- Update lead score in CRM
Tips
- Use the
limitparameter to control response size and stay within your monthly quota - Chain multiple HTTP Request nodes to search different categories
- Use n8n's IF node to branch logic based on confidence scores
- Set up error handling with the Error Trigger node for API failures