Skip to content

Step: Save Text File

  • Key: save-text-file
  • Category: Utilities
  • Description: Save plain text content as a file and generate a temporary direct download link.

Inputs

  • textKey (select, optional): Context key containing the text to save.
  • text (long-text, optional): Inline text to save. Supports template variables. If both text and textKey are provided, inline text is used.
  • fileName (text, required): File name including extension, for example summary.md or notes.txt.
  • expiryMinutes (number, optional): Download link lifetime. Defaults to 1440 minutes.

Outputs

  • success (boolean): Whether the file was saved.
  • fileKey (text): Internal file storage key.
  • fileName (text): Saved file name.
  • downloadLink (text): Temporary download link.
  • expiryMinutes (number): Link lifetime used.
  • message (text): Human-readable success or failure message.
  • error (text): Error message when saving fails.

Notes

  • Use this step for text, Markdown, JSON strings, generated reports, and code snippets.
  • To save binary/base64 content, use save-file instead.
  • To create a PDF from Markdown, use markdown-to-pdf first, then persist the generated base64 with a file step.

Example Use Case

  1. Use an agent step to create a meeting summary and store it as summary.
  2. Use save-text-file with textKey = "summary.response" or inline text = "{ {summary.response} }".
  3. Return downloadLink from the final step.

Built with VitePress