Automate Email Template Sync Between Dartagnan & Braze with n8n

Struggling to keep email templates synchronized between Dartagnan and Braze manually? This n8n workflow automates token-based authentication, project and campaign fetching, and template syncing, saving hours of manual work and ensuring consistency.
httpRequest
set
code
+5
Workflow Identifier: 2316
NODES in Use: Set, HTTP Request, Schedule Trigger, Merge, If, Code, SplitOut, Sticky Note
Automate email sync with n8n and HTTP Request

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow keeps email templates in Dartagnan and Braze in sync. It fixes the problem of missed or old content updates by checking campaigns and templates. The result is consistent emails and saved time by running every 5 minutes automatically.

It logs into Dartagnan using OAuth2 and gets the access token. Then it gets the list of projects and their campaigns. Next, it checks Braze for email templates already there. It compares campaign and template names to find matches or new items.

Updated campaigns have their images fixed and HTML prepared, then the workflow updates Braze templates. New campaigns get created as new templates in Braze. This way, the two platforms stay up to date without manual work.


Tools and Services Used

  • n8n Workflow Automation: Runs and schedules the automation.
  • Dartagnan API: Provides marketing projects and campaigns with OAuth2 authentication.
  • Braze API: Manages email templates with REST calls and API key authentication.


Inputs, Processing, and Outputs

Inputs

  • Dartagnan client_id and client_secret for OAuth2 login.
  • Braze instance_url and api_key to access email templates.

Processing Steps

  1. Request access token from Dartagnan using OAuth2.
  2. Fetch current projects from Dartagnan.
  3. Get campaign details for each project.
  4. Extract core campaign info and unify naming format.
  5. Retrieve all Braze email templates.
  6. Match Dartagnan campaigns to Braze templates by unified name.
  7. For matched templates, check if Dartagnan content is newer.
  8. If newer, download Dartagnan HTML and media URLs.
  9. Replace campaign image URLs in HTML for Braze compatibility.
  10. Update the existing Braze template with new content.
  11. For Dartagnan campaigns not in Braze, fetch content and create new templates.

Outputs

  • Updated Braze email templates matching Dartagnan campaigns.
  • New Braze email templates for new Dartagnan campaigns.
  • Reduced manual errors and saved synchronization time.


Who Should Use This Workflow

This workflow fits marketing managers who handle many email campaigns in both Dartagnan and Braze. It suits users wanting to stop manual sync errors and save hours weekly. Also, it’s helpful for teams using Braze email platforms and Dartagnan campaign tools together.

Users with some n8n familiarity benefit most. It works well for companies needing frequent template updates without mistakes. People who want to automate marketing email updates will find this workflow useful.


Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Download the workflow file with the Download button on this page.
  2. Open your n8n editor where you want to add the automation.
  3. Click “Import from File” in n8n and select the downloaded workflow JSON file.
  4. The workflow will appear on the canvas ready to configure.

Step 2: Configure Credentials and Settings

  1. Find the Assign Credentials node and enter your Dartagnan client_id and client_secret.
  2. Enter your Braze instance_url and api_key in the same node.
  3. Review any IDs, folder names, emails, or channels that may be in other nodes and update if needed to match your accounts.

Step 3: Test the Workflow

  1. Run the workflow manually once using the n8n run button.
  2. Check outputs to confirm the flow fetches tokens, projects, campaigns, and Braze templates correctly.
  3. Look for any errors in logs and fix credential or URL issues if needed.

Step 4: Activate for Production

  1. Switch the activation toggle in n8n to enable this workflow runs automatically on schedule.
  2. The workflow will now sync every 5 minutes or as scheduled.
  3. Monitor execution logs regularly to catch any API errors or failures early.
  4. You may consider adding notifications or alerts for failures.

For users wanting more control or private hosting, consider setting up self-host n8n to run on a private server.


Customization Ideas

  • Change the Schedule Trigger node frequency to run the workflow less or more often according to your team needs.
  • Modify the campaign filter logic to handle multiple campaigns per project, using n8n nodes like SplitInBatches.
  • Edit the email subject lines in the update and create HTTP nodes to add new marketing text or variables.
  • Add alert nodes like Slack or email to notify the team if an error occurs during sync.
  • Improve the Embed image in HTML code node to handle different media types such as videos or gifs.


Troubleshooting Common Issues

  • 401 Unauthorized Errors
    Make sure Dartagnan and Braze credentials are correct in the Assign Credentials node and tokens refresh properly.
  • No Data or Empty API Responses
    Check all API URLs in HTTP Request nodes match Dartagnan and Braze latest documentation.
  • Templates Not Updating
    Verify the update check compares timestamps correctly and uses exact JSON paths.
  • Image URLs Not Replacing
    Edit the JavaScript regex in the Embed image in HTML code node to match all supported image formats.


Pre-Production Checklist

  • Confirm Dartagnan API credentials and Braze API key are entered exactly as required.
  • Test each HTTP Request node alone to verify correct data retrieval.
  • Check the Token Request node outputs a fresh access token before running other steps.
  • Ensure the schedule trigger fires on your desired timing.
  • Run a manual test sync with recent Dartagnan campaigns to confirm Braze templates update properly.
  • Backup existing Braze email templates before enabling automation to allow rollback.


Summary of Results

✓ Saves 3-4 manual work hours weekly by automating synchronization.

✓ Improves branding consistency by removing template update errors.

→ Keeps Dartagnan campaign data and Braze email templates matched up every 5 minutes.

→ Enables marketing teams to focus on creative tasks instead of repetitive syncing.

Automate email sync with n8n and HTTP Request

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Frequently Asked Questions

It uses the OAuth2 client credentials with a POST request to Dartagnan’s token endpoint, which returns a token valid for 60 minutes.
The workflow detects the newer update timestamp on Dartagnan and sends updated HTML and media content to Braze to update the existing template.
By default it processes one campaign per run, but it can be extended using batch processing nodes like SplitInBatches to handle many campaigns.
Check and adjust the regular expressions in the Embed image in HTML code node to ensure all image URL formats are matched and replaced properly.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.