Skip to main content
Type: chunk Subtype: chunk_by_contextual

Usage guidance

The chunk_by_contextual node enriches existing chunks; it does not group elements itself. Place it after one of the text chunkers (such as chunk_by_character, chunk_by_page, chunk_by_similarity, or chunk_by_title) in the workflow. For very large documents, the chunker estimates total request time and, if this exceeds the internal limit, returns the original elements unchanged. Per-element failures fall back to the original text, rather than canceling the document processing. For more information, see Contextual chunking.

Settings

contextual_chunking_model
string
required
The model to use. Use provider/model format (e.g., anthropic/claude-sonnet-4-6). Supported providers: anthropic, openai, custom_openai_compatible, vertexai, bedrock. For available models, see Available models.
context_char_limit
integer
Size of the document window, in characters, given to the LLM for each chunk. Default:15000.
user_prompt
string
Custom instruction to override the default per-chunk prompt. Default: none.
chunk_by_contextual_chunker_workflow_node = WorkflowNode(
    name="Chunker",
    subtype="chunk_by_contextual",
    type="chunk",
    settings={
        "contextual_chunking_model": "<provider>/<model>",
        "context_char_limit": <context-char-limit>,
        "user_prompt": "<user-prompt>"
    }
)