Automate Agile CRM Enrichment with French INSEE API

Struggling with inaccurate or incomplete company data in Agile CRM? This workflow automates enriching your CRM companies with authoritative data from the French INSEE OpenDatabase API, ensuring up-to-date addresses and official identifiers like SIREN. Save hours and increase CRM data reliability with seamless automation.
agileCrm
httpRequest
manualTrigger
+6
Workflow Identifier: 1770
NODES in Use: manualTrigger, httpRequest, stickyNote, code, set, scheduleTrigger, noOp, agileCrm, merge

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

1. Opening Problem Statement

Meet Claire, a sales operations manager at a French tech startup relying heavily on Agile CRM to manage hundreds of company contacts. Every week, Claire spends hours manually verifying and updating company addresses and official identification numbers like the French SIREN from government databases. Mistakes and outdated data slip in frequently, leading to wasted outreach efforts and lost revenue opportunities. The manual task is time-consuming, error-prone, and frustrating.

This is a real challenge for many CRM users in France who want to maintain accurate company data to enable smart sales and compliance processes. Without an automated way to sync Agile CRM with authoritative public company data, the team operates with stale information, undermining productivity and customer engagement.

2. What This Automation Does

This n8n workflow automates the enrichment of company data in Agile CRM by pulling updated and verified information from the French INSEE OpenDatabase API (SIREN database). When the workflow runs, it:

  • Fetches all companies from Agile CRM.
  • Filters out companies marked as “ReadOnly” to avoid overwriting protected records.
  • Queries the INSEE API using the company name to find matching government records.
  • Retrieves detailed company data including official headquarters address and SIREN code.
  • Combines the original Agile CRM data with enriched INSEE data for accuracy.
  • Updates the Agile CRM company entries with the official address and adds the SIREN number to a custom field.

By automating these steps, Claire and her team can save hours weekly, reduce errors, and maintain authoritative company records without manual intervention.

3. Prerequisites ⚙️

  • n8n Automation Platform account ⏱️
  • Agile CRM account and API credentials 🔑
  • French INSEE OpenDatabase API key 🔐 (free access from INSEE API portal)
  • Custom fields set up in Agile CRM for “SIREN” (Text) and “RO” (Number) to manage data updates

4. Step-by-Step Guide

Step 1: Trigger Setup with Manual or Scheduled Start

In n8n, add a Schedule Trigger node (n8n-nodes-base.scheduleTrigger) or Manual Trigger node (n8n-nodes-base.manualTrigger) depending on your preference.

Navigate: Nodes panel > Add Node > Core Nodes > Schedule Trigger or Manual Trigger.

Configure schedule interval if using scheduled trigger. Visual confirmation: node ready with set interval or manual ready button.

Common mistake: Forgetting to enable or activate the schedule later.

Step 2: Set INSEE API Key

Add the Set node (n8n-nodes-base.set) and name it “Set Insee API Key”. Enter your API key in the assignment field named X-INSEE-Api-Key-Integration.

Navigation: Click Add Node > Set node > Under Parameters > Add Assignment.

Paste your actual INSEE API key here.

Expected: This node outputs your key as JSON to use in downstream HTTP nodes.

Common mistake: Leaving the placeholder key “put-your-insee-api-key-here” without replacing.

Step 3: Fetch All Companies from Agile CRM

Add the Agile CRM node (n8n-nodes-base.agileCrm) configured to Get All Companies.

Navigation: Add Node > Agile CRM > Resource: Company > Operation: getAll.

Connect your Agile CRM credentials in the node settings.

Result: The node outputs all company records from your Agile CRM account.

Common mistake: Incorrect or missing Agile CRM credentials causing API errors.

Step 4: Filter out ReadOnly Companies

Use a Code node (n8n-nodes-base.code) named “FilterOut all Company that have the ReadOnly Key set”. This JavaScript filters out companies where custom property “RO” equals 1 to avoid updating protected entries.

Code snippet:

// Get input data
const input = $input.all();
const output = input.filter(item => {
    const properties = item.json.properties || [];
    return !properties.some(property => property.name === "RO" && property.value === "1"); // Remove all ReadOnly entries
}).map(item => {
    const companyId = item.json.id;
    const denominationUniteLegale = item.json.properties[0]?.value || null; 
    return {
        json: {
            companyId,
            denominationUniteLegale
        }
    };
});

// Return the transformed output
return output;

Expected: Only companies not marked “RO=1” continue to next node.

Common mistake: Not mapping ‘denominationUniteLegale’ correctly if property order differs.

Step 5: Query INSEE SIREN Database by Company Name

Add an HTTP Request node (n8n-nodes-base.httpRequest) named “Find Company in SIREN database”.

Use the following URL (dynamically from previous node):
https://api.insee.fr/api-sirene/3.11/siren?q=periode(denominationUniteLegale:"{{ $json.denominationUniteLegale }}")

Include headers:
– accept: application/json
– X-INSEE-Api-Key-Integration: from “Set Insee API Key” node

Method defaults to GET.

Visual: Successful JSON response of matching company records.

Common mistake: Missing API key or invalid company name leading to empty results.

Step 6: Retrieve Full Company Data from SIRET Endpoint

Next, add another HTTP Request node named “Request all data from SIREN database”.

Construct the URL dynamically:
https://api.insee.fr/api-sirene/3.11/siret/{{ $json.unitesLegales[0].siren }}{{ $json.unitesLegales[0].periodesUniteLegale[0].nicSiegeUniteLegale }}

Use same headers as above.

Output: Full detailed company data including official address.

Common mistake: Indexing errors when accessing nested JSON arrays if API response varies.

Step 7: Merge CRM and INSEE Data

Insert a Merge node (n8n-nodes-base.merge) configured with mode “combine” and advanced merge by fields:

  • Field 1: denominationUniteLegale
  • Field 2: etablissement.uniteLegale.denominationUniteLegale

This matches Agile CRM company data with the enriched INSEE data by legal denomination.

Common mistake: Merge failing if names don’t exactly match; consider normalizing names if needed.

Step 8: Update Agile CRM with Enriched Data

Finally, use the Agile CRM node set to Update Company, mapping fields to update the company’s address and custom “SIREN” property with data obtained from INSEE.

Address example mapping uses nested JSON path:
$json.etablissement.adresseEtablissement.complementAdresseEtablissement + ' ' + $json.etablissement.adresseEtablissement.typeVoieEtablissement + ' ' + $json.etablissement.adresseEtablissement.libelleVoieEtablissement + ' ' + $json.etablissement.adresseEtablissement.codePostalEtablissement + ' ' + $json.etablissement.adresseEtablissement.libelleCommuneEtablissement

Expected outcome: Agile CRM entries now hold verified and official company addresses and SIREN numbers.

Common mistake: Misconfiguring JSON path expressions leading to incomplete address fields.

5. Customizations ✏️

  • Mark companies as read-only after update: In the “Enrich CRM with INSEE Data” node, add a custom property named “RO” with subtype “Number” and value “1”. This prevents future overwrites for updated companies.
  • Adjust API query: Modify the query string in “Find Company in SIREN database” node to search on alternate fields like “siren” or “nicSiegeUniteLegale” for more precise matches.
  • Schedule frequency customization: Change the interval in the “Schedule Trigger” node to run daily, weekly, or monthly based on your CRM update needs.
  • Handle multiple headquarters: Extend the code node filter to handle companies with multiple “unitesLegales” by iterating over arrays and selecting appropriate headquarters address.

6. Troubleshooting 🔧

Problem: “HTTP 401 Unauthorized” error from INSEE API.
Cause: Incorrect or expired API key.
Solution: Revisit the “Set Insee API Key” node and replace the API key with a valid one. Test API access independently via Postman or curl to verify key validity.

Problem: No company data updated in Agile CRM.
Cause: Incorrect JSON path in the update node or companies marked as “RO=1” excluded.
Solution: Check mapping expressions in the “Enrich CRM with INSEE Data” node. Verify the “FilterOut all Company that have the ReadOnly Key set” code node logic. Temporarily disable filter to test.

Problem: Empty or no results from the INSEE API query.
Cause: Company name mismatch or query syntax error.
Solution: Confirm company names are accurate in Agile CRM. Test the query URL directly with a known company name. Optionally adjust the query string parameters for fuzzier matching.

7. Pre-Production Checklist ✅

  • Verify Agile CRM API credentials work and permissions allow company read and update operations.
  • Check INSEE API Key validity and permission scopes.
  • Ensure Agile CRM custom fields “SIREN” (Text) and “RO” (Number) exist and are correctly assigned.
  • Run the workflow manually first with a small dataset to confirm data flow and updates succeed.
  • Backup Agile CRM data prior to running bulk updates for rollback safety.

8. Deployment Guide

Activate the workflow by turning on the toggle switch in n8n after all configurations and tests pass.

If using the Schedule Trigger, ensure your n8n instance runs continuously or is hosted on reliable infrastructure.

Monitor workflow executions in n8n’s execution list panel for any errors or failed node runs.

9. FAQs

Can I use this workflow for other CRMs?
This workflow is tailored for Agile CRM nodes in n8n, but you can adapt the HTTP request steps and update logic for other CRMs with suitable API and node support.

Does this consume API credits?
INSEE’s API is publicly accessible with rate limits; monitor usage via your API key dashboard to avoid excess.

Is my data safe?
All API keys and data reside within your controlled n8n environment; ensure proper credential management and secure hosting.

10. Conclusion

By following this detailed n8n workflow, Claire has transformed her CRM data management. Instead of hours of tedious manual updates, she now enjoys automated enrichment with up-to-date official company information from the INSEE API. This ensures Agile CRM holds accurate addresses and SIREN codes, empowering smarter sales engagement and compliance.

This automation saves valuable time weekly, eliminates human errors, and boosts the reliability of CRM data. Next, you could explore automation ideas like syncing customer contact info, integrating invoice data, or enriching other CRM modules for a comprehensive data ecosystem.

With this workflow, you’re well on your way to mastering Agile CRM enrichment automation using n8n and the French government’s open data resources. Keep experimenting and automating! ⚙️

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free