Skip to main content

Save File

The Save File activity creates a file in the file system with specified content.

Purpose

Use the Save File activity to:

  • Create files from workflow data
  • Generate text files, CSV files, or JSON files
  • Save workflow outputs to disk
  • Create files for subsequent processing

Configuration

Location Settings

  • Folder: Select or specify the folder where the file will be created
  • Can be in the application's file system or a custom location

File Settings

  • File Name: The name of the file to create (without path)
  • File Content: The content to write to the file

Context Variable (Optional)

  • File Name Context Key: Store the actual file name in a workflow variable
  • Useful if file name is modified (e.g., to avoid conflicts)

File Name Handling

Conflict Resolution

If a file with the specified name already exists:

  • A numeric suffix is added automatically
  • Format: FileName_1.txt, FileName_2.txt, etc.
  • The actual file name used is stored in the context variable

Example

Specified: DataExport.csv
If exists: DataExport_1.csv
If exists: DataExport_2.csv
And so on...

File Content

Static Content

File Name: config.txt
Content: Setting1=Value1
Setting2=Value2
Setting3=Value3

Dynamic Content with Parameters

File Name: Report_{Date}.txt
Content: Report for {ClientName}
Records: {RecordCount}
Status: {Status}
Generated: {Timestamp}

CSV Format

File Name: export.csv
Content: ClientID,ClientName,Amount
{ClientID1},{ClientName1},{Amount1}
{ClientID2},{ClientName2},{Amount2}

JSON Format

File Name: data.json
Content: {
"client": "{ClientName}",
"date": "{ProcessDate}",
"records": {RecordCount},
"status": "{Status}"
}

Example Configurations

Simple Text File

Folder: /exports
File Name: ProcessLog.txt
Content: Process completed at {Timestamp}
File Name Context Key: LogFileName

Data Export File

Folder: /data/exports
File Name: ClientData_{Date}.csv
Content: [CSV data from previous activity]
File Name Context Key: ExportFileName

Configuration File

Folder: /config
File Name: workflow_config.json
Content: {
"lastRun": "{Timestamp}",
"recordsProcessed": {Count}
}
File Name Context Key: ConfigFileName

Common Use Cases

Logging

Save File:
File Name: workflow_log_{Date}.txt
Content: Workflow {WorkflowName} executed
Start: {StartTime}
End: {EndTime}
Status: {Status}

Data Export

Save File:
File Name: data_export_{Timestamp}.csv
Content: [Generated CSV data]

Intermediate Results

Save File:
File Name: calculation_results.json
Content: [JSON with calculation results]

Audit Trail

Save File:
File Name: audit_{Date}_{Time}.txt
Content: User: {Username}
Action: {Action}
Details: {Details}

Usage Notes

  • File Encoding: Files are typically created with UTF-8 encoding
  • Path Handling: Use forward slashes (/) for folder paths
  • Permissions: Workflow must have write access to the target folder
  • File Overwrite: Files are never overwritten; numeric suffixes prevent conflicts
  • Content Size: Be mindful of memory limitations for large content

Limitations and Considerations

When Not to Use Save File

According to the transcript, the usage scenarios for Save File are limited:

Quote from transcript:

"Not really sure when you would use this one. Combined with some other stuff, perhaps, I don't know."

Typical Limitations:

  • Files saved to server file system, not easily accessible to users
  • Report books are better for generating user-facing documents
  • Data exports have dedicated activities
  • Limited practical use cases identified

Better Alternatives

For User-Facing Files:

  • Use Report Book activities (generates PDFs, Excel with better formatting)
  • Use Send Slack File or Send Teams File (delivers to users)
  • Use Email with attachments (external delivery)

For Data Export:

  • Use dedicated Export activities
  • Use Data Load for staging tables
  • Use ETL for data transformations

For Logs:

  • Use Log Message activity (better integration, searchable)
  • Logs are managed by the system automatically

When Save File Might Be Useful

Integration with Other Systems

1. Generate data file with Save File
2. External system picks up file from folder
3. Or use with file transfer activity (if available)

Intermediate File Storage

1. Process data in chunks
2. Save intermediate results with Save File
3. Combine in final step

Custom File Formats

When you need a specific file format that isn't supported by other activities

Legacy System Integration

Some systems expect files in specific folders with specific names

Best Practices

  • Use Descriptive Names: Include dates, timestamps, or identifiers
  • Folder Organization: Use organized folder structures
  • Context Variables: Always capture the actual file name used
  • Error Handling: Plan for folder permissions or disk space issues
  • Cleanup: Consider how old files will be managed/deleted
  • Alternatives First: Consider if other activities better suit your needs

Context Variable Usage

File Name Context Key: CreatedFileName

Later in workflow:
Log Message: "File created: {CreatedFileName}"

Or:

If: Check if file was created successfully
Condition: !string.IsNullOrEmpty({CreatedFileName})

Comparison to Other File Activities

ActivityPurposeUse Case
Save FileCreate text file on serverLimited use
Report BookGenerate formatted reportsUser-facing documents
Send Slack FileShare file in SlackTeam collaboration
Send Teams FileShare file in TeamsTeam collaboration
Data LoadUpload data to stagingData import
EmailSend file to recipientsExternal delivery

Troubleshooting

File Not Created

  • Verify folder exists and is writable
  • Check workflow has permissions to the folder
  • Review workflow execution log for errors
  • Ensure folder path is correct

Wrong Content

  • Verify parameter substitution is working
  • Check content format and encoding
  • Review previous activities for correct data

File Name Issues

  • Use context variable to see actual file name created
  • Check for special characters in file names
  • Verify folder path format

Security Notes

  • Files are created on the server file system
  • Consider access controls for the target folder
  • Sensitive data in files should be encrypted
  • Plan for file retention and cleanup
  • Monitor disk space usage

Summary

While the Save File activity is available, its practical use cases are limited. Consider using:

  • Report Book for user-facing documents
  • Log Message for logging
  • Send [Platform] File for file distribution
  • Data Load/ETL for data operations

Use Save File primarily for:

  • Integration with external systems expecting files
  • Custom file format requirements
  • Intermediate storage in complex workflows
  • Legacy system compatibility