workspaceToken (see Authentication)
and goes to the single GraphQL endpoint:
The bundle render does not use the Tasks polling pattern. It
has its own
workflowExecutionId and its own WorkpaperRenderStatus enum
(RUNNING, COMPLETED, FAILED), reached through
me { ... on WorkspaceUser { workspace { checkWorkpaperGenerationStatus(...) } } }.
Do not conflate it with TaskStatus. The optional
triggerWorkpaperTranslate flow at the
end of this recipe is the one that does use the Task pattern.1. Start a render
CallgenerateWorkpaperBundle
with the client’s binderId, the orderedGroups outline that drives the
bundle’s section order, and the flags for which sections to include. The
mutation returns a WorkpaperRenderJob carrying the workflowExecutionId you
poll in step 2.
2. Poll until the render completes
PollcheckWorkpaperGenerationStatus
with the workflowExecutionId from step 1 until status is COMPLETED (then
read downloadUrl.url) or FAILED (then read errorMessage). The web app
polls every 1500ms with a hard timeout of 5 minutes; mirror that pattern and
treat a missing downloadUrl on COMPLETED as a failure.
RUNNING response (poll again) looks like:
FAILED response (stop polling and surface the error) looks like:
3. Download the bundle
Oncestatus is COMPLETED, fetch downloadUrl.url (or hand it to the
browser to download). The url is a signed link with a limited lifetime, so
download it promptly. downloadUrl.filePath shows where the bundle is stored
server-side and is useful for support tickets but is not a fetch target itself.
downloadUrl.url in a new tab to trigger the browser’s
download prompt; either approach works.
Optional: Save an edited workpaper xlsx
If your integration edits the client’stax_workpaper.xlsx (for example an
in-browser workbook editor), commit each edit back with
saveTaxWorkpaperXlsx. It takes
the full xlsx workbook base64-encoded plus a short summary (typically the
cell coordinate that changed) and returns a ClientCommit describing the new
git commit in the client’s file store.
Optional: Trigger a translation task
When you want a fresh workpaper produced for a return type from a prior run’s output, calltriggerWorkpaperTranslate.
Unlike the bundle render, this is a real background Task: it
returns a TriggerTaskResult { taskId } and you poll
me { ... on WorkspaceUser { workspace { clients(filters: { ids: [$clientId] }) { tasks(type: ..., limit: 1) { id status } } } } }
until status is COMPLETED or FAILED.
workpaperTemplates:
As of this writing,
triggerWorkpaperTranslate and workpaperTemplates are not
yet wired into the web app’s surface code. They exist in the live schema and
are documented here for completeness, but verify the behavior end to end
against your own workspace before relying on a specific shape.Next steps
From here you can go deeper on the related surfaces:- Browse the binder first: the
subdocumentIdsthat driveorderedGroupscome frombinder.subdocuments. See Browse a client’s binder. - Leadsheets export format: when
includeLeadsheetsistrue, setleadsheetsFormattoEXCELorCSV(see Exporting leadsheets). - Task polling (for the translate flow): the optional
triggerWorkpaperTranslateflow returns ataskIdyou poll through the standardclients.taskspattern. See Tasks. - Full reference: every workpaper mutation, type, and
Workspacefield is documented on Workpapers.