RunClient
Hierarchy
- ResourceClient
- RunClient
Index
Properties
inheritedapifyClient
inheritedbaseUrl
inheritedhttpClient
optionalinheritedid
optionalinheritedparams
inheritedpublicBaseUrl
inheritedresourcePath
optionalinheritedsafeId
inheritedurl
Methods
abort
Aborts the Actor run.
Parameters
options: RunAbortOptions = {}
Abort options
Returns Promise<ActorRun>
The updated ActorRun object with
ABORTINGorABORTEDstatus
charge
Charges the Actor run for a specific event.
Parameters
options: RunChargeOptions
Charge options including event name and count.
Returns Promise<ApifyResponse<Record<string, never>>>
Empty response object.
dataset
Returns a client for the default dataset of this Actor run.
Returns DatasetClient<Record<string | number, unknown>>
A client for accessing the run's default dataset
delete
Deletes the Actor run.
Returns Promise<void>
get
Gets the Actor run object from the Apify API.
Parameters
options: RunGetOptions = {}
Get options
Returns Promise<undefined | ActorRun>
The ActorRun object, or
undefinedif it does not exist
getStreamedLog
Get StreamedLog for convenient streaming of the run log and their redirection.
Parameters
options: GetStreamedLogOptions = {}
Returns Promise<undefined | StreamedLog>
keyValueStore
Returns a client for the default key-value store of this Actor run.
Returns KeyValueStoreClient
A client for accessing the run's default key-value store
log
Returns a client for accessing the log of this Actor run.
Returns LogClient
A client for accessing the run's log
metamorph
Transforms the Actor run into a run of another Actor (metamorph).
This operation preserves the run ID, storages (dataset, key-value store, request queue), and resource allocation. The run effectively becomes a run of the target Actor with new input. This is useful for chaining Actor executions or implementing complex workflows.
Parameters
targetActorId: string
ID or username/name of the target Actor
input: unknown
Input for the target Actor. Can be any JSON-serializable value.
options: RunMetamorphOptions = {}
Metamorph options
Returns Promise<ActorRun>
The metamorphed ActorRun object (same ID, but now running the target Actor)
reboot
Reboots the Actor run.
Rebooting restarts the Actor's Docker container while preserving the run ID and storages. This can be useful to recover from certain errors or to force the Actor to restart with a fresh environment.
Returns Promise<ActorRun>
The updated ActorRun object
requestQueue
Returns a client for the default Request queue of this Actor run.
Returns RequestQueueClient
A client for accessing the run's default Request queue
resurrect
Resurrects a finished Actor run, starting it again with the same settings.
This creates a new run with the same configuration as the original run. The original run's storages (dataset, key-value store, request queue) are preserved and reused.
Parameters
options: RunResurrectOptions = {}
Resurrection options (override original run settings)
Returns Promise<ActorRun>
The new (resurrected) ActorRun object
update
Updates the Actor run with specified fields.
Parameters
newFields: RunUpdateOptions
Fields to update
Returns Promise<ActorRun>
The updated ActorRun object
waitForFinish
Waits for the Actor run to finish and returns the finished Run object.
The promise resolves when the run reaches a terminal state (
SUCCEEDED,FAILED,ABORTED, orTIMED-OUT). IfwaitSecsis provided and the timeout is reached, the promise resolves with the unfinished Run object (status will beRUNNINGorREADY). The promise is NOT rejected based on run status.Unlike the
waitForFinishparameter in get, this method can wait indefinitely by polling the run status. It uses thewaitForFinishparameter internally (max 60s per call) and continuously polls until the run finishes or the timeout is reached.Parameters
options: RunWaitForFinishOptions = {}
Wait options
Returns Promise<ActorRun>
The ActorRun object (finished or still running if timeout was reached)
Client for managing a specific Actor run.
Provides methods to get run details, abort, metamorph, resurrect, wait for completion, and access the run's dataset, key-value store, request queue, and logs.
https://docs.apify.com/platform/actors/running/runs-and-builds