What is Mark File for Export?
Mark File for Export is a specialized tool that immediately exports files from the remote machine as run attachments. When the agent calls this tool, the file is read and saved right away, providing instant feedback on whether the export succeeded or failed.In your prompts, always refer to this tool as
mark_file_for_export (lowercase, with underscores).Why This Tool Exists
Many workflows generate or manipulate files that need to be retrieved:- Downloaded reports
- Generated documents
- Processed data files
- Exported configurations
- Created screenshots or images
mark_file_for_export tool ensures these files are immediately exported as Run attachments with clear success/failure feedback, allowing agents to retry or investigate if a file doesn’t exist.
How It Works
- During workflow execution, the agent identifies files to export
- The agent calls
mark_file_for_exportwith the file path - The file is immediately read from the machine and saved as a run attachment
- The agent receives instant feedback:
- Success: Confirmation that the file was exported as a run attachment
- Failure: Error message explaining why the file couldn’t be read (e.g., file not found)
- If the file doesn’t exist, the agent can retry or investigate the issue
- The new attachment is added to the Run’s
output_attachment_idsarray
Since files are exported immediately, you can safely delete the file from the machine after calling
mark_file_for_export if needed (e.g., using execute_terminal_command).When to Use Mark File for Export
1. Report Downloads
2. Data Extraction
3. Generated Documents
4. Batch Processing
How to Prompt for File Export
Best Practices
- Specify Exact Paths: Be as specific as possible about file locations
- Include File Extensions: Always specify the expected file type
- Use Input Variables: Leverage variables for dynamic file names
- Confirm File Creation: Ensure the file exists before marking for export
Prompt Template
Real-World Examples
Healthcare: Patient Records
Finance: Statement Downloads
HR: Employee Onboarding
Legal: Document Compilation
Working with Dynamic File Paths
Using Input Variables
Pattern-Based Exports
Using Runtime Variables
Sensitive Variables
If your prompt includes
{$variable}, the value is handled securely and is not exposed to the agent or logs. Avoid including secrets in file paths or filenames. Sensitive values are typically used for actions like login; they should not appear in exported file paths or content.Conditional Exports
Common Patterns and Tips
Immediate Feedback Pattern
Multiple File Exports
Handling Download Locations
Error Prevention
❌ Incorrect Usage
✅ Correct Usage
Handling Export Errors
Sincemark_file_for_export provides immediate feedback, your prompts can instruct the agent how to handle failures: