n8n-workflow-patterns
Audited by Runlayer on Feb 26, 2026
Tool passed security scan
Malicious tool definition detected
'ROLLBACK' : 'COMMIT'}}" } ``` ### Pattern 2: Atomic Operations **Use database features for atomicity**: ```sql -- Upsert example (atomic) INSERT INTO inventory (product_id, quantity) VALUES ($1, $2) ON CONFLICT (product_id) DO UPDATE SET quantity = inventory.quantity + $2 ``` ### Pattern 3: Error Rollback **Manual rollback on error**: ``` Try Operations: Postgres (INSERT orders) MySQL (INSERT order_items) Error Trigger: Postgres (DELETE FROM orders WHERE id = {{$json.order_id}}) MySQL (DELETE F
Tool passed security scan
Malicious tool definition detected
Read-Only Database Tools ```sql -- Create limited user for AI tools CREATE USER ai_agent_ro WITH PASSWORD 'secure'; GRANT SELECT ON public.* TO ai_agent_ro; -- NO write access! ``` ### 2. Validate Tool Inputs ```javascript // Code node - validate before execution const query = $json.query; if (query.toLowerCase().includes('drop ') || query.toLowerCase().includes('delete ') || query.toLowerCase().includes('update ')) { throw new Error('Invalid query - write operations not allowed'); } ``` ### 3.
Tool passed security scan
Tool passed security scan
Tool passed security scan
Passed Files (2)Click to expand
Tool passed security scan
Tool passed security scan