Files by Agent OS
Agents and automations often need to hand back more than a short message: a list of low-stock inventory, a summary report, a set of records pulled from a system.
Instead of sending that data as a message, Agent OS can put it into a proper file, such as a spreadsheet, a PDF report or a slide deck, and share a secure download link.
- Agents have Create a File by default. Ask the agent for a file and it creates one in any of 16 formats, including Excel, PDF, Word and PowerPoint.
- Automations use the Files by Agent OS connector and its Create a File action, which creates CSV, JSON, TXT and Markdown files.
The download link only works for people signed in to your organization who can open the agent or automation, and it's automatically cleaned up after a set period of time.
Note Files by Agent OS supports export only. You can't import data through it.
Before You Begin
- Agents: Create a File is provided to every agent by default, including on-demand agents, and Polaris. There's nothing to add, connect or set up.
- Automations: Create a File is opt-in. Add the Files by Agent OS connector as an action step where you want a file created.
Create Files with an Agent
Every agent can create files from the data it reads in a run, such as your entries, assets or the results of its other tools.
Create a File is provided to every agent by default. It doesn't appear on the Tools card, and there's nothing to add or configure.
- Ask for the file in the agent's instructions or in the request that runs the agent. For example: "Export the title, URL and publish date of every blog post as an Excel file."
- Run the agent. Its reply includes a download link for the file. The same file is in the run's execution log, under the Create A File step.
If you don't name a format, the agent picks one: CSV for tables and Markdown for text.
Note The largest file an agent can create is 5 MB by default. If a file is too large, the agent tries again with a smaller file, for example with fewer rows, compressed, or split into parts. If you still don't get the file, ask for less: filter the rows, drop columns you don't need or split the data into several files.
Supported File Formats for Agents
| Kind | Formats | Good for |
|---|---|---|
| Spreadsheets and data | Excel (.xlsx), CSV (.csv), TSV (.tsv), JSON (.json), XML (.xml) | Entry exports, inventories, audit lists, data for other systems |
| Documents | PDF (.pdf), Word (.docx), Markdown (.md), plain text (.txt), HTML (.html) | Reports, briefs, content audits, notes to share |
| Presentations | PowerPoint (.pptx) | Slide decks for reviews and standups |
| Images | PNG (.png), JPEG (.jpg, .jpeg), GIF (.gif), WebP (.webp) | Charts and graphics |
| Archives | ZIP (.zip) | Several files in one download, for example a CSV and a PDF of the same report |
These are real files that open in their usual apps.
Tips for Asking
- Name the format and the fields. For example: "Export the title, URL and publish date of every blog post as an Excel file."
- Ask for charts by name. For example: "Make a PDF of last month's posts with a bar chart of posts per week."
- Say where the file goes. Add a tool that can deliver it, such as Email, and ask the agent to send the file. For details, refer to the Sharing the File section.
- For scheduled agents, put the file request in the agent's instructions, including where to send the file.
- If a link has expired, run the agent again. It creates a new file with a new link.
Agents with the Older Create a File Tool
Agents that already have the older Create a File tool (from the Files by Agent OS connector) attached keep working as before, with no changes needed.
While the older tool is attached, the agent uses both tools:
| Format you ask for | Created by |
|---|---|
| CSV, JSON, Markdown, plain text | The older tool, with the same output as before. A file name set in its settings is still used. |
| Every other format (Excel, PDF, Word, PowerPoint, ZIP and the rest) | The built-in Create a File |
The Tools card shows a single Create a File row: the attached one.
To switch to the built-in tool:
- If you set a file name in the older tool's settings, add it to the agent's instructions instead. For example: "Name the export blog-posts.csv."
- Open the agent in Agent Builder and remove Create a File from its tools.
- Save the agent.
The built-in Create a File is always available, so there's nothing to add. Every file the agent creates now comes from it.
Set Up the Files by Agent OS Connector in an Automation
Perform the following steps to set up the Files by Agent OS connector in an automation:
Click Configure Action Step in the left navigation panel.
Click Action Step to configure third-party services.
Within the Configure Action Step, click the Files by Agent OS connector.Click to enlarge
Under Choose an Action, select the Create a File action.Click to enlarge
On the Configure Action page, enter the following details:
- Data (required): Enter or map the data you want written to the file (for example, the output of a previous step, such as all content types fetched for a stack).
- File name (required): Enter a name for the generated file, including its extension (for example, export.md). The extension determines the file format (CSV, JSON, TXT, or MD).
Click to enlarge
Click Proceed.
Click Test Action to test the configured action.
On successful configuration, you see the output, which includes a download link for the generated file. Click Save and Exit.Click to enlarge
Note The Create a File action only generates the file and its download link. To deliver the file, add a follow-up step. For details, refer to the Sharing the File section.
Supported File Formats for Automations
| File extension | Format |
|---|---|
| .csv | Comma-separated values (spreadsheet-style data) |
| .json | JSON |
| .txt | Plain text |
| .md | Markdown |
Note If the data does not match the requested format (for example, plain text data is passed in but the filename ends in .csv), the file is not created and the automation reports that the export failed.
From an Agent
Ask the agent to send or share the file, and it delivers it through the tools you've attached, such as Email or Microsoft Teams. The recipient gets the file's download link in the message.
Note A download link opens only for people who can open the agent.
From an Automation
The Create a File action only creates the file and a download link; it doesn't send the file anywhere on its own. To deliver it to people, add a delivery step and pass the file to its Attach File / Image by URL field:
- Email: attach the file to an email sent through the built-in Email connector.
- Mailgun: attach the file to an email sent through a connected Mailgun account.
- Contentstack: use the file to create a new asset, or update an existing one, in your Contentstack organization.
Viewing and Downloading Files from Execution Log
Every time an agent or automation creates a file, you can find it in that run's execution details.
Look for the Create A File step in the execution details. Instead of raw output, you'll see a file card with the file's information.
Click to enlargeWhile the file is still available, the card shows:
- The file name and an icon for its format
- The file size
- How much time is left before the file expires (for example, "Expires in 23h 59m")
- A link icon (Copy), to copy the download link
- A download icon, to download the file
Clicking the download icon saves the file directly to your device, using its original file name.
Once the file has expired, the card instead shows:
- The file name, struck through
- A Link expired label
- Disabled download and copy link buttons
- A note letting you know the export has expired, the file and download link are no longer available, and you'll need to re-run the agent or automation to generate a fresh one
Note The download link only works for people who are signed in to the same organization and can open the agent or automation that created the file. It isn't a public link.
File Retention
- Default: 1 day. After that, the file is deleted and the link stops working, so save a copy if you need it later.
- Longer retention: the retention period can be extended for your organization. You can't set a custom expiry time yourself.
- Expiry shown in: the file card in the execution log, and the expiry field in the automation's Create a File output.
- Once a file has expired, re-run the agent or automation to generate a new one.
Good to Know
- Every run creates new files: Each file is tied to the run that created it, and nothing gets overwritten.
- Files have a size limit: By default, files can be up to 5 MB; this limit can be raised for your organization. If the data is too large, an agent tries a smaller file first, and an automation reports that the file couldn't be created.
- Downloads only, no in-app preview: You can see a file's name, format and size in the execution log, but to see its contents you must download it.
- Export only: You can't import data through Files by Agent OS. To send files to an agent, use its HTTP trigger. For details, refer to the Send Files to an Agent documentation.