# CRM & Notion Data Audit — Diff Your Records Against a Dataset (`deadwood_data_solutions/connector-diff-audit`) Actor

Compare Notion, HubSpot, Supabase or any MCP-connected app against an Apify dataset. Reports what never made it in, what's gone stale, and which fields have drifted apart. Read-only — it never writes to your app.

- **URL**: https://apify.com/deadwood\_data\_solutions/connector-diff-audit.md
- **Developed by:** [K O](https://apify.com/deadwood_data_solutions) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 discrepancy founds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## CRM & Notion Data Audit — Diff Your Records Against a Dataset

Nobody trusts a CRM they haven't checked. This Actor checks it.

Give it a dataset you treat as the source of truth and a connected app to compare against, and it reports three things:

- **Missing** — source rows that never made it into the app.
- **Stale** — records in the app with no matching row in the source any more.
- **Drifted** — records on both sides where a field no longer agrees.

**It never writes.** Point it at a live production CRM without a second thought.

### Why run it

Sync jobs fail quietly. Someone edits a record by hand. An import half-finishes. Six months later nobody can say whether the CRM matches reality.

This turns that into a list you can act on — and pairs naturally with the write-side Actors: audit first, see the damage, then fix it with a sync or a field fill.

### Signal, not noise

The comparison is deliberately forgiving about things that don't matter:

- Blank on both sides counts as agreement — an empty cell and a missing field are not a discrepancy.
- Scalars compare trimmed and case-folded, so `" Acme "` and `acme` don't generate a finding.
- `0` and `false` are treated as real values, not blanks.
- Identical records are omitted from the report by default.

### How it works

1. Connect your app under **Integrations** in Apify Console.
2. Run in **`list-tools`** mode to learn the connector's tool names.
3. Run in **`audit`** mode.

```json
{
  "destination": "<your connector>",
  "mode": "audit",
  "datasetId": "<source-of-truth dataset>",
  "readTool": "query_database",
  "readToolArgs": { "database_id": "abc123" },
  "cursorArgName": "start_cursor",
  "cursorPath": "next_cursor",
  "matchKey": "email",
  "compareFields": ["phone", "owner", "status"]
}
```

> **Set up pagination if your app pages.** An audit against a partial read will wrongly report records as missing. `cursorArgName` + `cursorPath` make the read complete.

### Input

| Field | Required | Description |
|---|---|---|
| `destination` | yes | MCP connector to audit |
| `mode` | | `audit` (default) or `list-tools` |
| `datasetId` | for audit | Dataset treated as source of truth |
| `readTool` / `readToolArgs` | for audit | Tool that lists the app's records |
| `cursorArgName` / `cursorPath` / `maxPages` | | Pagination for a complete read |
| `matchKey` | for audit | Field joining both sides |
| `destMatchKey` | | Only if the app names that field differently |
| `compareFields` | | Fields to check for drift. Empty = presence only |
| `fieldMap` | | Only if a compared field is named differently in the app |
| `reportMissingAtDestination` | | Default on |
| `reportMissingInSource` | | Default on |
| `reportChanged` | | Default on |
| `includeIdentical` | | Default off |

### Output

One row per finding:

```json
{ "status": "changed", "key": "a@example.com",
  "differences": [{ "field": "phone", "source": "480-555-0100", "destination": "480-555-9999" }] }
```

```json
{ "status": "missing_at_destination", "key": "b@example.com", "differences": [] }
```

Full counts — including how many records were identical — are saved to the **SUMMARY** key-value record, so you can track drift over time without paying per row.

### Pricing

**$5 per 1,000 findings reported.** Records that agree are free, and an audit that finds nothing wrong costs nothing.

### FAQ

**Does it modify my CRM?** No. This Actor only reads.

**What if my app pages its results?** Set `cursorArgName` and `cursorPath`, or the audit will report a false "missing" for everything past page one.

**What if a record has no join key?** It's counted as `keyless` in the summary and skipped, rather than reported as missing.

**Can an AI agent call this?** Yes — it's exposed through the Apify MCP server, and being read-only it's safe for an agent to call unattended.

# Actor input Schema

## `destination` (type: `string`):

The MCP connector holding the records to check. Connect the app under Integrations in Apify Console first. This Actor only reads — it never writes. Credentials stay in Apify's proxy.

## `mode` (type: `string`):

Use 'list-tools' first to discover the connector's tool names, then 'audit'.

## `datasetId` (type: `string`):

Apify dataset treated as the source of truth. Required when mode is 'audit'.

## `readTool` (type: `string`):

MCP tool returning the records to audit, e.g. 'query\_database' for Notion, 'select' for Supabase.

## `readToolArgs` (type: `object`):

JSON arguments the read tool needs, e.g. {"database\_id": "abc123"}.

## `cursorArgName` (type: `string`):

The argument the read tool accepts for paging, e.g. 'start\_cursor'. Leave blank to read a single page. An audit against a partial read will wrongly report records as missing, so set this if your app pages.

## `cursorPath` (type: `string`):

Path to the next cursor in the response, e.g. 'next\_cursor' or 'paging.next'. Dot paths supported.

## `maxPages` (type: `integer`):

Hard stop on pagination. A repeated cursor also ends paging early.

## `matchKey` (type: `string`):

Field identifying a record on the source side, e.g. 'email', 'domain', 'licenseNumber'. Matching ignores case and surrounding spaces.

## `destMatchKey` (type: `string`):

Only needed when the connected app names the join field differently, e.g. 'workEmail' vs 'email'.

## `compareFields` (type: `array`):

Source field names to check for drift, e.g. phone, status, owner. Leave empty to check only whether records exist on both sides.

## `fieldMap` (type: `object`):

Only needed when a compared field is named differently in the app, e.g. {"phone": "contact.tel"}.

## `reportMissingAtDestination` (type: `boolean`):

Source rows that never made it into the connected app.

## `reportMissingInSource` (type: `boolean`):

Records in the app with no matching row in the dataset — stale entries, or rows added by someone else.

## `reportChanged` (type: `boolean`):

Records present on both sides where a compared field no longer matches.

## `includeIdentical` (type: `boolean`):

Off by default — an audit is more useful when it lists only what needs attention.

## Actor input object example

```json
{
  "mode": "audit",
  "readToolArgs": {},
  "maxPages": 10,
  "compareFields": [],
  "fieldMap": {},
  "reportMissingAtDestination": true,
  "reportMissingInSource": true,
  "reportChanged": true,
  "includeIdentical": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "readToolArgs": {},
    "compareFields": [],
    "fieldMap": {}
};

// Run the Actor and wait for it to finish
const run = await client.actor("deadwood_data_solutions/connector-diff-audit").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "readToolArgs": {},
    "compareFields": [],
    "fieldMap": {},
}

# Run the Actor and wait for it to finish
run = client.actor("deadwood_data_solutions/connector-diff-audit").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "readToolArgs": {},
  "compareFields": [],
  "fieldMap": {}
}' |
apify call deadwood_data_solutions/connector-diff-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,deadwood_data_solutions/connector-diff-audit"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/YLXWSYqfqK6oXvwjn/builds/kgx5IafMNtErOtZvd/openapi.json
