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.
| Scope | workflows:read |
| Asynchronous | No |
| MCP tool | preview_spawn_entries |
| Portal permissions | test_workflow_templates |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Docwize-Version | header | string (date) | Optional |
Request body
| Content type | Type |
|---|---|
application/json | SpawnEntryPreviewCreateInput |
Responses
| Status | Description | Body |
|---|---|---|
200 | Success. | application/json SpawnEntryPreview |
400 | invalid_version, malformed_json | application/problem+json Problem |
401 | token_expired, unauthenticated | application/problem+json Problem |
403 | forbidden, insufficient_scope, token_owner_inactive | application/problem+json Problem |
405 | method_not_allowed | application/problem+json Problem |
406 | not_acceptable | application/problem+json Problem |
413 | payload_too_large | application/problem+json Problem |
415 | unsupported_media_type | application/problem+json Problem |
421 | wrong_region | application/problem+json Problem |
422 | validation_failed | application/problem+json Problem |
500 | internal_error | application/problem+json Problem |
503 | tenant_unavailable, unavailable | application/problem+json Problem |
504 | timeout | application/problem+json Problem |
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
SpawnEntryPreview
| Field | Type | Required | Description |
|---|---|---|---|
document_id | string | Required | |
is_enabled | boolean | Required | The entry's enabled_when result; an entry whose condition has nothing to evaluate is enabled. |
preview | object | Required | format 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_id | string | Required |
SpawnEntryPreviewCreateInput
| Field | Type | Required | Description |
|---|---|---|---|
document_id | string | Required | The document to preview the entry against, as the parent's document. You must be able to read it. |
entry | object | Required | format 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_key | string or null | Optional | Preview only the grid row (its ownid) or attachment (its document id) with this key. |
start_inputs | array of SpawnEntryPreviewStartInputInput | Optional | The parent's start-input values, which from_field and override read. |
SpawnEntryPreviewStartInputInput
| Field | Type | Required | Description |
|---|---|---|---|
node_id | string | Required | The start input (its node_id from get_workflow_template_start_inputs). |
value | string or null | Optional | The input's value. Give this or values, not both. |
values | array of string | Optional | An input with several values. Give this or value, not both. |