๐ Template #21595: Hash and Sync Leads to Meta CAPI with DevDeskApp, Google Sheets, and Slack โ
๐ Template on n8n.io: n8n.io/workflows/21595

๐ฏ Overview โ
The Meta Conversions API (CAPI) expects customer identifiers such as email to be normalised (trimmed, lowercased) and SHA-256 hashed before you send them. It also uses an event_id to deduplicate server events against pixel events. This template:
- Trims and lowercases the lead email with DevDeskApp Case Converter.
- Hashes it with SHA-256 in the n8n process, so the raw email is never sent to Meta.
- Creates a UUID v4
event_idand a campaign slug such asq4-enterprise-cloud-migration. - Checks opt-in with an If node, then posts the event to the Meta Graph API (
/v19.0/{pixel_id}/events), saves the lead to Google Sheets and alerts Slack. Leads without opt-in are logged to Slack and not sent.
Only the email is hashed. The phone number in the sample is not sent to Meta. If you need ph, add another hash node on the digits-only phone number.
Known issue in the published version (checked 4 Nov 2026)
As published, every lead is sent with the same email hash: e3b0c442โฆb855, the SHA-256 of an empty string. Meta cannot match these events. Fix two parameters after import:
- DevDeskApp: Email Lowercase & Clean: set Target Case to Lowercase (
lowerCase). The published valueloweris not a valid option, so the node returns an emptyresult. - DevDeskApp: SHA-256 Email Privacy Hasher: set Text/Payload to
{{ $json.result }}. The published{{ $json.convertedText }}refers to a field that does not exist.
๐ธ Pipeline โ

| Node | Resource ยท Operation | Purpose |
|---|---|---|
| DevDeskApp: Email Lowercase & Clean | text ยท caseConverter (lowerCase) | Normalises leadEmail.trim() |
| DevDeskApp: SHA-256 Email Privacy Hasher | crypto ยท hash (sha256) | em value for CAPI |
| DevDeskApp: Event Deduplication UUID | crypto ยท uuid | event_id |
| DevDeskApp: Campaign Tracking Slug | text ยท slugify | Campaign tag in custom_data |
| If: Lead Has Opted-In & Verified Email | if | Only opted-in leads reach Meta |
| Meta Graph API: Dispatch Server CAPI Event | HTTP Request | POST https://graph.facebook.com/v19.0/YOUR_PIXEL_ID/events |
โก CAPI payload (with the fix above) โ
For the sample lead [email protected], Format Meta CAPI Payload produces:
{
"data": [
{
"event_name": "Lead",
"event_time": 1793735085,
"event_id": "b7014673-4581-44c0-b06f-be1822754c7a",
"user_data": {
"em": ["b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514"]
},
"custom_data": {
"currency": "INR",
"value": 50000,
"campaign": "q4-enterprise-cloud-migration"
},
"action_source": "system_generated"
}
]
}b4c9a289โฆ5514 is the SHA-256 of [email protected]. event_id and event_time change on every run.
๐ฅ Import it โ
- Make sure
n8n-nodes-devdeskappis installed (installation guide). - Open the template on n8n.io and click Use for free, or copy the workflow JSON.
- Paste it onto a new workflow canvas with
Ctrl + V(Cmd + Von macOS). - Apply the two fixes from the known-issue box.
- Replace
YOUR_PIXEL_ID, add your Meta access token, and connect Google Sheets and Slack credentials. - Click Test workflow and check the event in Meta Events Manager โ Test events.

