Skip to content

Improve apify builds create for async and waited workflows #1138

@patrikbraborec

Description

@patrikbraborec

Summary

Improve apify builds create for agentic workflows by adding --wait and clearer async follow-up output.

Problem

apify builds create starts a build. Agents need an easy way to either wait for the final build status or get concrete next commands for async debugging.

Proposal

Add:

apify builds create --wait --json

When --wait is used, the command should:

  • create the build,
  • wait for terminal status,
  • return 0 only when the build succeeds,
  • return non-zero for FAILED, TIMED_OUT, and ABORTED,
  • include final build status in --json.

When --wait is not used, improve the output with concrete IDs and copy-pasteable commands:

Build started.

Actor: test-broken-actor (M4wKY3jNvHeoT87xA)
Build ID: abcdef123456789
Build number: 0.0.1
Status: RUNNING

This command does not wait for the build to finish.

To wait for the final status:
  apify builds wait abcdef123456789 --json

To inspect logs:
  apify builds log abcdef123456789

To inspect build metadata:
  apify builds info abcdef123456789 --json

Desired JSON output without --wait

{
  "ok": true,
  "operation": "builds.create",
  "waited": false,
  "actor": {
    "id": "M4wKY3jNvHeoT87xA",
    "name": "test-broken-actor"
  },
  "build": {
    "id": "abcdef123456789",
    "number": "0.0.1",
    "status": "RUNNING",
    "url": "https://console.apify.com/actors/M4wKY3jNvHeoT87xA#/builds/0.0.1"
  },
  "next": {
    "wait": "apify builds wait abcdef123456789 --json",
    "log": "apify builds log abcdef123456789",
    "info": "apify builds info abcdef123456789 --json"
  }
}

Acceptance criteria

  • apify builds create --wait waits for final build status.
  • apify builds create --wait --json returns final structured JSON.
  • Async output includes the concrete build ID.
  • Async output includes copy-pasteable wait/log/info commands.

Metadata

Metadata

Assignees

Labels

t-dxIssues owned by the DX team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions