Skip to content

Document operators

Public

The Document family contains 4 operators. Read/write the current document’s metadata and CRDT subdocs.

Duplicates a source document into a new document row, copying all four subdoc snapshots (graph, draw, meta, comments). Defaults to the current run’s document. Collaborators are not copied.

Version 1.0.0 · Semantics side_effect · Visibility advanced

FieldTypeRequiredDefaultDescription
new_slugstringnoSlug for the new document. Defaults to null (set via Document Write later).
new_titlestringnoTitle for the new document. Defaults to ‘<source title> (copy)’.
source_document_idstringnoUUID of the document to clone. Defaults to the current run’s document.

No input ports.

PortTypeRequiredDescription
outputobjectnoCloned Document

Extracts text, tables, or metadata from documents (PDF, DOCX, etc.).

Version 1.0.0 · Semantics passthrough · Visibility advanced

FieldTypeRequiredDefaultDescription
extract_mode”text” | “tables” | “metadata” | “all”no"text"
page_rangestringnoPage range (e.g. ‘1-5’). Blank = all pages.
PortTypeRequiredDescription
inputanyyesFile
PortTypeRequiredDescription
metadataobjectnoMetadata
textstringnoText

Returns the collaborator roster for a document with their permission bits. Defaults to the current run’s document. The email and name fields are surfaced as null — the collaborator row carries only the opaque user id.

Version 1.0.0 · Semantics passthrough · Idempotent · Visibility advanced

FieldTypeRequiredDefaultDescription
document_idstringnoUUID of the document to list collaborators for. Defaults to the current run’s document.

No input ports.

PortTypeRequiredDescription
outputobjectnoCollaborators

Captures all four subdocs of the target document (graph, draw, meta, comments) into a new revision row, marks the revision as published, and sets it as the document’s published_revision_id.

Version 1.0.0 · Semantics side_effect · Visibility advanced

FieldTypeRequiredDefaultDescription
document_idstringnoUUID of the document to publish. Defaults to the current run’s document.
revision_labelstringnoOptional label echoed in the output. Defaults to ‘publish-<timestamp>’.

No input ports.

PortTypeRequiredDescription
outputobjectnoPublished Revision

Every operator above is rendered from its JSON schema in /opt/glyph/schemas/operators/:

  • schemas/operators/document.clone.json
  • schemas/operators/document.extract.json
  • schemas/operators/document.list_collaborators.json
  • schemas/operators/document.publish.json