Type
file_generationFormats
JSON, CSV, PDF, TXT, Markdown
Common Use Cases
Creating reports and documentsGenerate PDF reports, executive summaries, and formatted documents
Exporting data to different formatsConvert data to CSV for spreadsheets, JSON for APIs
Generating configuration filesCreate YAML, JSON, or INI configuration files from templates
Template-based file creationUse Jinja2 or custom templates to generate dynamic content
Supported Formats
| Format | Use Cases | Key Features |
|---|---|---|
| JSON | API exports, config files | Pretty printing, schema validation, nested structures |
| CSV | Data exports, spreadsheets | Custom delimiters, headers, Excel compatibility |
| Reports, invoices, documents | Custom styling, images, multi-page support | |
| Text/Markdown | Documentation, READMEs | Markdown formatting, template substitution |
Configuration
Example Configuration:📋 Full Configuration Reference
📋 Full Configuration Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
output_directory | string | ”/“ | Where files are saved |
allowed_formats | array | [“json”, “csv”, “txt”] | Permitted file formats |
template_directory | string | ”/templates” | Template file location |
template_engine | string | ”jinja2” | Template engine to use |
json_indent | number | 2 | JSON pretty print indentation |
csv_delimiter | string | ”,“ | CSV field separator |
encoding | string | ”utf-8” | File encoding |
pdf_engine | string | ”reportlab” | PDF generation library |
pdf_page_size | string | ”A4” | Page size (A4, Letter, etc.) |
Quick Start
View Complete Examples
See full template usage, PDF generation patterns, and multi-format export examples
Template Usage
Jinja2 Templates
Create reusable templates for consistent file generation: Template File (/opt/templates/report.md.j2):
Security Best Practices
Restrict Output Directory
Restrict Output Directory
Always specify
output_directory to limit where files can be written.Whitelist Formats
Whitelist Formats
Use
allowed_formats to control which file types can be generated.Validate Template Input
Validate Template Input
Sanitize data before passing to templates to prevent injection attacks.
Troubleshooting & Related Skills
Template Not Found
Template Not Found
Solutions:
- Verify
template_directorypath is correct - Check template file exists:
ls /opt/templates/ - Ensure worker has read permissions on template directory
PDF Generation Fails
PDF Generation Fails
Solutions:
- Install required PDF library:
pip install reportlaborpip install weasyprint - Verify font files are available if using custom fonts
- Check PDF engine configuration matches installed library
Permission Denied on Output
Permission Denied on Output
Solutions:
- Verify
output_directoryexists:mkdir -p /opt/generated - Check worker user has write permissions
- Ensure disk space is available:
df -h