This workflow automates SendGrid email marketing tasks using the SendGrid API, managing lists, contacts, and emails with operations like create, update, get, getAll, delete, upsert, and send. Key nodes include Webhook Trigger (initiates via POST), Input Validation (ensures valid action/resource/operation), Resource Router (directs to list/contact/mail), List/Contact Operation Routers (handle specific actions), List Create/ID Validation (checks name/listId), Contact Upsert/ID Validation (verifies email/contactId), Mail Send Validation (checks fromEmail/toEmail/subject), Create/Update/Get/GetAll/Delete SendGrid List/Contact and Send Email (perform operations), Success Response (returns results), and error nodes (General/Field Validation/SendGrid API Error) for handling failures.\n\nSetup Requirements and Configuration: Install n8n from n8n.io for self-hosting or sign up at cloud.n8n.io for cloud setup. Follow prompts or create a cloud account. Obtain a SendGrid API key from sendgrid.com: log in, navigate to 'Settings' > 'API Keys,' create a key with full access, and copy it. In n8n, import the JSON workflow. Configure SendGrid nodes (Create/Update/Get/GetAll/Delete List/Contact, Send Email) with the API key under ‘Credentials’ > ‘SendGrid API.’ Set Webhook Trigger path to ‘sendgrid-automation,’ configure for POST requests, and add header authentication with a secure key (e.g., ‘Authorization: Bearer your-key’). Ensure server resources support API calls. Verify key permissions for list, contact, and email operations.\n\nTesting and Deployment Steps: Test with Postman using a POST request to the Webhook URL. Example JSON: {'action': 'create', 'resource': 'list', 'operation': 'create', 'name': 'Test List'} or {'action': 'send', 'resource': 'mail', 'operation': 'send', 'fromEmail': 'sender@example.com', 'toEmail': 'recipient@example.com', 'subject': 'Test'} with authentication header. Success responses return 200 with list/contact/email data. Error nodes return 400 for invalid inputs (e.g., missing name/email) or 500 for API failures. Check logs for errors like ‘Invalid API key’ or ‘Email not sent,’ and verify the key or input format. Activate workflow in n8n. Validate output: ensure list/contact IDs or email status match inputs. Debug errors using n8n logs for key issues or rate limits.
$6.99
Workflow steps: 25
Integrated apps: webhook, if, switch