Skip to main content

Assembly Groups

Read how a pipeline grouped its documents, find groups that need a base document chosen, settle them by choosing one, and assemble the groups again from code.

A pipeline that assembles documents puts related documents (an order with its delivery notes and amendments, say) into one group and builds one row per group. Each group has a base document, its anchor, whose values the others add to or replace. GET /v1/pipelines/{id}/assembly/groups lists every group with its row and its documents, and marks the anchor.

Sometimes a group cannot settle on one base document, for example when two documents both look like the original. GET /v1/pipelines/{id}/assembly/needs-anchor lists those groups, each with the candidates to choose from. POST /v1/pipelines/{id}/assembly/resolve-anchor settles one group by choosing its anchor; the group is assembled again around it.

POST /v1/pipelines/{id}/assembly/rerun assembles all groups again from the current documents, for example after you corrected values or attached more documents. It answers 400 while assembly is already running, when documents of the run are still processing, or when the pipeline does not assemble documents.

Reads need the read scope (or runs:read) and any member. Choosing an anchor is review work: it needs reviews:write, and the key's person must be a Member or above with the edit permission, as in the web app; a Viewer gets 403 insufficient_role. Assembling again needs runs:write, and the key's person must be an Admin of the workspace; in a workspace whose model configuration Talonic manages, it returns 403 insufficient_role.

GET/v1/pipelines/{id}/assembly/groups

Response fields (data[])

groupKeystringThe grouping value of the group.
productRecordIduuid | nullThe group's row.
anchorPipelineDocumentIduuid | nullThe run document chosen as the group's base.
documents[]arraypipelineDocumentId, documentId, filename, display_name, status, isAnchor.
GET/v1/pipelines/{id}/assembly/needs-anchor
POST/v1/pipelines/{id}/assembly/resolve-anchor

Body parameters

group_key*stringThe group's groupKey from needs-anchor (up to 2000 characters).
anchor_document_id*stringA candidate's documentId from needs-anchor.

Choose the anchor of a group

curl -X POST https://api.talonic.com/v1/pipelines/$PIPELINE_ID/assembly/resolve-anchor \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"group_key": "PO-2026-0412", "anchor_document_id": "0b6c1f9e-2d4a-4e8b-9c1d-3f5a7b9c2e10"}'
POST/v1/pipelines/{id}/assembly/rerun

Frequently asked questions

What is an anchor?+
The base document of an assembled group. The other documents of the group add to or replace its values. Each group has one, and the groups route marks it with isAnchor.
Why does choosing an anchor need reviews:write and not runs:write?+
Choosing an anchor is a review decision, the same as on the review screen in the web app, so it follows the review rules: a Member or above may do it. Assembling every group again changes the run and needs an Admin.
When does assembly/rerun answer 400?+
When the pipeline does not assemble documents, while assembly is already running, or while documents of the run are still processing. Wait for the run to settle and call it again.