File
File is the GitHub component that works with the files in a repository: read a file’s content, see which files a folder holds, create a new file or change one that already exists. Every change is saved in GitHub as a commit with the message you set.
It is useful when a file’s content comes from, or is needed by, another process: a report an agent writes and you want to keep in the repository, a configuration file another step of the flow needs to read, or documentation you want to keep up to date automatically.
When to use it
- An AI agent writes the notes of a meeting and you want to save them as a file in the project repository.
- A flow needs to read a configuration or data file stored in GitHub before it continues.
- You want to check every week which files a documentation folder holds.
- You want to update a text file, such as a change log, every time something happens in another system.
Configuration
You need a GitHub API credential with a GitHub Personal Access Token that has access to the repository. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The GitHub API credential used to access your account. |
| Repository Input Type | How you specify the repository. Select picks it from a list; Manual lets you type it. Default: Select. |
| Repository | With Select. The repository to work with. The list loads when you choose the credential and shows up to 100 repositories from your account; if yours is not there, use Manual. |
| Repository ID | With Manual. The repository in the format owner/repository, for example my-company/website. It also accepts the repository’s GitHub link. |
| Operation (required) | What the component does. See Operations. Default: Get. |
| File Path (required) | The file’s path inside the repository, without a leading slash, for example docs/notes.md. Used in every operation except List Files. |
| File Content (required) | Only in Create and Edit. The file’s content. You can type it or connect it from another component, for example an agent’s answer. |
| Commit Message (required) | Only in Create and Edit. The message that goes with the change in the repository’s history. |
Operations
| Operation | What it does |
|---|---|
Get | Returns the content of a text file. |
List Files | Lists the files and folders in a folder of the repository. |
Create | Creates a new file. If a file already exists at that path, it is replaced with the new content. |
Edit | Replaces the content of an existing file. |
Advanced options
| Field | What it does |
|---|---|
| Branch | The repository branch to read from or write to. Default: main. If your repository uses a different main branch, for example master, change it. |
| Directory Path | Only in List Files. The folder to list, for example docs. Leave it empty for the repository’s top folder. |
| Limit | Only in List Files. The maximum number of items to return, up to 1000. Default: 100. |
Output
The Data output depends on the operation:
Get: the file’s path and its content as text.List Files: one item per file or folder, with its name, path, whether it is a file or a folder, its size, its GitHub link and, for files, the download link.CreateandEdit: a confirmation with the path and the branch. InCreateit says whether the file was created or an existing one was replaced.
You can connect the content you read to an agent so it can analyse it, or the list of files to a spreadsheet. The component can also be connected to an Agent as a tool, so the agent decides which files to read or write. See Tool Mode.
Example
A team wants to keep the summary of each weekly meeting in GitHub.
- An agent writes the summary from the meeting notes.
- Add File with the
Createoperation and pick the team’s repository in Repository. - In File Path write
meetings/followed by the date and.md, for examplemeetings/2026-10-05.md. - Connect the agent’s answer to File Content and write
Weekly meeting summaryin Commit Message.
Good practices
- Use
Getonly with text files, such as documents, notes or configuration files. Images and other non-text files cannot be read as content. - Check Branch before writing: changes are saved to that branch.
- Since
Createreplaces the file if it already exists, double-check the path so you do not overwrite a file by mistake.
Related components
- Repository: lists the repositories in your account.
- Issue: manage a repository’s issues.
- Release: manage published releases.
- Review: work with pull requests and their reviews.