Skip to main content

Save File

The Save File activity creates a file in the Una file system with content you define, then stores the resulting file path in the workflow context so subsequent activities can reference it.

Purpose​

Use the Save File activity to:

  • Produce a report, CSV, or JSON output file as part of a workflow
  • Write intermediate results to disk so they can be picked up by a downstream activity (e.g. Send Email, Send Slack File)
  • Persist generated content from a Script or AI activity to a named file
  • Create files whose names are computed at runtime from workflow variables

Configuration​

Folder​

The target folder in the Una file system where the file will be created. Click the field to open the folder picker.

Supports interpolation — the path can reference workflow context variables:

/Reports/{{var:EntityName}}/Output

File Name​

The name of the file to create (without path). Can be a static name or an interpolated expression.

Monthly_Close_{{var:Period}}.csv
Report_{{ctx:today}}.txt

Contents​

The text content to write into the file. This is a multi-line text field and fully supports interpolation. Embed variable values directly in the file body:

Entity: {{var:EntityName}}
Period: {{var:Period}}
Generated: {{ctx:today}}

{{var:ReportBody}}

The file is saved using Windows-1252 encoding. For UTF-8 output, ensure that any upstream activities producing the content also work in that encoding context.

File Name Context Key​

The name of a workflow context variable that will hold the actual file path after the activity runs. Downstream activities can then reference the file without hard-coding the path.

Default key: SaveFileWorkflowActivity_FileNameContextKey

Rename it to something meaningful if you have multiple Save File activities in the same workflow (e.g. ReportFilePath, SummaryFilePath).

Behavior​

  1. All three fields (Folder, File Name, Contents) are interpolated against the current workflow context.
  2. The specified folder is resolved in the Una file system.
  3. A new file is created with the given name and content. If a file with the same name already exists in that folder, it is overwritten.
  4. The full file path is written to the workflow context under the configured key.

Usage Patterns​

Produce a Report File, Then Email It​

Script ──> Save File ──> Email
│ └── Attach: {{var:ReportFilePath}}
└── Folder: /Reports/Monthly
FileName: Report_{{var:Period}}.xlsx
Key: ReportFilePath

Generate One File per Entity in a Loop​

Foreach: entity in entities
└──> Script (generate content for entity)
└──> Save File
Folder: /Output/{{foreach:item}}
FileName: Summary_{{var:Period}}.txt
Key: CurrentFilePath
└──> Send Slack File (attach: {{var:CurrentFilePath}})

Chain Multiple Save File Activities​

When a workflow produces more than one file, give each Save File activity a distinct context key:

ActivityFile Name Context Key
Save File — ReportReportFilePath
Save File — LogLogFilePath
Save File — SummarySummaryFilePath

Usage Notes​

  • The folder must already exist in the Una file system. The activity does not create missing parent folders.
  • The file name must not contain path separators (/, \). Put the path only in the Folder field.
  • If you need to write binary files (images, Excel, etc.), use the Send Teams File or Send Slack File activity instead, which can handle binary content directly.
  • Files written here are immediately visible in the Una file system and can be opened, downloaded, or referenced by other workflow activities.

Best Practices​

  • Always rename the context key to something descriptive. The default name is long and collides with other Save File activities in the same workflow.
  • Use interpolation in the file name to include the period, date, or entity so that each run produces a distinct, identifiable file.
  • Combine with Log Message to record the final path: File written to {{var:ReportFilePath}}.

JSON Reference​

{
"discriminator": "SaveFileWorkflowActivity",
"activityId": "<uuid>",
"name": "Save File",
"positionX": 0,
"positionY": 0,
"advanceRule": 2,
"folderPath": "/Reports/Monthly",
"fileName": "Report_{Period}.txt",
"contents": "Report content here...",
"fileNameContextKey": "ReportFilePath"
}
PropertyTypeDescription
folderPathstringCorresponds to the Folder field. The Una file system path of the folder where the file will be created. Supports {variable} interpolation.
fileNamestringCorresponds to the File Name field. The name of the file to create (no path separators). Supports {variable} interpolation.
contentsstringCorresponds to the Contents field. The text content to write into the file. Supports {variable} interpolation.
fileNameContextKeystringCorresponds to the File Name Context Key field. Workflow context key where the resulting file path is stored. Defaults to SaveFileWorkflowActivity_FileNameContextKey.