> ## 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: Inputs, Cost & CLI Example

> Preferred default: running an Apify Actor and waiting for completion in one call. Includes inputs, outputs, costs, and Deepline CLI examples for GTM automation.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=apify_run_actor_sync:{"actorId":"{{actorId}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                | Type      | Required | Default | Description |
| ------------------- | --------- | -------- | ------- | ----------- |
| `payload.actorId`   | `string`  | Yes      |         |             |
| `payload.input`     | `unknown` | No       |         |             |
| `payload.params`    | `object`  | No       |         |             |
| `payload.timeoutMs` | `number`  | No       |         |             |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "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 Schema

| Name          | Type              | Required | Default | Description                                     |
| ------------- | ----------------- | -------- | ------- | ----------------------------------------------- |
| `result.data` | `array \| object` | Yes      |         | Apify sync result or pollable timeout recovery. |
| `result.meta` | `record`          | No       |         | Additional response metadata (status, paging).  |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Apify sync result envelope.",
    "properties": {
      "data": {
        "description": "Apify sync result or pollable timeout recovery.",
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          {
            "type": "object",
            "description": "Pollable recovery details for an Apify run 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>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute apify_run_actor_sync --payload '{
  "actorId": "string"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Cost

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