Generate n8n workflow JSON template with Kafka trigger/producer nodes. Creates event-driven workflow patterns (fan-out, retry+DLQ, enrichment, CDC).
Generate n8n workflow JSON templates with Kafka integration patterns. Create ready-to-use event-driven workflows (enrichment, fan-out, retry+DLQ, CDC) with configuration for topics, brokers, and error handling.
/plugin marketplace add anton-abyzov/specweave/plugin install sw-n8n@specweaveCreate ready-to-use n8n workflow JSON files with Kafka integration patterns.
Use Case: Event enrichment with external API
Workflow:
[Kafka Trigger] → [HTTP Request] → [Set/Transform] → [Kafka Producer]
↓ ↓ ↓
Input topic Enrich data Output topic
Configuration:
orders)https://api.example.com/customers/{id})enriched-orders)Use Case: Single event triggers multiple downstream topics
Workflow:
[Kafka Trigger] → [Switch] → [Kafka Producer] (high-priority)
↓ ↓
Input └─→ [Kafka Producer] (all-events)
└─→ [Kafka Producer] (analytics)
Use Case: Fault-tolerant processing with retry logic
Workflow:
[Kafka Trigger] → [Try] → [Process] → [Kafka Producer] (success)
↓ ↓
Input [Catch] → [Increment Retry Count]
↓
retry < 3 ?
↓
[Kafka Producer] (retry-topic)
↓
[Kafka Producer] (dlq-topic)
Use Case: Database polling → Kafka events
Workflow:
[Cron: Every 1m] → [PostgreSQL Query] → [Compare] → [Kafka Producer]
↓ ↓
Get new rows Detect changes
↓
Publish CDC events
# Generate workflow template
/sw-n8n:workflow-template
# I'll ask:
# 1. Which pattern? (Enrichment, Fan-Out, Retry+DLQ, CDC)
# 2. Input topic name?
# 3. Output topic(s)?
# 4. Kafka broker (default: localhost:9092)?
# 5. Consumer group name?
# Then I'll generate:
# - workflow.json (importable into n8n)
# - README.md with setup instructions
# - .env.example with required variables
1. workflow.json: n8n workflow definition
{
"name": "Kafka Event Enrichment",
"nodes": [
{
"type": "n8n-nodes-base.kafkaTrigger",
"name": "Kafka Trigger",
"parameters": {
"topic": "orders",
"groupId": "order-processor",
"brokers": "localhost:9092"
}
},
{
"type": "n8n-nodes-base.httpRequest",
"name": "Enrich Customer Data",
"parameters": {
"url": "https://api.example.com/customers/={{$json.customerId}}",
"authentication": "genericCredentialType"
}
},
{
"type": "n8n-nodes-base.set",
"name": "Transform",
"parameters": {
"values": {
"orderId": "={{$json.order.id}}",
"customerName": "={{$json.customer.name}}"
}
}
},
{
"type": "n8n-nodes-base.kafka",
"name": "Kafka Producer",
"parameters": {
"topic": "enriched-orders",
"brokers": "localhost:9092"
}
}
],
"connections": { ... }
}
2. README.md: Import instructions
# Import Workflow into n8n
1. Open n8n UI (http://localhost:5678)
2. Click "Workflows" → "Import from File"
3. Select workflow.json
4. Configure credentials (Kafka, HTTP API)
5. Activate workflow
6. Test with sample event
3. .env.example: Required environment variables
KAFKA_BROKERS=localhost:9092
KAFKA_SASL_USERNAME=your-username
KAFKA_SASL_PASSWORD=your-password
API_ENDPOINT=https://api.example.com
API_TOKEN=your-api-token
Via UI:
Via CLI:
# Import workflow
n8n import:workflow --input=workflow.json
# List workflows
n8n list:workflow
broker1:9092,broker2:9092)earliest (replay) or latest (new messages only)true (recommended) or false (manual)Manual Test:
# 1. Produce test event
echo '{"orderId": 123, "customerId": 456}' | \
kcat -P -b localhost:9092 -t orders
# 2. Check n8n execution log
# n8n UI → Executions → View latest run
# 3. Consume output
kcat -C -b localhost:9092 -t enriched-orders
Automated Test:
# Execute workflow via CLI
n8n execute workflow --file workflow.json \
--input test-data.json
# Expected output: success status
Solution: Check Kafka connection
# Test Kafka connectivity
kcat -L -b localhost:9092
# Verify consumer group registered
kafka-consumer-groups.sh --bootstrap-server localhost:9092 \
--describe --group order-processor
Solution: Check offset position
earliest to replay all messagesSolution: Enable parallel processing
/sw-kafka:dev-env - Set up local Kafka cluster/sw-n8n:test-workflow - Test workflow with sample data (coming soon).specweave/docs/public/guides/n8n-kafka-patterns.md.specweave/docs/public/guides/n8n-error-handling.mdPlugin: specweave-n8n Version: 1.0.0 Status: ✅ Production Ready