# Apify (/integrations/apify)



{/* MANUAL-CONTENT-START:intro */}

[Apify](https://apify.com/) runs Actors for web scraping and browser automation. Run an Actor synchronously when it can finish within the synchronous endpoint’s five-minute limit. &#x2A;*Run Actor (Async)** starts a provider run and polls it within the same Sim step; it does not return immediately for detached processing. Its polling budget follows Sim’s default synchronous execution timeout. If that wait ends before the Actor finishes, use the returned run ID with **Get Run**, then retrieve dataset items after success. You can also run saved Actor tasks and fetch dataset items directly.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Run any Apify actor or saved task with custom input, fetch dataset items, and check run status. Supports both synchronous and asynchronous execution with automatic dataset fetching.

## Actions [#actions]

### APIFY Run Actor (Sync) [#apify-run-actor-sync]

Run an APIFY actor synchronously and get results (max 5 minutes)

#### Input [#input]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | APIFY API token from console.apify.com/account#/integrations |
| `actorId` | string | Yes | Actor ID or username/actor-name. Examples: "apify/web-scraper", "janedoe/my-actor", "moJRLRc85AitArpNN" |
| `input` | string | No | Actor input as JSON string. Example: \{ "startUrls": \[ \{ "url": "[https://example.com](https://example.com)" } ], "maxPages": 10 } |
| `memory` | number | No | Memory in megabytes allocated for the actor run (128-32768). Example: 1024 for 1GB, 2048 for 2GB |
| `timeout` | number | No | Timeout in seconds for the actor run. Example: 300 for 5 minutes, 3600 for 1 hour |
| `build` | string | No | Actor build to run. Examples: "latest", "beta", "1.2.3", "build-tag-name" |

#### Output [#output]

| Parameter | Type | Description |
| - | - | - |
| `success` | boolean | Whether the actor run succeeded |
| `runId` | string | APIFY run ID |
| `status` | string | Run status (SUCCEEDED, FAILED, etc.) |
| `items` | array | Dataset items (if completed) |

### APIFY Run Actor (Async) [#apify-run-actor-async]

Start an APIFY Actor run and poll it within the same workflow step until completion or the polling deadline

#### Input [#input-1]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | APIFY API token from console.apify.com/account#/integrations |
| `actorId` | string | Yes | Actor ID or username/actor-name. Examples: "apify/web-scraper", "janedoe/my-actor", "moJRLRc85AitArpNN" |
| `input` | string | No | Actor input as JSON string. Example: \{ "startUrls": \[ \{ "url": "[https://example.com](https://example.com)" } ], "maxPages": 10 } |
| `waitForFinish` | number | No | Initial wait time in seconds (0-60) before polling starts. Example: 30 |
| `itemLimit` | number | No | Max dataset items to fetch (1-250000). Default: 100. Example: 500 |
| `memory` | number | No | Memory in megabytes allocated for the actor run (128-32768). Example: 1024 for 1GB, 2048 for 2GB |
| `timeout` | number | No | Timeout in seconds for the actor run. Example: 300 for 5 minutes, 3600 for 1 hour |
| `build` | string | No | Actor build to run. Examples: "latest", "beta", "1.2.3", "build-tag-name" |

#### Output [#output-1]

| Parameter | Type | Description |
| - | - | - |
| `success` | boolean | Whether the actor run succeeded |
| `runId` | string | APIFY run ID |
| `status` | string | Run status (SUCCEEDED, FAILED, etc.) |
| `datasetId` | string | Dataset ID containing results |
| `items` | array | Dataset items (if completed) |

### APIFY Run Task [#apify-run-task]

Run a saved APIFY actor task synchronously and get dataset items (max 5 minutes)

#### Input [#input-2]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | APIFY API token from console.apify.com/account#/integrations |
| `taskId` | string | Yes | Task ID or username/task-name. Examples: "janedoe/my-task", "moJRLRc85AitArpNN" |
| `input` | string | No | JSON string that overrides the task's saved input. Example: \{ "startUrls": \[ \{ "url": "[https://example.com](https://example.com)" } ] } |
| `itemLimit` | number | No | Max dataset items to return (1-250000). Example: 500 |
| `memory` | number | No | Memory in megabytes allocated for the run (128-32768). Example: 1024 for 1GB |
| `timeout` | number | No | Timeout in seconds for the run. Example: 300 for 5 minutes |
| `build` | string | No | Actor build to run. Examples: "latest", "beta", "1.2.3" |

#### Output [#output-2]

| Parameter | Type | Description |
| - | - | - |
| `success` | boolean | Whether the task run succeeded |
| `status` | string | Run status (SUCCEEDED, FAILED, etc.) |
| `items` | array | Dataset items produced by the run |

### APIFY Get Dataset Items [#apify-get-dataset-items]

Retrieve items stored in an APIFY dataset

#### Input [#input-3]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | APIFY API token from console.apify.com/account#/integrations |
| `datasetId` | string | Yes | Dataset ID to read items from. Example: "9RnD3Pql2vGZkc5H5" |
| `itemLimit` | number | No | Max items to return (1-250000). Default: all items. Example: 500 |
| `offset` | number | No | Number of items to skip at the start. Default: 0 |
| `fields` | string | No | Comma-separated list of fields to include. Example: "title,url,price" |

#### Output [#output-3]

| Parameter | Type | Description |
| - | - | - |
| `success` | boolean | Whether the items were retrieved |
| `datasetId` | string | Dataset ID the items were read from |
| `items` | array | Items stored in the dataset |
| `count` | number | Number of items returned |

### APIFY Get Run [#apify-get-run]

Get the status and details of an APIFY actor run

#### Input [#input-4]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | APIFY API token from console.apify.com/account#/integrations |
| `runId` | string | Yes | Actor run ID to fetch. Example: "HG7ML7M8z78YcAPEB" |

#### Output [#output-4]

| Parameter | Type | Description |
| - | - | - |
| `success` | boolean | Whether the run was found |
| `runId` | string | APIFY run ID |
| `status` | string | Run status (READY, RUNNING, SUCCEEDED, FAILED, etc.) |
| `startedAt` | string | When the run started (ISO timestamp) |
| `finishedAt` | string | When the run finished (ISO timestamp) |
| `datasetId` | string | Default dataset ID for the run |
| `keyValueStoreId` | string | Default key-value store ID for the run |
| `stats` | json | Run statistics (memory, CPU, duration) |
