Your row cap hasn't changed. Your start-fee allowance may have.

You're approving the recurring ingestion budget, and someone has increased the job's memory allocation. The input looks reassuringly familiar.

The Actor's start event is memory-dependent: one event per GB, with a minimum of one event. An event-fee ceiling needs a row limit and an upper bound on memory-dependent start events.

Example input for a public startup-listing job, with validation for the controls this launcher accepts:

import { z } from 'zod'; import assert from 'node:assert/strict'; import { ApifyClient } from 'apify-client'; const spendInput = z.object({ maxItems: z.number().int().min(1).max(1250).default(50), maxScan: z.number().int().min(0).max(1250).default(0), maxConcurrency: z.number().int().min(1).max(8).default(3), }).strict(); const run_input = spendInput.parse({ maxItems: 100, maxScan: 0, maxConcurrency: 3, }); 

The input schema has 43 optional properties. Memory isn't among them.

That separation is the trap. Reviewing the input alone can't tell you whether the start-event allowance still holds.

Why can an unchanged row limit cost more?

There are two priced events: a result saved in the default dataset and an Actor start.

“Actor Start” sounds like a flat charge for launching the job. Its quantity depends on memory, so the event's name isn't enough to budget from.

Here's where each control belongs:

Control What it constrains What it cannot establish
maxItems Listing records saved, and therefore the result-event allowance Memory-dependent start-event quantity
maxScan Public listing pages inspected A replacement for the result-event allowance
maxConcurrency Simultaneous listing-page requests Either priced-event quantity
Runtime memory approval The configuration used to establish a start-event bound How many matching records will exist

A page inspected isn't necessarily a record saved. Filters can reject listings after inspection.

Likewise, concurrency changes how requests overlap. It isn't a spending limit.

This distinction matters when someone proposes reducing concurrency to approve a larger recurring budget. You still need an explicit event calculation.

An honest ceiling can return “unknown”

Keep money in integer units throughout the calculation. Convert to a decimal string only when submitting the cap.

The function below accepts a separately approved runtime revision and an externally established start-event bound. It deliberately contains no memory-rounding formula.

These constants encode the published FREE and GOLD event prices:

const USD_SCALE = 100_000n; const prices = { FREE: { result: 99n, // $0.00099: apify-default-dataset-item start: 10_000n, // $0.10: apify-actor-start }, GOLD: { result: 49n, // $0.00049: apify-default-dataset-item start: 3_000n, // $0.03: apify-actor-start }, } as const; type Tier = keyof typeof prices; type RuntimeApproval = Readonly<{ revision: string; maxStartEvents?: number; }>; function eventCeiling( rawInput: unknown, tier: Tier, runtime: RuntimeApproval, ) { if (runtime.maxStartEvents === undefined) { throw new Error('No established start-event bound; no ceiling approved'); } const input = Object.freeze(spendInput.parse(rawInput)); const runtimeRevision = z.string().min(1).parse(runtime.revision); const maxStartEvents = z.number() .int().min(1).max(Number.MAX_SAFE_INTEGER) .parse(runtime.maxStartEvents); const resultUnits = BigInt(input.maxItems) * prices[tier].result; const startUnits = BigInt(maxStartEvents) * prices[tier].start; return Object.freeze({ input, tier, runtimeRevision, maxStartEvents, resultUnits, startUnits, eventUnits: resultUnits + startUnits, }); } function usd(units: bigint): string { if (units < 0n) throw new Error('Negative budget'); const fraction = (units % USD_SCALE).toString().padStart(5, '0'); return `${units / USD_SCALE}.${fraction}`; } 

The runtime revision is your application's approval identifier, not an Actor input property.

It should identify the memory configuration your launcher actually uses. Establish the event bound for that configuration before calling this function. If you can't establish it, refuse the budget approval.

A plausible guess makes a poor ceiling.

The strict input validator also has a deliberate boundary: it accepts only the controls shown here. Extend it with the relevant field constraints before adding selection filters. Silently dropping an unrecognized setting would make the approved job differ from the intended job.

Passing price checks don't approve the memory setting

The published examples use a single start event. They're useful arithmetic checks, but they don't establish the start quantity for an arbitrary memory allocation.

Example checks verify those prices under that explicit assumption:

const exampleRuntime: RuntimeApproval = Object.freeze({ revision: 'example-pinned-runtime', maxStartEvents: 1, }); const priceCases = [ ['FREE', 100, '0.19900'], ['GOLD', 100, '0.07900'], ['FREE', 1000, '1.09000'], ['GOLD', 1000, '0.52000'], ] as const; for (const [tier, maxItems, expectedUsd] of priceCases) { const estimate = eventCeiling( { ...run_input, maxItems }, tier, exampleRuntime, ); assert.equal(usd(estimate.eventUnits), expectedUsd); } const examplePlan = eventCeiling(run_input, 'GOLD', exampleRuntime); 

These assertions check the calculation without launching anything. They can't validate the external memory approval.

That's a useful boundary for code review. A passing price test proves the multiplication, not the premise supplied to it.

Platform usage is additional, at your plan's rates. Keep it as a separate budget component rather than presenting this event allowance as the whole run cost.

Retries spend the schedule's allowance

A recurring budget needs an execution allowance, not just a calendar expression.

Count every permitted retry as another potentially chargeable execution. A failed attempt can already have incurred charges before the scheduler tries again.

Example scheduling parameters make that allowance explicit:

function recurringEventBudget( plan: ReturnType<typeof eventCeiling>, scheduledExecutions: number, retryAllowance: number, ): bigint { const count = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER); const scheduled = BigInt(count.parse(scheduledExecutions)); const retries = BigInt(count.parse(retryAllowance)); return (scheduled + retries) * plan.eventUnits; } const periodEventUnits = recurringEventBudget(examplePlan, 30, 3); const periodEventBudgetUsd = usd(periodEventUnits); 

Here, retryAllowance means additional executions across the whole budget period. It isn't a retry allowance for each scheduled execution.

Your scheduler must enforce those execution counts. Computing an allowance doesn't stop an enthusiastic retry loop.

Overlapping jobs need the same treatment. Each launch consumes its own allowance, even when both runs are collecting the same listings.

Persist the approved input, runtime revision, tier, and budget period together. A memory change should require a new approval before the next launch. So should a larger row limit.

The submitted request needs the approved cap

Preflight estimation helps you reject an unaffordable job before it starts. A platform-side cap acts during execution.

Use both.

Pass the calculated event allowance through maxTotalChargeUsd. Submit the exact validated input used in the calculation.

This submission function also returns a manifest for downstream routing:

async function submitCapped( plan: ReturnType<typeof eventCeiling>, ) { const token = process.env.APIFY_TOKEN; if (!token) throw new Error('APIFY_TOKEN is required'); const endpoint = new URL( 'https://api.apify.com/v2/acts/' + 'nimbryxo-studio~acquire-com-public-startup-listing-financials/runs', ); endpoint.searchParams.set('maxTotalChargeUsd', usd(plan.eventUnits)); const response = await fetch(endpoint, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', }, body: JSON.stringify(plan.input), }); if (!response.ok) { throw new Error(`Run submission failed: ${response.status}`); } const launched = z.object({ data: z.object({ id: z.string().min(1) }), }).parse(await response.json()); const client = new ApifyClient({ token }); const finished = await client.run(launched.data.id).waitForFinish(); return Object.freeze({ runId: launched.data.id, datasetId: finished?.defaultDatasetId ?? null, status: finished?.status ?? 'UNRESOLVED', incomplete: finished?.status !== 'SUCCEEDED', runtimeRevision: plan.runtimeRevision, }); } 

This function is defined without submitting the example job.

The REST request doesn't set memory. Your launcher must pin the approved runtime configuration before invoking it. The revision string alone can't enforce that.

If memory changes between approval and submission, the preflight estimate loses its basis. The platform cap remains a useful backstop, but it can't promise enough allowance to finish.

Also, treat a lost submission response as an unknown outcome. Blindly repeating the request can launch another chargeable run. Record the submission attempt and reconcile it before retrying.

A readable dataset can still be incomplete

The worked example is Acquire.com Public Startup Listing Financials Extractor. The budgeting pattern applies wherever input limits and runtime settings control different charges.

The uncomfortable part comes after the cap does its job.

An interrupted run can leave saved records behind. A readable dataset doesn't prove the requested collection finished.

Persist the returned manifest beside the dataset reference before routing records:

submitted run | terminal status and run manifest | +-- SUCCEEDED --> validate records --> merge by listing identity | +-- other or unresolved --> incomplete marker --> hold publication 

A spending cap answers a billing question. It doesn't answer whether your market snapshot is safe to publish.

For acquisition monitoring, never treat missing records from an incomplete run as evidence that listings disappeared. Otherwise, a budget stop can become a false market signal.

Keep partial records available for inspection or a deliberate recovery workflow. Require an explicit decision before promoting them into a published snapshot.

Retries also need stable listing identity in your destination. Another execution may revisit records already saved by the interrupted attempt. Merge those records rather than appending every arrival.

Even SUCCEEDED means the job finished under its configured limits. It doesn't certify an exhaustive market inventory.

What the scheduler needs before launch

  • Establish the start-event bound for the pinned memory configuration.
  • Approve the exact input and runtime revision together.
  • Set the run cap from the event calculation.
  • Reserve execution allowance for retries and enforce it.
  • Budget platform usage separately.
  • Persist run status and quarantine incomplete collections.

A saved row proves collection happened. It doesn't prove collection finished.

Drafted with AI assistance and reviewed for accuracy.