> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Apify: Run Actor Sync

> Run an Apify scraper actor with your input and wait for its scraped records, for a known site, profile or platform. Includes SDK V2 examples, schemas, and cost.

Run an Apify scraper actor with your input and wait for its scraped records, for a known site, profile or platform.

> [!NOTE]
>
> Tool ID: `apify_run_actor_sync`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'apify_run_actor_sync',
  {
    "actorId": "actor_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute apify_run_actor_sync --input '{
  "actorId": "actor_123"
}' --json
```

## Example response

The static output schema lacks the details for a reliable example. Use `deepline describe apify_run_actor_sync --json` for the complete live contract.

## Input reference

Apify run actor sync input.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.actorId` | `string` | Yes | — | — |
| `payload.input` | `unknown` | No | — | — |
| `payload.params` | `object` | No | — | — |
| `payload.timeoutMs` | `number` | No | — | Must be greater than 0. Maximum: 780000. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Apify run actor sync input.",
    "properties": {
      "actorId": {
        "type": "string"
      },
      "input": {},
      "params": {
        "type": "object",
        "properties": {
          "timeout": {
            "type": "number"
          },
          "memory": {
            "type": "number"
          },
          "build": {
            "type": "string"
          },
          "maxItems": {
            "type": "number"
          },
          "waitForFinish": {
            "type": "number"
          },
          "webhooks": {
            "type": "string"
          },
          "offset": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "desc": {
            "type": "boolean"
          },
          "clean": {
            "type": "boolean"
          },
          "fields": {
            "type": "string"
          },
          "omit": {
            "type": "string"
          },
          "unwind": {
            "type": "string"
          },
          "flatten": {
            "type": "string"
          },
          "view": {
            "type": "string"
          },
          "skipHidden": {
            "type": "boolean"
          },
          "skipEmpty": {
            "type": "boolean"
          },
          "skipHeaderRow": {
            "type": "boolean"
          },
          "delimiter": {
            "type": "string"
          },
          "bom": {
            "type": "boolean"
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "jsonl",
              "csv",
              "xlsx",
              "xml",
              "html",
              "rss"
            ]
          },
          "attachment": {
            "type": "boolean"
          },
          "forceCloud": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "timeoutMs": {
        "type": "number",
        "maximum": 780000,
        "exclusiveMinimum": 0
      }
    },
    "required": [
      "actorId"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Apify sync result envelope.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `array \| object` | Yes | — | Apify sync result or pending run identifiers. |
| `result.data.state` | `"awaiting_apify"` | Yes | — | — |
| `result.data.actorId` | `string` | Yes | — | — |
| `result.data.runId` | `string` | Yes | — | — |
| `result.data.datasetId` | `string \| null` | Yes | — | — |
| `result.data.next` | `object` | Yes | — | — |
| `result.data.next.getActorRun` | `object` | Yes | — | — |
| `result.data.next.getActorRun.tool` | `"apify_get_actor_run"` | Yes | — | — |
| `result.data.next.getActorRun.payload` | `object` | Yes | — | — |
| `result.data.next.getActorRun.payload.runId` | `string` | Yes | — | — |
| `result.data.next.getDatasetItems` | `object \| null` | Yes | — | — |
| `result.data.next.getDatasetItems.tool` | `"apify_get_dataset_items"` | Yes | — | — |
| `result.data.next.getDatasetItems.payload` | `object` | Yes | — | — |
| `result.data.next.getDatasetItems.payload.datasetId` | `string` | Yes | — | — |
| `result.data.next.getDatasetItems.payload.offset` | `integer` | No | — | — |
| `result.data.next.getDatasetItems.payload.limit` | `integer` | No | — | — |
| `result.data.next.getDatasetItems.payload.desc` | `boolean` | No | — | — |
| `result.data.next.getDatasetItems.payload.clean` | `boolean` | No | — | — |
| `result.data.next.getDatasetItems.payload.fields` | `string` | No | — | — |
| `result.data.next.getDatasetItems.payload.omit` | `string` | No | — | — |
| `result.data.next.getDatasetItems.payload.unwind` | `string` | No | — | — |
| `result.data.next.getDatasetItems.payload.flatten` | `string` | No | — | — |
| `result.data.next.getDatasetItems.payload.view` | `string` | No | — | — |
| `result.data.next.getDatasetItems.payload.skipHidden` | `boolean` | No | — | — |
| `result.data.next.getDatasetItems.payload.skipEmpty` | `boolean` | No | — | — |
| `result.data.next.getDatasetItems.payload.skipHeaderRow` | `boolean` | No | — | — |
| `result.data.next.getDatasetItems.payload.delimiter` | `string` | No | — | — |
| `result.data.next.getDatasetItems.payload.bom` | `boolean` | No | — | — |
| `result.data.next.getDatasetItems.payload.format` | `"json" \| "jsonl" \| "csv" \| "xlsx" \| "xml" \| "html" \| "rss"` | No | — | — |
| `result.data.next.getDatasetItems.payload.attachment` | `boolean` | No | — | — |
| `result.data.next.getDatasetItems.payload.forceCloud` | `boolean` | No | — | — |
| `result.meta` | `record` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Apify sync result envelope.",
    "properties": {
      "data": {
        "description": "Apify sync result or pending run identifiers.",
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          {
            "type": "object",
            "description": "Apify run identifiers for explicit status and dataset reads while work is still in progress.",
            "properties": {
              "state": {
                "type": "string",
                "const": "awaiting_apify"
              },
              "actorId": {
                "type": "string"
              },
              "runId": {
                "type": "string"
              },
              "datasetId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "next": {
                "type": "object",
                "properties": {
                  "getActorRun": {
                    "type": "object",
                    "properties": {
                      "tool": {
                        "type": "string",
                        "const": "apify_get_actor_run"
                      },
                      "payload": {
                        "type": "object",
                        "properties": {
                          "runId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "runId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "tool",
                      "payload"
                    ],
                    "additionalProperties": false
                  },
                  "getDatasetItems": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "tool": {
                        "type": "string",
                        "const": "apify_get_dataset_items"
                      },
                      "payload": {
                        "type": "object",
                        "properties": {
                          "datasetId": {
                            "type": "string"
                          },
                          "offset": {
                            "type": "integer"
                          },
                          "limit": {
                            "type": "integer"
                          },
                          "desc": {
                            "type": "boolean"
                          },
                          "clean": {
                            "type": "boolean"
                          },
                          "fields": {
                            "type": "string"
                          },
                          "omit": {
                            "type": "string"
                          },
                          "unwind": {
                            "type": "string"
                          },
                          "flatten": {
                            "type": "string"
                          },
                          "view": {
                            "type": "string"
                          },
                          "skipHidden": {
                            "type": "boolean"
                          },
                          "skipEmpty": {
                            "type": "boolean"
                          },
                          "skipHeaderRow": {
                            "type": "boolean"
                          },
                          "delimiter": {
                            "type": "string"
                          },
                          "bom": {
                            "type": "boolean"
                          },
                          "format": {
                            "type": "string",
                            "enum": [
                              "json",
                              "jsonl",
                              "csv",
                              "xlsx",
                              "xml",
                              "html",
                              "rss"
                            ]
                          },
                          "attachment": {
                            "type": "boolean"
                          },
                          "forceCloud": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "datasetId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "tool",
                      "payload"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "getActorRun",
                  "getDatasetItems"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "state",
              "actorId",
              "runId",
              "datasetId",
              "next"
            ],
            "additionalProperties": false
          }
        ]
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0` per pricing unit.

## Related documentation

* [Apify provider guide](https://deepline.com/docs/providers/apify/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.