Overview
Email processing automation means replacing the human step of reading, categorizing, and acting on email with code. When an order confirmation arrives, your system automatically extracts the order number and updates your database. When a lead submits a form that generates an email notification, your CRM record is created without human intervention.
The key enabler is a reliable mechanism to convert inbound email into application events — which is exactly what JsonHook provides. By assigning a unique @in.jsonhook.com address to each automation workflow and routing emails to webhook handlers, you build pipelines that are:
- Real-time: Processing happens within seconds of email receipt, not during the next manual review cycle
- Reliable: HMAC-signed deliveries with automatic retry ensure no emails are lost
- Auditable: Every delivery is logged with request/response details in the JsonHook delivery log
- Scalable: The same architecture handles 10 emails a day or 100,000 emails a month
Prerequisites
For a complete email automation pipeline you will need:
- A JsonHook account and API key
- One or more inbound addresses (one per automation workflow is a clean pattern)
- A web server or serverless function to host your webhook handlers
- A database or downstream service to store or act on the extracted email data
- Optionally: a message queue (e.g., Redis + BullMQ, SQS, RabbitMQ) for high-volume or CPU-intensive processing
For low-code automation, you can also route JsonHook webhooks to Zapier, Make, or n8n and build workflows without writing a handler yourself.
Automate Your Email Workflows Today
Every inbound email becomes a webhook event. Start free — no credit card needed.
Get Free API KeyStep-by-Step Instructions
Build an automated email processing pipeline with these steps:
- Map your email flows. List every email type you want to process: order confirmations, lead alerts, invoice PDFs, support requests, etc. Each flow gets its own JsonHook address and handler.
- Create a JsonHook address for each flow via the API, pointing to the appropriate handler URL.
- Route email sources. Update your forms, integrations, and forwarding rules to send relevant emails to the corresponding JsonHook address instead of a human mailbox.
- Implement each webhook handler. Each handler receives a POST with the parsed email JSON, extracts the relevant fields, and performs the automated action (DB write, API call, notification).
- Add idempotency. Store processed
deliveryIdvalues in a set or database to safely handle retried deliveries without side effects. - Monitor via delivery logs. Use the JsonHook API to query delivery history and alert on repeated failures, which indicate issues with your handler or downstream systems.
Code Example
This example shows an automated order confirmation processor in Node.js that parses an order number from the email subject and updates a database:
import express from "express";
import crypto from "crypto";
import { db } from "./db";
const app = express();
app.use(express.raw({ type: "application/json" }));
app.post("/webhooks/orders", async (req, res) => {
// Verify signature
const sig = req.headers["x-jsonhook-signature"];
const expected = crypto
.createHmac("sha256", process.env.JSONHOOK_SECRET!)
.update(req.body).digest("hex");
if (sig !== expected) return res.sendStatus(401);
const { email, deliveryId } = JSON.parse(req.body.toString());
// Idempotency check
const already = await db.deliveries.findOne({ deliveryId });
if (already) return res.sendStatus(200);
await db.deliveries.insert({ deliveryId });
// Extract order number from subject: "Order #12345 Confirmed"
const match = email.subject.match(/Order #(d+)/i);
if (match) {
const orderId = match[1];
await db.orders.update({ id: orderId }, { status: "confirmed" });
console.log(`Order ${orderId} confirmed via email`);
}
res.sendStatus(200);
});
app.listen(3000);Common Pitfalls
Automation pipelines fail silently if you are not careful. Avoid these issues:
- No idempotency. Webhook handlers can be called multiple times for the same email (retries). Always check the
deliveryIdbefore performing side effects. - Brittle subject-line parsing. Email subjects change format over time. Where possible, use the sender address, custom headers, or the recipient address for routing decisions rather than parsing subject text.
- No dead-letter handling. When a delivery fails all retries, it ends up in your JsonHook failed delivery log. Set up a daily alert or monitoring dashboard to catch and investigate these failures promptly.
- Processing everything in the webhook handler. For anything taking more than a second, push a job to a queue and return 200. Long-running webhook handlers lead to timeouts and unnecessary retries.
- No test environment. Create a separate JsonHook address pointing to a staging webhook for each flow so you can test with real emails before going live.