Skip to main content

Run task synchronously

GET 

/v2/actor-tasks/:actorTaskId/run-sync

Runs an Actor task and synchronously returns a key-value store record.

The response contains the record stored under the OUTPUT key in the run's default key-value store. This is a legacy approach that has been replaced by the Actor output object; Actors aren't required to store a record under this key, so the response may not contain any data. Use the outputRecordKey query parameter to return a different record.

The run must finish in 300 seconds otherwise the HTTP request fails with a timeout error (this won't abort the run itself).

Beware that it might be impossible to maintain an idle HTTP connection for an extended period, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout.

If the connection breaks, you will not receive any information about the run and its status.

To run the Task asynchronously, use the Run task asynchronously endpoint instead.

Request

Path Parameters

    actorTaskId string required

    Task ID or a tilde-separated owner's username and task's name.


    Example: janedoe~my-task

Query Parameters

    timeout double

    Optional timeout for the run, in seconds. By default, the run uses the timeout from its configuration.


    Example: 60
    memory double

    Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses the memory limit from its configuration.


    Example: 256
    maxItems double

    Specifies the maximum number of dataset items that will be charged for pay-per-result Actors. This does NOT guarantee that the Actor will return only this many items. It only ensures you won't be charged for more than this number of items. Only works for pay-per-result Actors. Value can be accessed in the actor run using ACTOR_MAX_PAID_DATASET_ITEMS environment variable.


    Example: 1000
    build string

    Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build from its configuration (typically latest).


    Example: 0.1.234
    outputRecordKey string

    Key of the record from the run's default key-value store to return in the response. Defaults to OUTPUT. Actors aren't required to store a record under this key, so if it doesn't exist the response contains no data.


    Example: OUTPUT
    webhooks string

    Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array whose items follow the WebhookRepresentation schema. For more information, see Webhooks documentation.


    Example: dGhpcyBpcyBqdXN0IGV4YW1wbGUK...

Status 201

Response Headers
    {
    "bar": "foo"
    }