TaskClientAsync
apify_client.clients.TaskClientAsync
Index
Methods
call
Start a task and wait for it to finish before returning the Run object.
It waits indefinitely, unless the wait_secs argument is provided.
https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
Parameters
task_input: dict | None = Nonekeyword-only
Task input dictionary
build: str | None = Nonekeyword-only
Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest).
max_items: int | None = Nonekeyword-only
Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit.
memory_mbytes: int | None = Nonekeyword-only
Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the task settings.
timeout_secs: int | None = Nonekeyword-only
Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings.
webhooks: list[dict] | None = Nonekeyword-only
Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. Note: if you already have a webhook set up for the Actor or task, you do not have to add it again here.
wait_secs: int | None = Nonekeyword-only
The maximum number of seconds the server waits for the task run to finish. If not provided, waits indefinitely.
Returns dict | None
The run object
delete
Returns None
get
Retrieve the task.
https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/get-task
Returns dict | None
The retrieved task
get_input
Retrieve the default input for this task.
https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/get-task-input
Returns dict | None
Retrieved task input
last_run
Retrieve the client for the last run of this task.
Last run is retrieved based on the start time of the runs.
Parameters
status: ActorJobStatus | None = Nonekeyword-only
Consider only runs with this status.
origin: MetaOrigin | None = Nonekeyword-only
Consider only runs started with this origin.
Returns RunClientAsync
The resource client for the last run of this task.
runs
Retrieve a client for the runs of this task.
Returns RunCollectionClientAsync
start
Start the task and immediately return the Run object.
https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
Parameters
task_input: dict | None = Nonekeyword-only
Task input dictionary
build: str | None = Nonekeyword-only
Specifies the Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest).
max_items: int | None = Nonekeyword-only
Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit.
memory_mbytes: int | None = Nonekeyword-only
Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the task settings.
timeout_secs: int | None = Nonekeyword-only
Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings.
wait_for_finish: int | None = Nonekeyword-only
The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60.
webhooks: list[dict] | None = Nonekeyword-only
Optional ad-hoc webhooks (https://docs.apify.com/webhooks/ad-hoc-webhooks) associated with the Actor run which can be used to receive a notification, e.g. when the Actor finished or failed. If you already have a webhook set up for the Actor or task, you do not have to add it again here. Each webhook is represented by a dictionary containing these items: *
`event_types`
: list of`WebhookEventType`
values which trigger the webhook *`request_url`
: URL to which to send the webhook HTTP request *`payload_template`
(optional): Optional template for the request payload
Returns dict
The run object
update
Update the task with specified fields.
https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/update-task
Parameters
name: str | None = Nonekeyword-only
Name of the task
task_input: dict | None = Nonekeyword-only
Task input dictionary
build: str | None = Nonekeyword-only
Actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically latest).
max_items: int | None = Nonekeyword-only
Maximum number of results that will be returned by this run. If the Actor is charged per result, you will not be charged for more results than the given limit.
memory_mbytes: int | None = Nonekeyword-only
Memory limit for the run, in megabytes. By default, the run uses a memory limit specified in the task settings.
timeout_secs: int | None = Nonekeyword-only
Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings.
title: str | None = Nonekeyword-only
A human-friendly equivalent of the name
actor_standby_desired_requests_per_actor_run: int | None = Nonekeyword-only
The desired number of concurrent HTTP requests for a single Actor Standby run.
actor_standby_max_requests_per_actor_run: int | None = Nonekeyword-only
The maximum number of concurrent HTTP requests for a single Actor Standby run.
actor_standby_idle_timeout_secs: int | None = Nonekeyword-only
If the Actor run does not receive any requests for this time, it will be shut down.
actor_standby_build: str | None = Nonekeyword-only
The build tag or number to run when the Actor is in Standby mode.
actor_standby_memory_mbytes: int | None = Nonekeyword-only
The memory in megabytes to use when the Actor is in Standby mode.
Returns dict
The updated task
update_input
Update the default input for this task.
https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input
Parameters
task_input: dictkeyword-only
Returns dict
webhooks
Retrieve a client for webhooks associated with this task.
Returns WebhookCollectionClientAsync
Async sub-client for manipulating a single task.