Save workflow results to a document in the Kotia editor
Learn how to save workflow results to a document with the Document card: append or replace text, lock a file, and use it as a source step.
On this page6
Set up saving workflow results directly in the Kotia editor. The "Document" card writes the prepared text into the document you choose. You can use it to review a post, edit an article, or combine several chapters into one shared piece.
The write mode determines whether new text is added to the existing text or replaces it. The same card can also pass the document's contents into a workflow. For example, you can use your store's instructions when preparing replies to customers.
Example: compile a handbook from several chapters
You're writing a handbook on ceramic care. The writing step creates a chapter on the next topic, and the "Document" card appends it to the end of the shared file. After several runs, the editor contains a handbook that you can reread and refine.
For this scenario, choose "Append to the end of the document". If you choose replacement, each new chapter takes the place of the previous one. If you need separate articles in different files, use the "Folder" card.
How to save a step's result
- Open the workflow on your computer and add a "Document" card. Kotia creates a new file for it in "Drafts."
- Connect the output of the writing or analysis step to the input of the "Document" card.
- Open the card settings by clicking the pencil icon. Check the file name. The "Choose" button lets you link a different document or create a new one.
- In the "How to write" field, choose to append to the end or replace the contents.
- Check the "Before a run" field: choose whether to keep the existing text or clear the document before a full workflow run.
- Run the workflow. Then open the result with the preview icon on the card. From the preview or the panel, you can go to the editor.
A new card defaults to append mode. An older card may be set to replace, so check the write mode before you use a finished workflow. Don't rely on the default value.
How to choose a write mode
| Task | Setting |
|---|---|
| Accumulate chapters or results from several runs | "Append to the end of the document" and keep the existing contents |
| Get only the latest version on each run | "Replace the document contents" |
| Build a new shared document from several runs on each full run | Append, with "Clear the document" before a run |
| Keep your manual edits and pass them on without writing | Pin the document with the lock on the card |
Clearing happens before a run of the entire workflow. It doesn't trigger when you run a section or rerun from the selected card. When you rerun, append adds the material again. If a chapter appears twice in the file, delete the extra copy in the editor.
Before the first write to a document in a run, Kotia saves a version of its previous state. Thanks to this version, you can go back to the text as it was before the workflow ran, using the version history. Don't expect a separate version after each chapter within a single run.
How to use your document as a source
Select the file you need, connect "Start" to the "Document" card, and connect the card's output to the processing step. In this case, the card reads the document's contents instead of writing the result of previous work. The text is taken at the moment the step runs. Edits you made in the editor before the read are included in processing.
For example, you can keep delivery terms in a document and pass them to a "New step" with this task:
Prepare replies to customers about delivery times, costs, and limits based on this document. If the document doesn't include the condition you need, say that it needs to be clarified. Don't add guesses to the store's rules.
If other steps already connect to the card, but you want to keep your own version, click the lock on the card. A pinned document is not overwritten, and the saved text is passed on from there. Changing the selected file removes the pin, so turn the lock on again for the new document if needed.
What results you can save
The "Document" card accepts text: a written article, research, the result of a regular AI step, or a value from "Data". Several incoming texts are saved as sections, named after the source cards. An image is placed right below the text, without a heading like that. An article with quotes is carried over along with its formatting and links to sources.
An article outline and the source list are separate types of material that this card can't write directly. First pass them to a step that prepares the text you need. A signal from the "Sync point" alone is also not enough to write.
If another step comes after the "Document" card, it receives the file's contents. In append mode, this is the whole document, including parts added earlier. Keep the volume in mind: the next model works with all the text passed to it.
If the document wasn't saved
- No file selected or the file was deleted. Open the settings and choose an existing document.
- Nothing to write. Check the text from the previous step. An empty source document is acceptable on its own, but a processing step may need non-empty material.
- The editor has unaccepted AI edits. First accept or reject them, then retry the write.
- The document is pinned. The lock intentionally blocks writing. Unpin it if you want to update the file from the workflow.
While the workflow runs, the document being written to is locked for editing. After the run finishes, you can edit it as usual. Deleting the workflow itself does not delete the document it created.
Reading and writing with this card is free. Steps that write or analyze text before and after it are billed separately. For details, see workflow cost.