Skip to main content

Preview what one sub-workflow entry would decide for a document.

POST/api/v1/spawn-entries/previewworkflows:read

The builder's Test button: runs one spawn entry's enabled_when, count and template selection against a document you can read, and starts nothing. For template authors; needs Test Workflow Templates. A template the entry names that you cannot see is refused as not found, as the Portal does, so the preview never shows a template hidden by template-group security. An entry the step would refuse is 422 with the step's own message.

Scopeworkflows:read
AsynchronousNo
MCP toolpreview_spawn_entries
Portal permissionstest_workflow_templates

Parameters​

NameInTypeRequiredDescription
Docwize-Versionheaderstring (date)Optional

Request body​

Content typeType
application/jsonSpawnEntryPreviewCreateInput

Responses​

StatusDescriptionBody
200Success.application/json SpawnEntryPreview
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

SpawnEntryPreview​

FieldTypeRequiredDescription
document_idstringRequired
is_enabledbooleanRequiredThe entry's enabled_when result; an entry whose condition has nothing to evaluate is enabled.
previewobjectRequiredformat spawn_selection_preview, format_version 1: the Portal's builder preview as it is. It holds enabled, count (the units counted, the children planned and unmatched), units (the first units, or the one with row_key, each with its row, the row filter's verdict and the template selection: override, from_field, rules, the applicable pool's ranking, the root and version chosen) and failure (why a real run would fail). Its identifiers are the Portal's own numbers.
spawn_entry_idstringRequired

SpawnEntryPreviewCreateInput​

FieldTypeRequiredDescription
document_idstringRequiredThe document to preview the entry against, as the parent's document. You must be able to read it.
entryobjectRequiredformat spawn_entry, format_version 1: one entry as a group-mode Sub Workflow step stores it in its spawn_entries setting (id, name, enabled_when, count, template_source and its options, child_document ...).
row_keystring or nullOptionalPreview only the grid row (its ownid) or attachment (its document id) with this key.
start_inputsarray of SpawnEntryPreviewStartInputInputOptionalThe parent's start-input values, which from_field and override read.

SpawnEntryPreviewStartInputInput​

FieldTypeRequiredDescription
node_idstringRequiredThe start input (its node_id from get_workflow_template_start_inputs).
valuestring or nullOptionalThe input's value. Give this or values, not both.
valuesarray of stringOptionalAn input with several values. Give this or value, not both.