Instantiate Template Natively
instantiate_template_nativeCreate an AFFiNE document from a template via native block cloning, falling back to markdown only when required; supports variables, parent links, and tag copying.
Instructions
Instantiate a template using native AFFiNE block cloning when supported, falling back to markdown materialization only when necessary.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Optional title for the new document. Defaults to the template title. | |
| variables | No | Key-value map of {{variable}} substitutions applied during cloning. | |
| parentDocId | No | Optional parent doc to link the instantiated doc under in the sidebar. | |
| workspaceId | No | AFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured. | |
| preserveTags | No | If true (default), copy the template's tags onto the instantiated doc. | |
| allowFallback | No | If false, fail instead of falling back to markdown materialization when native cloning is unsupported. | |
| templateDocId | Yes | The template doc to instantiate. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| code | No | ||
| mode | No | ||
| docId | No | ||
| error | No | ||
| stage | No | ||
| title | No | ||
| status | No | ||
| details | No | ||
| warnings | No | ||
| causeCode | No | ||
| retryable | No | ||
| blockCount | No | ||
| workspaceId | No | ||
| rootBlockIds | No | ||
| preservedTags | No | ||
| linkedToParent | No | ||
| contentPersisted | No | ||
| recoveryGuidance | No | ||
| metadataPersisted | No | ||
| sourceTemplateDocId | No | ||
| unresolvedVariables | No | ||
| nativeCloneSupported | No | ||
| requiresManualRepair | No | ||
| replacedVariableCount | No |