BuildClient
Hierarchy
- ResourceClient
- BuildClient
Index
Properties
inheritedapifyClient
inheritedbaseUrl
inheritedhttpClient
optionalinheritedid
optionalinheritedparams
inheritedpublicBaseUrl
inheritedresourcePath
optionalinheritedsafeId
inheritedurl
Methods
abort
Aborts the Actor build.
Stops the build process immediately. The build will have an
ABORTEDstatus.Returns Promise<Build>
The updated Build object with
ABORTEDstatusawait client.build('build-id').abort();
delete
Deletes the Actor build.
Returns Promise<void>
See more at https://docs.apify.com/api/v2/actor-build-delete
get
Gets the Actor build object from the Apify API.
Parameters
options: BuildClientGetOptions = {}
Get options
Returns Promise<undefined | Build>
The Build object, or
undefinedif it does not exist// Get build status immediatelyconst build = await client.build('build-id').get();console.log(`Status: ${build.status}`);// Wait up to 60 seconds for build to finishconst build = await client.build('build-id').get({ waitForFinish: 60 });See more at https://docs.apify.com/api/v2/actor-build-get
getOpenApiDefinition
Retrieves the OpenAPI definition for the Actor build.
Returns Promise<OpenApiDefinition>
The OpenAPI definition object.
log
Returns a client for accessing the log of this Actor build.
Returns LogClient
A client for accessing the build's log
// Get build logconst log = await client.build('build-id').log().get();console.log(log);
waitForFinish
Waits for the Actor build to finish and returns the finished Build object.
The promise resolves when the build reaches a terminal state (
SUCCEEDED,FAILED,ABORTED, orTIMED-OUT). IfwaitSecsis provided and the timeout is reached, the promise resolves with the unfinished Build object (status will beRUNNINGorREADY). The promise is NOT rejected based on build status.Unlike the
waitForFinishparameter in get, this method can wait indefinitely by polling the build status. It uses thewaitForFinishparameter internally (max 60s per call) and continuously polls until the build finishes or the timeout is reached.This is useful when you need to immediately start a run after a build finishes.
Parameters
options: BuildClientWaitForFinishOptions = {}
Wait options
Returns Promise<Build>
The Build object (finished or still building if timeout was reached)
// Wait indefinitely for build to finishconst build = await client.build('build-id').waitForFinish();console.log(`Build finished with status: ${build.status}`);// Start a run immediately after build succeedsconst build = await client.build('build-id').waitForFinish();if (build.status === 'SUCCEEDED') {const run = await client.actor('my-actor').start();}
Client for managing a specific Actor build.
Builds are created when an Actor is built from source code. This client provides methods to get build details, wait for the build to finish, abort it, and access its logs.