Instantiate Template Natively
instantiate_template_nativeInstantiate a template as a new document using native AFFiNE block cloning, substituting variables and preserving tags, with fallback to markdown only when necessary.
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 |
|---|---|---|---|
| mode | No | ||
| docId | No | ||
| title | No | ||
| warnings | No | ||
| blockCount | No | ||
| workspaceId | No | ||
| rootBlockIds | No | ||
| preservedTags | No | ||
| linkedToParent | No | ||
| sourceTemplateDocId | No | ||
| unresolvedVariables | No | ||
| nativeCloneSupported | No | ||
| replacedVariableCount | No |