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
Automate Agile CRM with n8n and INSEE API

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

Learn how to Build this Workflow with AI:

What This Automation Does

This n8n workflow updates company data in Agile CRM automatically using the French government INSEE API.
The main problem it solves is slow, manual updating of company addresses and SIREN numbers that often have mistakes.
The workflow gets all company records, skips those marked read-only, fetches official data from INSEE, and updates Agile CRM companies with accurate info.
After running, Agile CRM holds verified addresses and correct SIREN codes without manual work.

The inputs start with fetching all companies from Agile CRM through the Agile CRM API.
Next, the process filters out companies flagged as read-only to avoid unwanted updates.
It then sends the company name to the INSEE SIREN API to find matching official records.
With the SIREN result, a detailed company query fetches complete data including the exact address.
Finally, it merges the original CRM data with government data, and updates the CRM entry with correct address and SIREN in a custom field.

The output is the enriched Agile CRM database where each non-read-only company now contains an accurate, official address and the correct SIREN number from the INSEE database.


Who Should Use This Workflow

Users running Agile CRM in France who need current and reliable company data should use this workflow.
It helps sales, compliance, or operations teams who waste time fixing bad addresses and missing SIREN identifiers by hand.
If your company database grows fast or has many contacts, this automation cuts errors and manual effort.

It’s for users familiar with basic n8n automation but not deep programming.
Users who want to keep company info synchronized with official French government records benefit most.


Tools and Services Used


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

Step 1: Import the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Inside your n8n editor, click on “Import from File”.
  3. Select the downloaded file to load the workflow.

Step 2: Configure Credentials and API Keys

  1. Open the Set Insee API Key node and replace the placeholder with your real INSEE API Key.
  2. Go to the Agile CRM nodes and connect your Agile CRM API credentials.
  3. Check that the custom fields named “SIREN” and “RO” exist in your Agile CRM, and update node fields if IDs or names differ.

Step 3: Test the Workflow

  1. Execute the workflow manually from the n8n editor.
  2. Look at each node’s output to verify companies are fetched, filtered, data pulled from INSEE, merged, and updated correctly.

Step 4: Activate Workflow for Production

  1. Turn the workflow switch ON in n8n.
  2. If you use the Schedule Trigger, confirm your n8n instance runs continuously. Self-host n8n is recommended for reliable scheduling.
  3. Regularly monitor workflow runs under the executions panel for errors.

Workflow Processing Steps

Input

  • Fetch all companies from Agile CRM with the Agile CRM node.
  • Get the INSEE API key from a Set node.

Processing

  • Filter out companies marked “RO = 1” as read-only with a Code node.
  • Query INSEE SIREN API with company names to find matches using the HTTP Request node.
  • Get detailed company info from INSEE’s SIRET API endpoint.
  • Merge Agile CRM company data and INSEE data by matching the company name.

Output

  • Update each Agile CRM company with the official address and SIREN number in custom fields through the Agile CRM update node.

Code Snippet: Filtering Out ReadOnly Companies

The Code node filters out companies flagged with “RO = 1” to avoid updating protected records.

// 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;

This code makes sure only companies that can be edited move forward to the enrichment step.


Common Mistakes and How to Avoid Them

  • Forgetting to update the placeholder INSEE API key in the Set Insee API Key node.
  • Missing Agile CRM credentials or wrong permission scopes causing failures in fetching or updating companies.
  • Incorrect JSON path expressions in the Agile CRM update node that break address or SIREN mapping.
  • Company name mismatches causing the INSEE API to return no results—try adjusting query parameters or check company name data.
  • Indexing errors in accessing nested INSEE API arrays—ensure response structures match expectations.

Customization Ideas

  • Set updated companies to read-only automatically by adding or resetting the “RO” custom field to 1 to prevent future overwrites.
  • Modify the INSEE API query to search by SIREN or other registration IDs for precise matches.
  • Change schedule trigger frequency to match company update needs (daily, weekly, monthly).
  • Handle companies with multiple headquarters by iterating through multiple “unitesLegales” and choosing the right address.

Pre-Production Checklist

  • Test Agile CRM API credentials for reading and updating companies.
  • Verify the INSEE API key is valid and active.
  • Ensure the Agile CRM account has custom fields “SIREN” (text) and “RO” (number) created.
  • Test workflow runs on sample companies to make sure data flows as expected.
  • Backup CRM data before any large update runs for safety.

Summary of Results

✓ CRM companies have official addresses from the French government database.

✓ SIREN numbers are correctly stored in a dedicated Agile CRM field.

✓ No manual errors from wrong or outdated company data.

✓ Time savings by automated updates instead of weekly manual maintenance.

→ The user gains a cleaner, up-to-date CRM that helps sales and compliance.


Automate Agile CRM with n8n and INSEE API

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Check the API Key in the Set Insee API Key node. Replace with a valid key. Test key independently using curl or Postman.
Verify JSON path expressions in the Agile CRM update node. Also check the code node that filters out companies with RO=1. Try disabling filter to test.
Ensure company names are accurate and complete in Agile CRM. Modify the query in the HTTP Request node for wider matching or test with known names.
Yes, but the Agile CRM nodes must be replaced with appropriate API calls or nodes. The INSEE API HTTP requests remain similar.

Promoted by BULDRR AI

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.