# Salesforce Opportunity Close Date Slip Audit from Two CSVs (`natstandridge/salesforce-close-date-slip-audit`) Actor

Compare two bounded Opportunity exports by stable ID to find open deals whose close dates moved later. Get an importable owner review queue with exact before/after dates, days pushed, reported pipeline amount, and unmatched-record counts.

- **URL**: https://apify.com/natstandridge/salesforce-close-date-slip-audit.md
- **Developed by:** [Nathaniel Standridge](https://apify.com/natstandridge) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00 / 1,000 delivered close-date slip reviews

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Salesforce Opportunity Close Date Slip Audit

Find open opportunities whose close dates moved later between two authorized snapshots. Paste two small CSV exports with the same Opportunity IDs and get one importable review row per slipped deal. The Actor has no Salesforce connection and requires no credential. It reports **net date movement between the snapshots**, not every intervening change or a forecast outcome.

**For:** RevOps and sales managers who review pipeline dates each week before a forecast meeting. The result is a queue to verify the current date and forecast treatment with each deal owner. Salesforce's [historical trending report](https://help.salesforce.com/s/articleView?id=sf.reports_historical_opportunities.htm\&language=en_US\&type=5) already identifies pushed deals and may be the better choice if it is configured in your org. This Actor's narrower advantage is a portable CSV to review queue across two exports without setting up historical trending.

### First run

1. Run the prefilled synthetic sample in the Input tab, or paste the JSON below. It has two fake snapshots, five rows each. Two matched open deals have later close dates and produce two review rows. One deal closed, one was unchanged, and one ID appears in only each snapshot; those counts appear in the free summary. The sample costs $0.10 at $0.05 per delivered finding.
2. In an authorized Salesforce org, run the same SOQL query at two points in time and save each result as CSV. Salesforce [documents CSV output from SOQL tooling](https://developer.salesforce.com/docs/platform/webconsole/guide/execute-query.html), and the [Opportunity field reference](https://developer.salesforce.com/docs/platform/field-reference/references/field-reference/salesforce-field-reference-opportunity.html) lists the API field names below. A field may be unavailable under your org's permissions or configuration. Use a stable ID set or the same stable segment in both exports; filtering by the changing close date can create misleading unmatched records. This is a query template, not a live query tested against your account:

```sql
SELECT Id, CloseDate, IsClosed, StageName, Amount, CurrencyIsoCode, OwnerId
FROM Opportunity
ORDER BY Id
```

For a single currency org where `CurrencyIsoCode` is unavailable, omit that column from **both** queries and set `currencyCode` to the org's actual three-letter ISO currency code. CSV from a localized Salesforce report can use display labels rather than these API names; v0.2 accepts SOQL result CSV with the exact headers, not arbitrary report CSV. Salesforce's [report export guide](https://help.salesforce.com/s/articleView?id=sf.reports_export.htm\&language=en_US) describes the separate Details Only CSV export path. If a query returns over 2,000 rows, Salesforce [recommends bulk data export](https://developer.salesforce.com/docs/platform/sfdx-dev/guide/sfdx-dev-data-query.html); this Actor accepts at most 3,000 rows per snapshot.

3. Paste the earlier and later CSV into `beforeCsv` and `afterCsv`, then enter their actual UTC export times in `beforeAt` and `afterAt`. Times are user declarations; the Actor cannot verify them.
4. Review each paid dataset row and the free `OUTPUT` summary. Join `opportunityId` and `ownerId` back to your authorized Salesforce workflow. A no-slip comparison has no paid dataset rows.

#### Runnable synthetic input

```json
{
  "beforeAt": "2026-10-30T12:00:00Z",
  "afterAt": "2026-11-06T12:00:00Z",
  "beforeCsv": "Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId\nOPP_A,2026-11-15,false,Proposal,5000.00,USD,USER_A\nOPP_B,2026-11-20,false,Negotiation,2000.00,EUR,USER_B\nOPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C\nOPP_D,2026-11-25,false,Proposal,1000.00,USD,USER_D\nOPP_F,2026-12-05,false,Prospecting,150.00,USD,USER_F\n",
  "afterCsv": "Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId\nOPP_A,2026-12-15,false,Proposal,5000.00,USD,USER_A\nOPP_B,2026-11-27,false,Negotiation,2200.00,EUR,USER_B2\nOPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C\nOPP_D,2026-12-05,true,Closed Won,1000.00,USD,USER_D\nOPP_E,2026-12-20,false,Prospecting,800.00,USD,USER_E\n",
  "minDaysPushed": 1,
  "maxFindings": 25,
  "maxRunSeconds": 120
}
```

Expected paid dataset rows (selected fields):

| opportunityId | oldCloseDate | newCloseDate | daysPushed | reportedPipelineAmount | currencyCode | amountChanged |
| --- | --- | --- | --- | --- | --- | --- |
| OPP_A | 2026-11-15 | 2026-12-15 | 30 | 5000.00 | USD | false |
| OPP_B | 2026-11-20 | 2026-11-27 | 7 | 2200.00 | EUR | true |

The free `OUTPUT` summary has `status: "succeeded"`, `complete: true`, and two planned/delivered findings. It counts five rows in each snapshot, four matched IDs, one before-only ID, one after-only ID, one closed exclusion, and one unchanged/earlier date. Each paid row also includes stable `observationId`, source row numbers, owner/stage changes, and scope/interpretation text.

### Input contract

The CSV headers must be exactly `Id,CloseDate,IsClosed,StageName,Amount,OwnerId`, plus `CurrencyIsoCode` when available, in any order. Rows need a stable opaque Opportunity `Id`, ISO `YYYY-MM-DD` close date, `true`/`false` closed flag, stage, optional numeric `Amount`, and owner ID. `CurrencyIsoCode` values must be three uppercase letters. If the column is absent, provide `currencyCode` once for the whole comparison. Blank amounts remain `null`, not zero. Duplicate Opportunity IDs, malformed dates or numbers, unknown columns, spreadsheet formula text in IDs/stages, and a CSV currency that conflicts with an explicit `currencyCode` fallback are rejected before paid delivery. A currency change between snapshots is reported in the finding and sets `amountChanged`; it is not converted or rejected. A closed opportunity in either snapshot is excluded from the paid slip queue.

Each CSV is limited to 512,000 UTF-8 bytes and 3,000 data rows. Snapshots must be ordered within 93 days. `minDaysPushed` defaults to 1; only matched, open opportunities delayed at least that many calendar days produce paid findings. `maxFindings` defaults to 25 and cannot exceed 50. Exceeding it rejects the whole input before any paid write. Work time is capped at 180 seconds. Do not paste names, account details, notes, personal information, or tokens. The Actor stores pasted CSV in its Apify run input; set your data retention to match your obligations. Paid rows contain only opaque IDs and the minimal exported fields.

### How to read a finding

Every finding includes the before and after close dates, `daysPushed`, source CSV row numbers, owner, stage, and the before/after reported pipeline amounts with currency. `amountChanged`, `ownerChanged`, and `stageChanged` flag other fields that moved. `amountChanged` compares numeric amounts and currency codes: `5000.00` and `5000.000` are equal, blank is distinct from zero, and a currency change is flagged even when the numeric amount is unchanged. Amount strings retain their exported decimal precision. The after amount is a reported pipeline amount; it is **not revenue loss or an expected value**. The Actor does no currency conversion or cross-currency sum, and it cannot know whether the account is present in only one CSV because of filtering, permissions, deletion, or creation. `sourceScope` and `interpretation` state these limits on every paid row.

The free `OUTPUT` summary counts rows in each snapshot, matched IDs, before-only and after-only IDs, excluded closed deals, unchanged/earlier dates, below-threshold changes, and planned/delivered paid findings. Missing IDs are not called lost deals. Invalid input writes a safe `invalid_input` error code. CSV validation failures save an empty frozen plan; failures in the top-level input contract can occur before a plan exists. A valid no-slip comparison has `status=empty` and no paid rows.

### Pricing and reliability

The price is **$0.05 per delivered slipped Opportunity finding** using Apify's native `apify-default-dataset-item` event. There is no start charge. Invalid, empty, filtered, and undelivered results are uncharged. The two-finding synthetic sample costs **$0.10**. Set the run charge limit high enough to cover all findings; otherwise the run returns an incomplete summary with no paid rows. Synthetic tests do not establish paying customer demand.

The complete plan is frozen before delivery. Cloud dataset writes use a client with automatic retries disabled and a pending-row checkpoint. Restarts compare existing rows with the frozen plan and the native event count before writing. Unknown write outcomes stop without replay. If the charge cap cannot cover all planned rows, the Actor emits an incomplete free summary and zero paid rows.

### Local verification

From this directory, run `uv run --frozen pytest -q` and `uv run --frozen python -B tools/local_smoke.py examples/local-validation.json`. The local synthetic examples and `examples/release-spec.json` provide full, capped, empty, invalid, and same-run resurrection oracles. Local checks are separate from cloud output, billing, and cost qualification.

# Actor input Schema

## `beforeCsv` (type: `string`):

Paste a CSV exported from an authorized Salesforce Opportunity SOQL query. Required API headers in any order: Id, CloseDate, IsClosed, StageName, Amount, OwnerId. Include CurrencyIsoCode for multicurrency orgs; for a single-currency org set currencyCode instead. No names, account details, notes, or credentials. Up to 3,000 data rows and 512,000 UTF-8 bytes.

## `afterCsv` (type: `string`):

Use the same authorized SOQL query and field set as the earlier snapshot. Full or consistently filtered exports are required to interpret missing IDs; the Actor cannot verify completeness. A header-only CSV is a free empty result.

## `beforeAt` (type: `string`):

User-declared export time for beforeCsv.

## `afterAt` (type: `string`):

Must be later than beforeAt and at most 93 days apart. These times are declared, not verified.

## `currencyCode` (type: `string`):

Set this three-letter ISO currency code only when CurrencyIsoCode is absent from both CSVs. A present CSV currency must agree. Do not use to convert amounts.

## `minDaysPushed` (type: `integer`):

Only matched opportunities that were open in both snapshots and moved at least this many calendar days produce paid rows.

## `maxFindings` (type: `integer`):

Hard cap. If more opportunities qualify, the entire input is rejected before paid delivery; narrow the snapshots or raise this limit.

## `maxRunSeconds` (type: `integer`):

Bounds parsing, checkpointing, and paid dataset delivery.

## Actor input object example

```json
{
  "beforeCsv": "Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId\nOPP_A,2026-11-15,false,Proposal,5000.00,USD,USER_A\nOPP_B,2026-11-20,false,Negotiation,2000.00,EUR,USER_B\nOPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C\nOPP_D,2026-11-25,false,Proposal,1000.00,USD,USER_D\nOPP_F,2026-12-05,false,Prospecting,150.00,USD,USER_F\n",
  "afterCsv": "Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId\nOPP_A,2026-12-15,false,Proposal,5000.00,USD,USER_A\nOPP_B,2026-11-27,false,Negotiation,2200.00,EUR,USER_B2\nOPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C\nOPP_D,2026-12-05,true,Closed Won,1000.00,USD,USER_D\nOPP_E,2026-12-20,false,Prospecting,800.00,USD,USER_E\n",
  "beforeAt": "2026-10-30T12:00:00Z",
  "afterAt": "2026-11-06T12:00:00Z",
  "minDaysPushed": 1,
  "maxFindings": 25,
  "maxRunSeconds": 120
}
```

# Actor output Schema

## `findings` (type: `string`):

No description

## `summary` (type: `string`):

No description

# 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 = {
    "beforeCsv": `Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId
OPP_A,2026-11-15,false,Proposal,5000.00,USD,USER_A
OPP_B,2026-11-20,false,Negotiation,2000.00,EUR,USER_B
OPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C
OPP_D,2026-11-25,false,Proposal,1000.00,USD,USER_D
OPP_F,2026-12-05,false,Prospecting,150.00,USD,USER_F`,
    "afterCsv": `Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId
OPP_A,2026-12-15,false,Proposal,5000.00,USD,USER_A
OPP_B,2026-11-27,false,Negotiation,2200.00,EUR,USER_B2
OPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C
OPP_D,2026-12-05,true,Closed Won,1000.00,USD,USER_D
OPP_E,2026-12-20,false,Prospecting,800.00,USD,USER_E`,
    "beforeAt": "2026-10-30T12:00:00Z",
    "afterAt": "2026-11-06T12:00:00Z",
    "minDaysPushed": 1,
    "maxFindings": 25,
    "maxRunSeconds": 120
};

// Run the Actor and wait for it to finish
const run = await client.actor("natstandridge/salesforce-close-date-slip-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 = {
    "beforeCsv": """Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId
OPP_A,2026-11-15,false,Proposal,5000.00,USD,USER_A
OPP_B,2026-11-20,false,Negotiation,2000.00,EUR,USER_B
OPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C
OPP_D,2026-11-25,false,Proposal,1000.00,USD,USER_D
OPP_F,2026-12-05,false,Prospecting,150.00,USD,USER_F
""",
    "afterCsv": """Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId
OPP_A,2026-12-15,false,Proposal,5000.00,USD,USER_A
OPP_B,2026-11-27,false,Negotiation,2200.00,EUR,USER_B2
OPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C
OPP_D,2026-12-05,true,Closed Won,1000.00,USD,USER_D
OPP_E,2026-12-20,false,Prospecting,800.00,USD,USER_E
""",
    "beforeAt": "2026-10-30T12:00:00Z",
    "afterAt": "2026-11-06T12:00:00Z",
    "minDaysPushed": 1,
    "maxFindings": 25,
    "maxRunSeconds": 120,
}

# Run the Actor and wait for it to finish
run = client.actor("natstandridge/salesforce-close-date-slip-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 '{
  "beforeCsv": "Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId\\nOPP_A,2026-11-15,false,Proposal,5000.00,USD,USER_A\\nOPP_B,2026-11-20,false,Negotiation,2000.00,EUR,USER_B\\nOPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C\\nOPP_D,2026-11-25,false,Proposal,1000.00,USD,USER_D\\nOPP_F,2026-12-05,false,Prospecting,150.00,USD,USER_F\\n",
  "afterCsv": "Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId\\nOPP_A,2026-12-15,false,Proposal,5000.00,USD,USER_A\\nOPP_B,2026-11-27,false,Negotiation,2200.00,EUR,USER_B2\\nOPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C\\nOPP_D,2026-12-05,true,Closed Won,1000.00,USD,USER_D\\nOPP_E,2026-12-20,false,Prospecting,800.00,USD,USER_E\\n",
  "beforeAt": "2026-10-30T12:00:00Z",
  "afterAt": "2026-11-06T12:00:00Z",
  "minDaysPushed": 1,
  "maxFindings": 25,
  "maxRunSeconds": 120
}' |
apify call natstandridge/salesforce-close-date-slip-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,natstandridge/salesforce-close-date-slip-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/t8tKgVCYEnWFM5TUu/builds/X8dJcNdNNMYemnrIP/openapi.json
