Portal Community

When to Use

How it works: This operation internally calls actor/run with waitForFinish: true, then immediately fetches the run's default dataset items. The DatasetOffset, DatasetLimit, DatasetFields, and DatasetOmit parameters control what slice of the dataset is returned. For actors producing large datasets, use DatasetLimit to return only the first N items in this call, then page through the rest with dataset/getItems using the run's defaultDatasetId.

Configuration

Connection

FieldRequiredDescription
credentialIdRequiredBizFirstAI credential ID holding the Apify API token.
baseUrlOptionalApify API base URL. Defaults to https://api.apify.com.

Operation

Field (config key)RequiredDescription
resourceRequiredMust be "actor".
operationRequiredMust be "run-and-get-dataset-items".
actorIdRequiredActor to run. Accepts username~actor-name or raw actor ID. Supports BizFirst expressions.
customBodyOptionalJSON string passed as actor input. If omitted, the actor uses its default input.
timeoutOptionalActor run timeout in seconds (1–86400). The node waits this long for the actor to finish before routing to the error port.
memoryOptionalMemory in MB. Valid: 128, 256, 512, 1024 (default), 2048, 4096, 8192, 16384, 32768.
buildOptionalActor build tag. Defaults to "latest". Pin to a version tag for production stability.
datasetOffsetOptionalNumber of dataset items to skip before returning results. Default 0. Must be non-negative.
datasetLimitOptionalMaximum number of items to return from the dataset. Default 50. Valid range: 1–10000.
datasetFieldsOptionalComma-separated list of field names to include in each returned item. Omit to return all fields.
datasetOmitOptionalComma-separated list of field names to exclude from each returned item. Takes effect after datasetFields projection.

Sample Configuration

{
  "resource": "actor",
  "operation": "run-and-get-dataset-items",
  "credentialId": "apify-prod-token",
  "actorId": "apify~google-search-scraper",
  "customBody": "{\"queries\":[\"best CRM software 2026\",\"top project management tools\"],\"maxPagesPerQuery\":3,\"resultsPerPage\":10}",
  "timeout": "180",
  "memory": "1024",
  "build": "latest",
  "datasetOffset": "0",
  "datasetLimit": "50",
  "datasetFields": "title,url,description,position",
  "datasetOmit": ""
}

Validation Errors

ErrorCause
API token is requiredcredentialId / apiToken is missing or empty.
Actor ID is requiredactorId is missing or empty.
Invalid settings for actor/run-and-get-dataset-itemsInternal type mismatch. Verify resource and operation values.
APIFY_ERROR (error port)Actor run failed, timed out, invalid actor ID, or the dataset fetch returned an error after the run.

Output

Success Port

FieldTypeDescription
itemsarrayArray of dataset item objects. Each item is a plain object whose fields are defined by the actor's output schema and filtered by datasetFields / datasetOmit.
itemCountnumberNumber of items in the items array for this response. May be less than datasetLimit if the dataset contains fewer items.

Error Port

Routes here when the actor run fails (FAILED or TIMED-OUT status), the actor ID is invalid, API authentication fails, or the dataset fetch fails after a successful run. Output contains errorCode ("APIFY_ERROR") and message.

Sample Output

{
  "items": [
    {
      "title": "Best CRM Software of 2026",
      "url": "https://www.g2.com/categories/crm",
      "description": "Find and compare the best CRM software solutions for businesses of all sizes.",
      "position": 1
    },
    {
      "title": "Top 10 CRM Platforms Compared — Forbes Advisor",
      "url": "https://www.forbes.com/advisor/business/best-crm-software/",
      "description": "Our experts have tested and ranked the top CRM systems available in 2026.",
      "position": 2
    }
  ],
  "itemCount": 2
}

Expression Reference

ExpressionReturns
{{ $output.apify.items }}Full array of extracted dataset items.
{{ $output.apify.itemCount }}Number of items returned.
{{ $output.apify.items[0] }}First item in the result set.
{{ $output.apify.items[0].url }}URL field of the first item (field name depends on actor schema).
{{ $output.apify.items[0].title }}Title field of the first item.

Node Policies & GuardRails

PolicyRecommendationSeverity
API token storageUse credentialId; never embed raw tokens.Critical
Timeout requiredAlways set timeout. Without it, a stalled actor run blocks the workflow for up to 24 hours.Critical
Dataset volume capSet datasetLimit to a sensible maximum (e.g. 100–500) to avoid memory pressure from very large datasets. Paginate with dataset/getItems for larger volumes.High
Field projectionUse datasetFields to return only the columns your workflow needs. Large objects with many unused fields slow serialization and increase workflow execution memory.Medium
Build pinningPin build in production so actor updates don't silently change output field names and break downstream data mapping.Medium
Memory allocationMatch memory to the actor's requirements. Under-allocating causes actor crashes routed to the error port; over-allocating increases cost unnecessarily.Medium
Error port handlingConnect the error port. A timed-out actor run routes here — the workflow should alert and not silently drop data.Medium

Examples

Google Search Results — SEO Competitive Analysis

{
  "resource": "actor",
  "operation": "run-and-get-dataset-items",
  "credentialId": "apify-seo-token",
  "actorId": "apify~google-search-scraper",
  "customBody": "{\"queries\":[\"{{ $input.keyword }}\"],\"maxPagesPerQuery\":5,\"resultsPerPage\":10,\"countryCode\":\"us\",\"languageCode\":\"en\"}",
  "timeout": "240",
  "memory": "1024",
  "datasetLimit": "50",
  "datasetFields": "title,url,description,position,domain"
}

The search keyword is dynamically injected from the workflow input. The node returns the top 50 search results with only the fields needed for competitive analysis, then passes the items array to a DataMapping node for enrichment.

E-Commerce Product Price Scrape

{
  "resource": "actor",
  "operation": "run-and-get-dataset-items",
  "credentialId": "apify-prod-token",
  "actorId": "apify~cheerio-scraper",
  "customBody": "{\"startUrls\":[{\"url\":\"https://shop.competitor.com/electronics\"}],\"pseudoUrls\":[{\"purl\":\"https://shop.competitor.com/product/[.*]\"}],\"maxPagesPerCrawl\":100,\"pageFunction\":\"async ({$, request}) => ({url: request.url, name: $('h1').text().trim(), price: $('.price-now').text().trim(), inStock: !$('.out-of-stock').length})\"}",
  "timeout": "600",
  "memory": "2048",
  "datasetLimit": "500",
  "datasetFields": "url,name,price,inStock",
  "datasetOmit": ""
}

Crawls a competitor product catalogue with a Cheerio scraper. The custom page function extracts name, price, and stock status. Returns up to 500 products using field projection to keep the payload lean before loading into a pricing database.

Paginated Dataset via Loop

// First call — get items 0-99
{
  "resource": "actor",
  "operation": "run-and-get-dataset-items",
  "credentialId": "apify-prod-token",
  "actorId": "apify~web-scraper",
  "customBody": "{ \"startUrls\": [{\"url\": \"https://data-source.com\"}] }",
  "timeout": "300",
  "memory": "1024",
  "datasetOffset": "0",
  "datasetLimit": "100"
}
// If itemCount === 100, continue pagination with dataset/getItems
// using defaultDatasetId from actor/run output and offset 100, 200, etc.

When itemCount equals datasetLimit, assume there are more pages. Use dataset/getItems with the dataset ID (obtainable via actor/run) and incrementing offset values to retrieve subsequent pages inside a Loop node.