AWS Lambda email verification with BillionVerify
AWS Lambda lets you run code in response to events without managing servers. It is one of the most flexible places to add email verification β call BillionVerify from any Lambda function that handles sign-ups, form submissions, or data ingestion, and stop bad addresses before they enter your system.
Why verify before the send
Lambda functions that process user-submitted data are a common entry point for invalid, disposable, and catch-all email addresses. Without a verification step, those addresses propagate to every downstream service β RDS, DynamoDB, SES, SNS β generating bounces, wasted costs, and degraded sender reputation. BillionVerify adds a single, lightweight check that protects the entire pipeline.
Ready-to-use n8n workflow
Import this workflow into n8n β it verifies every address with BillionVerify before AWS Lambda sends, so only deliverable contacts are emailed. Install the BillionVerify community node first, then add your API key.
{
"name": "Verify emails before sending in AWS Lambda + BillionVerify",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
240,
300
],
"name": "When clicking βTest workflowβ"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "email-field",
"name": "email",
"value": "jane@example.com",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
460,
300
],
"name": "Get contacts"
},
{
"parameters": {
"sendTo": "={{ $json.email }}",
"subject": "Message for AWS Lambda contacts",
"message": "Replace this Gmail send with your AWS Lambda node β only deliverable, verified contacts reach it.",
"options": {}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
900,
300
],
"name": "Send email",
"webhookId": "",
"credentials": {
"gmailOAuth2": {
"id": "",
"name": "Gmail account"
}
}
},
{
"parameters": {
"operation": "verify",
"email": "={{ $json.email }}",
"additionalOptions": {}
},
"type": "n8n-nodes-billionverify.billionVerify",
"typeVersion": 1,
"position": [
540,
300
],
"name": "Verify Email (BillionVerify)",
"credentials": {
"billionVerifyApi": {
"id": "",
"name": "BillionVerify account"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "is-deliverable",
"leftValue": "={{ $json.is_deliverable }}",
"rightValue": "",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
]
}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
720,
300
],
"name": "IF deliverable"
}
],
"connections": {
"When clicking βTest workflowβ": {
"main": [
[
{
"node": "Get contacts",
"type": "main",
"index": 0
}
]
]
},
"Get contacts": {
"main": [
[
{
"node": "Verify Email (BillionVerify)",
"type": "main",
"index": 0
}
]
]
},
"Verify Email (BillionVerify)": {
"main": [
[
{
"node": "IF deliverable",
"type": "main",
"index": 0
}
]
]
},
"IF deliverable": {
"main": [
[
{
"node": "Send email",
"type": "main",
"index": 0
}
],
[]
]
}
},
"settings": {
"executionOrder": "v1"
}
}Workflow templates with AWS Lambda
Ready-to-use workflows that verify emails before AWS Lambda sends.
How it works
- 1
Add the BillionVerify REST API call inside your Lambda handler using your preferred HTTP client (axios, node-fetch, or the built-in fetch in Node.js 18+).
- 2
Pass the email address from the incoming event payload to BillionVerify and await the response.
- 3
Inspect the returned status β valid, invalid, disposable, catch-all, or role β and branch your handler logic accordingly.
- 4
Return an error response to the caller for rejected addresses, or continue processing and writing to downstream services for valid ones.
- 5
Use Lambda environment variables to securely store your BillionVerify API key and avoid hard-coding credentials.
When to use this
Validate emails in API Gateway + Lambda backends
When API Gateway routes a registration or lead-capture request to Lambda, add a BillionVerify REST API call at the start of the handler. Return a 422 response immediately if the address is invalid β before any database write occurs.
Sanitize S3-triggered data pipelines
If a Lambda function processes uploaded CSV files containing email lists, run each address through BillionVerify before inserting records into your data warehouse, ensuring only deliverable contacts are stored.
Power n8n workflows with Lambda event triggers
Use Lambda to emit events to an n8n webhook whenever a new contact is created, then let the BillionVerify n8n node verify the address and route valid contacts to your CRM automatically.
FAQ
How do I add BillionVerify to an existing Lambda function?
Make an HTTP GET or POST request to the BillionVerify REST API endpoint with your API key and the email address. The API returns a JSON response with a status field you can use to branch your logic.
Will calling BillionVerify from Lambda increase my costs significantly?
The verification call adds only a few hundred milliseconds of execution time per invocation, which has minimal impact on Lambda billing. The savings from preventing bounces and protecting SES reputation far outweigh the cost.
Can I use BillionVerify asynchronously in Lambda?
Yes. For high-throughput pipelines, verify asynchronously by writing the address to a queue and processing it in a separate Lambda function, updating the record status once the result is returned.
Is there a BillionVerify SDK I can install in my Lambda layer?
BillionVerify exposes a straightforward REST API, so no SDK is required. A simple HTTP request from any runtime Lambda supports β Node.js, Python, Go, Java β is all you need.
Verify emails in AWS Lambda
Create a free account, grab your API key, and stop bounces before they happen.
Get started free