Senior n8n-Automatisierungsarchitekt
Von Wikiprompt, der freien Prompt-Enzyklopädie
Senior n8n-Automatisierungsarchitekt Prompt, der Claude dazu zwingt, detaillierte, produktionsreife n8n-Workflows ohne konzeptionelles Beiwerk zu generieren.
Prompt-InhaltSpeichern
🌐
WORKFLOW OVERVIEW: This workflow triggers on a webhook, validates the payload, processes the data through a series of transformations, and stores the result in a database, with error handling and retry logic.
NODES (in execution order):
- Webhook Trigger: n8n-nodes-base.webhook
Input: External HTTP POST request
Operation: Receive webhook
Parameters:
- HTTP Method: POST
- Path: /incoming
- Response: Immediately
- Allowed Origins: *
- Validate Payload: n8n-nodes-base.function
Input: Webhook Trigger
Operation: Custom validation script
Parameters:
- Function Code: |
const requiredFields = ['id', 'timestamp', 'data'];
for (const field of requiredFields) {
if (!item.json[field]) {
throw new Error(`Missing field: ${field}`);
}
}
return item;
- Transform Data: n8n-nodes-base.function
Input: Validate Payload
Operation: Map and transform fields
Parameters:
- Function Code: |
item.json.processedId = item.json.id.toUpperCase();
item.json.processedTimestamp = new Date(item.json.timestamp).toISOString();
item.json.payloadSize = JSON.stringify(item.json.data).length;
delete item.json.id;
return item;
- Enrich with Lookup: n8n-nodes-base.httpRequest
Input: Transform Data
Operation: GET request to external API
Parameters:
- URL: https://api.example.com/enrich/[FIELD]
- Method: GET
- Authentication: Generic Credential Type
- Credential: Enrichment API Key
- Query Parameters:
- source: n8n
- Response Format: JSON
- Merge Enrichment: n8n-nodes-base.merge
Input: Transform Data and Enrich with Lookup
Operation: Combine data
Parameters:
- Mode: Combine
- Combination Mode: Merge by field
- Merge By Fields:
- Field 1: processedId
- Options:
- Overwrite: false
- Store in Database: n8n-nodes-base.postgres
Input: Merge Enrichment
Operation: Insert record
Parameters:
- Credential: PostgreSQL DB
- Operation: Insert
- Table: processed_records
- Columns:
- processedId
- processedTimestamp
- payloadSize
- enrichmentData
- Values:
- processedId: ={{ $json.processedId }}
- processedTimestamp: ={{ $json.processedTimestamp }}
- payloadSize: ={{ $json.payloadSize }}
- enrichmentData: ={{ JSON.stringify($json.enrichment) }}
- Success Response: n8n-nodes-base.respondToWebhook
Input: Store in Database
Operation: Respond to webhook
Parameters:
- Respond With: JSON
- Response Body:
- status: success
- id: ={{ $json.processedId }}
CONNECTIONS: Webhook Trigger -> Validate Payload -> Transform Data -> Enrich with Lookup -> Merge Enrichment -> Store in Database -> Success Response
ERROR HANDLING:
- Add an 'Error Trigger' node (n8n-nodes-base.errorTrigger) connected to a 'Send Error Email' node (n8n-nodes-base.emailSend) for critical failures.
- On 'Validate Payload' and 'Transform Data', set 'On Error' to 'Continue with Error Output' and route to a 'Log Error' node (n8n-nodes-base.function) that writes to a log file.
- For 'Enrich with Lookup', enable 'Retry On Fail' with 3 attempts, 2 seconds between attempts, and 'On Error' set to 'Continue with Error Output' to use fallback data.
- For 'Store in Database', enable 'Retry On Fail' with 5 attempts, exponential backoff, and 'On Error' set to 'Stop Workflow' to prevent data loss.
SECURITY:
- Webhook: Set 'Allowed Origins' to specific domains, use 'Basic Auth' or 'Header Auth' with a shared secret, and validate HMAC signature in 'Validate Payload' if required.
- API Keys: Store in n8n credentials (e.g., 'Enrichment API Key') - never hardcode.
- Database: Use dedicated PostgreSQL credential with least-privilege user (INSERT only).
- All external requests: Use HTTPS and validate SSL certificates.
DEPLOYMENT:
- Run in queue mode with Redis for scalability: set EXECUTIONS_MODE=queue, QUEUE_BULL_REDIS_HOST=redis.
- Set 'EXECUTIONS_DATA_PRUNE' to true with a max age of 168 hours to avoid data bloat.
- Enable 'Save Successful Production Executions' and 'Save Error Production Executions' for auditing.
- Use environment variables for all credentials and URLs (e.g., ENRICHMENT_API_URL).
- Deploy via Docker with health checks on the webhook endpoint.
Melde dich an, um den vollständigen Prompt zu sehen
Weiter mit:
Mit der Anmeldung akzeptierst du unsere Nutzungsbedingungen und Datenschutz
Verwendung
Dieser Prompt ist für die Verwendung mit coding gedacht. Kopiere den Inhalt oben und füge ihn in dein bevorzugtes KI-Tool ein.
Für beste Ergebnisse passe die Platzhalter (eckige Klammern oder Großbuchstaben) an deine Anforderungen an.
Referenzen
- Kategorie: coding-Prompts
- Quelle: https://x.com/MillieMarconnni/status/2016807079441482014
Diskussion
0 Kommentare