Skip to content

client.workflow_batch

Bases: SyncResource

Sync bulk/batch workflow namespace (client.workflow_batch).

batch_assign

batch_assign(project_id: UUID | str, *, asset_ids: list[UUID | str], user_id: UUID | str) -> BatchAssignResult

Sync-assign up to 1000 explicit asset_ids to user_id (Manager+). To-label rows flip to in_progress; rows already assigned to user_id come back as skipped. For larger / filter-driven selections use :meth:bulk_assign.

Parameters:

Name Type Description Default
user_id UUID | str

assignee — must be a tenant member that is a project member or a workspace admin (validated before any row is touched).

required

Raises:

Type Description
PayloadTooLargeError

asset_ids exceeds 1000 (PAYLOAD_TOO_LARGE).

NotFoundError

unknown project (PROJECT_NOT_FOUND) or unknown assignee (USER_NOT_FOUND).

BadRequestError

assignee is not a member of this project (BAD_REQUEST).

ForbiddenError

caller is not a project manager (AUTH_FORBIDDEN).

UnprocessableError

empty asset_ids (VALIDATION_ERROR).

bulk_assign

bulk_assign(project_id: UUID | str, *, user_id: UUID | str, asset_ids: list[UUID | str] | None = None, filter: dict[str, Any] | None = None, exclude_asset_ids: list[UUID | str] | None = None, idempotency_key: str | None = None) -> JobHandle

Kick off an async assign of every matching asset to user_id (Manager+); returns a :class:JobHandle (202). Pass EXACTLY ONE of asset_ids or filter (a ProjectFilter); exclude_asset_ids is filter-mode only. To-label rows flip to in_progress; rows already assigned to user_id are silently skipped.

Parameters:

Name Type Description Default
user_id UUID | str

assignee — validated at job-create time (must be a tenant member that is a project member or workspace admin) so the job never enqueues a bad assignee.

required

Raises:

Type Description
ConflictError

idempotency key reused with a different body (IDEMPOTENCY_REPLAY).

RateLimitError

per-tenant active-job cap reached (JOB_PER_TENANT_CAP).

NotFoundError

unknown project (PROJECT_NOT_FOUND) or unknown assignee (USER_NOT_FOUND).

BadRequestError

assignee is not a member of this project (BAD_REQUEST).

ForbiddenError

caller is not a project manager (AUTH_FORBIDDEN).

UnprocessableError

neither/both of asset_ids/filter, empty asset_ids, or excludes with asset_ids (VALIDATION_ERROR).

batch_unassign

batch_unassign(project_id: UUID | str, *, asset_ids: list[UUID | str]) -> BatchUnassignResult

Sync-clear the assignee on up to 1000 explicit asset_ids (Manager+). in_progress rows revert to to_label; already-unassigned rows come back as skipped. For larger / filter-driven selections use :meth:bulk_unassign.

Raises:

Type Description
PayloadTooLargeError

asset_ids exceeds 1000 (PAYLOAD_TOO_LARGE).

NotFoundError

unknown project (PROJECT_NOT_FOUND).

ForbiddenError

caller is not a project manager (AUTH_FORBIDDEN).

UnprocessableError

empty asset_ids (VALIDATION_ERROR).

bulk_unassign

bulk_unassign(project_id: UUID | str, *, asset_ids: list[UUID | str] | None = None, filter: dict[str, Any] | None = None, exclude_asset_ids: list[UUID | str] | None = None, idempotency_key: str | None = None) -> JobHandle

Kick off an async unassign of every matching asset (Manager+); returns a :class:JobHandle (202). Pass EXACTLY ONE of asset_ids or filter (a ProjectFilter); exclude_asset_ids is filter-mode only. in_progress rows revert to to_label; already-unassigned rows are silently skipped.

Raises:

Type Description
ConflictError

idempotency key reused with a different body (IDEMPOTENCY_REPLAY).

RateLimitError

per-tenant active-job cap reached (JOB_PER_TENANT_CAP).

NotFoundError

unknown project (PROJECT_NOT_FOUND).

ForbiddenError

caller is not a project manager (AUTH_FORBIDDEN).

UnprocessableError

neither/both of asset_ids/filter, empty asset_ids, or excludes with asset_ids (VALIDATION_ERROR).

batch_approve

batch_approve(project_id: UUID | str, *, asset_ids: list[UUID | str]) -> BatchApproveResult

Sync-approve up to 1000 explicit asset_ids (Reviewer+). Only in_review rows flip to done (stamped with the caller as reviewer); rows in any other status come back as skipped. For larger / filter-driven selections use :meth:bulk_approve.

Raises:

Type Description
PayloadTooLargeError

asset_ids exceeds 1000 (PAYLOAD_TOO_LARGE).

NotFoundError

unknown project (PROJECT_NOT_FOUND).

ForbiddenError

caller is not a project reviewer (AUTH_FORBIDDEN).

UnprocessableError

empty asset_ids (VALIDATION_ERROR).

bulk_approve

bulk_approve(project_id: UUID | str, *, asset_ids: list[UUID | str] | None = None, filter: dict[str, Any] | None = None, exclude_asset_ids: list[UUID | str] | None = None, idempotency_key: str | None = None) -> JobHandle

Kick off an async approve of every matching in_review asset (Reviewer+); returns a :class:JobHandle (202). The caller is recorded as reviewer. Pass EXACTLY ONE of asset_ids or filter (a ProjectFilter); exclude_asset_ids is filter-mode only. Rows not in in_review are silently skipped.

Raises:

Type Description
ConflictError

idempotency key reused with a different body (IDEMPOTENCY_REPLAY).

RateLimitError

per-tenant active-job cap reached (JOB_PER_TENANT_CAP).

NotFoundError

unknown project (PROJECT_NOT_FOUND).

ForbiddenError

caller is not a project reviewer (AUTH_FORBIDDEN).

UnprocessableError

neither/both of asset_ids/filter, empty asset_ids, or excludes with asset_ids (VALIDATION_ERROR).

batch_reject

batch_reject(project_id: UUID | str, *, asset_ids: list[UUID | str], reason: str | None = None) -> BatchRejectResult

Sync-reject up to 1000 explicit asset_ids (Reviewer+). Only in_review rows flip to in_progress (rework_count++); rows in any other status come back as skipped. When reason is set it lands on the state row AND a per-asset Comment (origin=workflow_reject). For larger selections use :meth:bulk_reject.

Parameters:

Name Type Description Default
reason str | None

optional rejection note shown to the labeler in the unified thread.

None

Raises:

Type Description
PayloadTooLargeError

asset_ids exceeds 1000 (PAYLOAD_TOO_LARGE).

NotFoundError

unknown project (PROJECT_NOT_FOUND).

ForbiddenError

caller is not a project reviewer (AUTH_FORBIDDEN).

UnprocessableError

empty asset_ids or an over-long reason (VALIDATION_ERROR).

bulk_reject

bulk_reject(project_id: UUID | str, *, asset_ids: list[UUID | str] | None = None, filter: dict[str, Any] | None = None, exclude_asset_ids: list[UUID | str] | None = None, reason: str | None = None, idempotency_key: str | None = None) -> JobHandle

Kick off an async reject of every matching in_review asset (Reviewer+); returns a :class:JobHandle (202). Rejected rows flip to in_progress (rework_count++). Pass EXACTLY ONE of asset_ids or filter (a ProjectFilter); exclude_asset_ids is filter-mode only. When reason is set it lands on each affected state row AND a per-asset Comment (origin=workflow_reject). Rows not in in_review are silently skipped.

Parameters:

Name Type Description Default
reason str | None

optional rejection note shown to the labeler in the unified thread.

None

Raises:

Type Description
ConflictError

idempotency key reused with a different body (IDEMPOTENCY_REPLAY).

RateLimitError

per-tenant active-job cap reached (JOB_PER_TENANT_CAP).

NotFoundError

unknown project (PROJECT_NOT_FOUND).

ForbiddenError

caller is not a project reviewer (AUTH_FORBIDDEN).

UnprocessableError

neither/both of asset_ids/filter, empty asset_ids, excludes with asset_ids, or an over-long reason (VALIDATION_ERROR).