TaskClient
Hierarchy
- ResourceClient
- TaskClient
Index
Properties
inheritedapifyClient
inheritedbaseUrl
inheritedhttpClient
optionalinheritedid
optionalinheritedparams
inheritedpublicBaseUrl
inheritedresourcePath
optionalinheritedsafeId
inheritedurl
Methods
call
Starts a task and waits for it to finish before returning the Run object. It waits indefinitely, unless the
waitSecsoption is provided.Parameters
optionalinput: Dictionary
Input overrides for the task. If not provided, the task's saved input is used.
options: TaskCallOptions = {}
Run and wait options.
Returns Promise<ActorRun>
The Actor run object.
delete
Deletes the Task.
Returns Promise<void>
See more at https://docs.apify.com/api/v2/actor-task-delete
get
Retrieves the Actor task.
Returns Promise<undefined | Task>
The task object, or
undefinedif it does not exist.See more at https://docs.apify.com/api/v2/actor-task-get
getInput
Retrieves the Actor task's input object.
Returns Promise<undefined | Dictionary | Dictionary[]>
The Task's input, or
undefinedif it does not exist.
lastRun
Returns a client for the last run of this task.
Parameters
options: TaskLastRunOptions = {}
Filter options for the last run.
Returns RunClient
A client for the last run.
publish
Publishes the task on its public landing page, by setting
isPublicthrough TaskClient.update.The task's Actor must be public and the task must have its public display configuration (
publicConfig) set up first. Requires write permission to both the task and its Actor. Publishing an already published task does nothing.Returns Promise<Task>
The task object.
See more at https://docs.apify.com/api/v2/actor-task-put
runs
Returns a client for the Runs of this Task.
Returns RunCollectionClient
A client for the task's runs.
start
Starts an Actor task and immediately returns the Run object.
Parameters
optionalinput: Dictionary
Input overrides for the task. If not provided, the task's saved input is used.
options: TaskStartOptions = {}
Run options.
Returns Promise<ActorRun>
The Actor Run object.
unpublish
Unpublishes the task from its public landing page, by setting
isPublicthrough TaskClient.update.The public display configuration (
publicConfig) is preserved, so the task can be published again without re-entering it. Requires write permission to both the task and its Actor. Unpublishing a task that is not published does nothing.Returns Promise<Task>
The task object.
See more at https://docs.apify.com/api/v2/actor-task-put
update
Updates the task with the specified fields.
Parameters
newFields: TaskUpdateData
Fields to update.
Returns Promise<Task>
The updated task object.
See more at https://docs.apify.com/api/v2/actor-task-put
updateInput
Updates the Actor task's input object.
Parameters
newFields: Dictionary | Dictionary[]
New input data for the task.
Returns Promise<Dictionary | Dictionary[]>
The updated task input.
webhooks
Returns a client for the Webhooks of this Task.
Returns WebhookCollectionClient
A client for the task's webhooks.
Client for managing a specific Actor task.
Tasks are pre-configured Actor runs with saved input and options. This client provides methods to start, call, update, and delete tasks, as well as manage their runs and webhooks.