Nodes/ComfyUI-ZMongo/06 Create Text Document
ComfyUI Node

06 Create Text Document

Create a text document in ZMongo straight from a string input

By CentralFloridaAttorney·Created 7 months ago·Updated 4 months ago· 2
06 Create Text Document
  • session
  • json
  • document_id
  • document_id_link
  • filename
  • filename_link
  • text_length
  • success
  • refresh
  • document_ids
  • filenames
  • selectable_items
  • indexed_items
  • item_count
◄filenamemanual_document.txt►
◄text►
◄case_id►
◄metadata_json{}►
◄document_json{}►
◄document_prefix/documents►
◄refresh_token►

The document side of ComfyUI-ZMongo is about turning your database into a structured text store - prompts, captions, run logs, LLM context. 06 Create Text Document is the node that writes a document into that store, built entirely from a string input rather than a file on disk. You type (or wire) the text, it becomes a record.

It needs a session (the ZMONGO_API_SESSION from 00 API Key Session or 00 Local File Store Session) and hits the backend's /api/create endpoint under the document_prefix (default /documents). The payload bundles your inputs: filename (default manual_document.txt), the text itself, an optional case_id for grouping, metadata_json for arbitrary key/values, and document_json for structured payload fields. The server also records a content type and the character count, so the document looks like a first-class record, not a loose string.

What you set

  • filename - the display name of the document. This is what you'll see in list nodes later, so name it something you'd recognize in a list of hundreds.
  • text - the content. It's a multiline field, so paste freely.
  • case_id - optional grouping tag for when you're organizing documents by project or run.
  • metadata_json / document_json - the structured extras. metadata_json is the go-to for searchable tags; document_json lets you embed a full structured payload alongside the text.

Outputs

The useful ones: document_id (string) and document_id_link (a ZMONGO_DOCUMENT_ID typed socket for feeding other document nodes), filename and filename_link the same way, text_length (handy sanity check that your text actually landed), success, and refresh. The document_ids / filenames list outputs plus the selectable_items / indexed_items / item_count tail feed the pack's "select from a list" pattern downstream - e.g. pipe selectable_items into an index selector.

Notes and gotchas

This is an output node (is_output_node: true), so running it surfaces the result in the UI. The heavy lifting happens on the backend, so a failed call shows up in the json output with the server's message - and if the route isn't found, the node falls back to a generic document-create path, so it's fairly resilient across backend versions. Because everything is stored via your session, no credentials means no persistence: the local file store session works, but the hosted path needs a valid API key for the username that owns the silo.

CategoryZMongo/03 Documents

Inputs (8)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION—
filenameSTRINGmanual_document.txt—
textSTRING—
case_idSTRING—
metadata_jsonSTRING{}—
document_jsonSTRING{}—
document_prefixSTRING/documents—
refresh_tokenoptSTRING—

Outputs (13)

NameTypeDescription
jsonSTRING—
document_idSTRING—
document_id_linkZMONGO_DOCUMENT_ID—
filenameSTRING—
filename_linkZMONGO_FILENAME—
text_lengthINT—
successBOOLEAN—
refreshSTRING—
document_ids*—
filenames*—
selectable_items*—
indexed_itemsSTRING—
item_countINT—